crtexe.c: Unhandled exception when running C++ application outside Visual Studio 2008

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi all,<br/><br/>I am working on a C++ unmanaged application, recently imported in VS2008 from VS2005.<br/><br/>After using (for the first time) the executable created by VS2008, I came across a strange access violation exception that happens only outside VS2008, when the application exits; specifically, when executing the exit() call in the following portion of crtexec.c:<br/><br/>
<pre lang="x-c# int
__tmainCRTStartup(
void
)
{
...
...
/*
* Note that if the exe is managed app, we dont really need to
* call exit or _c_exit. .cctor should be able to take care of
* this.
*/
if ( !managedapp )
exit(mainret);
...
...
}[/code]
When running the application from within VS (in either debug or non-debug mode) nothing unexpected occurs.<br/><br/>When starting the application outside VS as a regular user would, and attaching to the process with VS2008, the application works fine, until I try to close it. At that point, going into the exit() statement above, it causes the following error as reported by VS2008:<br/><br/>"Unhandled exception at 0xcccccccc in ExecutableName.exe: 0xC0000005: Access violation reading location 0xcccccccc."<br/><br/>Any insights on what I could try next to resolve this would be greatly appreciated!<br/>Thank you!<br/><br/>I am copying some system information below, in case it helps.<br/>=======================================================================<br/>OS Name Microsoft Windows XP Professional<br/>Version 5.1.2600 Service Pack 3 Build 2600<br/>System Manufacturer Dell Inc.<br/>System Model Latitude E6500<br/>System Type X86-based PC<br/>Processor x86 Family 6 Model 23 Stepping 10 GenuineIntel ~2393 Mhz<br/>BIOS Version/Date Dell Inc. A12, 2/13/2009<br/>SMBIOS Version 2.4<br/><br/>Microsoft Visual Studio 2008<br/>Version 9.0.21022.8 RTM<br/>Microsoft .NET Framework<br/>Version 3.5
Installed Edition: Professional

View the full article
 
Back
Top