• Advertisement
Sign in to follow this  

Crashes in Release Mode , works fine in debug mode

This topic is 4587 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is a sortof common problem i guess... and i have been suffering from this problem since the very early days of VC6. Someone once told me that an erroneous program would work fine in debug mode cuz VC6 compiler would allocate more memory and might do some initialization while built in debug mode. Hence , some suble errors would go under your nose totally undetected. But hell break loose in Release Mode :(. I thought this problem would have been solved in VC7 but actually it wasn't :(. One of my recent projects crash quite unpredictably in Release Mode while works absolutely fine in Debug Mode. Has anyone got any nice way of handling these types of situation ???????????????????????????????

Share this post


Link to post
Share on other sites
Advertisement
General advice for this kind of problem: make sure you initialize every variable, make sure there are no buffer overruns and compile your program at /W4 and make sure you either fix every warning or know for sure that the warning is benign.

Share this post


Link to post
Share on other sites
Thanx for the advice.. but still what do actually do once u run into
these situations.. and specially when u r dealing with a HUGEEEEEE project. Is there any nice way of using those MEMORY DUMP (usually thrown by Windows itself), information plus other ways of atleast understanding the root of the problem ? What i am basically looking for is how to look/use memory maps, memory dumps to debug a program

Share this post


Link to post
Share on other sites
The fact that your program is huge is certainly regrettable, however the error you have is extremely like to be an uninitialised variable. The problem should have been picked up when it was first introduced, such that you would have very litle code which could be the culprit. However, as this bug has been allowed to exist for some time, it will now be very difficult to find.

Get a feel for the general area in you code where you think the problem is. Comment out non-essential parts to see if the problem goes away, to narrow it down. Look hard for uninitialised variables and initialise them. Make sure you have lots of asserts to catch future problems.

After trying that, you may wish to look into using userdumps.
clicky1 clicky2

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement