C++ application creash after 1 minute

G

Guest

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?
 
O

Oleg Starodumov

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top