Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / November 2004

Tip: Looking for answers? Try searching our database.

C++ application creash after 1 minute

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
zoltan - 09 Nov 2004 14:08 GMT
Hello,

I have a C++ MFC application which sometimes crashes exactly 1 minute after
starting the app. "sometimes" means maybe after the first start, maybe after
the tenth. The crash happens on Windows 2000 SP 4 but does not happen on
Windows XP. It happens only in release build, not in debug build.

I tested the application with two different testing tools (in debug build).
There seems to be no memory corruption or any other bad memory handling.

Dr Watson says on most computers:

eax=00000000 ebx=00000102 ecx=00000101 edx=ffffffff esi=00144608 edi=77e73ace
eip=00000000 esp=0221ff94 ebp=00007530 iopl=0         nv up ei pl zr na po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=0038  gs=0000             efl=00000246

Funktion: <nosymbols>
FAULT ->00000000 ???
       00000001 ???
       00000002 ???
       00000003 ???

*----> Stack Back Trace <----*

FramePtr ReturnAd Param#1  Param#2  Param#3  Param#4  Function Name
0221FF90 77AA50EE 00000000 77A40000 00144608 0221FFEC !<nosymbols>
00007530 00000000 00000000 00000000 00000000 00000000
ole32!CoFreeAllLibraries

...but I have a case where the function name is different:

eax=00000000 ebx=00000102 ecx=00000101 edx=ffffffff esi=0014b928 edi=7c4fc468
eip=00000000 esp=0222ff94 ebp=00007530 iopl=0         nv up ei pl zr na po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=0038  gs=0000             efl=00000246

function: <nosymbols>
FAULT ->00000000 ???
       00000001 ???
       00000002 ???
       00000003 ???

*----> Stack Back Trace <----*

FramePtr ReturnAd Param#1  Param#2  Param#3  Param#4  Function Name
0222FF90 77AB46FB 00000000 77A50000 0014B928 0222FFEC !<nosymbols>
00007530 00000000 00000000 00000000 00000000 00000000
ole32!UpdateDCOMSettings

Has anybody an idea what could cause the crash?
Oleg Starodumov - 09 Nov 2004 15:33 GMT
Some possible reasons:

1. Call through a function pointer whose value is 0.
If you call functions through pointers, check all places where it is done.
Check all such pointers for being 0 before calling the function.

2. Function return address on the stack corrupted, usually because
of writing past boundaries of an array allocated as a local variable.
Try to recompile the application with /GS compiler option.

3. Heap corruption (vtable pointer corrupted for an object allocated on the heap)
Test release build of your application with appropriate tools,
testing debug build is rarely enough.

Also produce debug information for your release build,
it will make debugging easier. Use the following options:
Compiler: /Zi
Linker: /debug

Also consider tracing to a file, it will tell you what the application
was doing before the crash.

Also check this link:
http://www.flounder.com/debug_release.htm

Regards,
Oleg

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.