Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

okonomiyaki

Crashing in release, not debug.. sigh..

This topic is 5197 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

I''ve tried to hours to debug this problem. I have gotten absolutely NOWHERE. I''m using Visual Studio .NET 2003. I compile my program. I run it in debug mode. It works fine. I''m testing a GUI that involves listboxes and textboxes. I then run it in release mode. After 15 seconds the program crashes (like a memory protection error). It happens at various places, usually I can get past the first screen or two, but it always ends up crashing. It works ''perfectly'' fine in debug. I know that debug mode may compile it with safety checks and different machine code... but how in the world would I debug something like this? I really need some suggestions, as this big project is due next Tuesday and I''m really burned out right now Thanks a lot everyone!

Share this post


Link to post
Share on other sites
Advertisement
do you have a logfile?
you should be ble to debug anything like that without the help of a debugger.
if you can access a console, just throw in some printf or whatever to localize the crash. (if you haven''t already)

Share this post


Link to post
Share on other sites
I nice version to make it crash is to check pointers for non-null on startup. In debug they''ll be set to 0xcdcdcdcd while in release they can be 0, but can be anything else too.

Debugging release is ugly, usually they best way is to use heavy logging. Add "log i''m here" and "log i''m at pos b" and if it crashes in between draw the two logs closer. Trap the crash

Share this post


Link to post
Share on other sites
I''ve had problems like this before where debug mode runs and release mode doesn''t. I''ve found this to, in my cases, always be the result of uninitialized variables. In debug mode variables and initialized to standard value, in release mode they aren''t initialized and could be anything.

Share this post


Link to post
Share on other sites
Unitialized variables can give this result.
Also try it without global optimization. If it works, then you probably have errors in function calls.

Share this post


Link to post
Share on other sites
quote:

do you have a logfile?
you should be ble to debug anything like that without the help of a debugger.
if you can access a console, just throw in some printf or whatever to localize the crash. (if you haven''t already)



I have tried this, somewhat at least. I quit because it varied when it happened, sometimes it happened when typed a letter in a textbox, sometimes it happened when I am searching the listbox for text. I supposed this is only real way to deal with it though, as there might even be more than 1 wrong place.

quote:

Also try it without global optimization. If it works, then you probably have errors in function calls.



Yeah, I tried that, but it still didn''t work. So I''m guessing it''s something with an uninitialized variable somewhere... I usually have a good habit of doing that though

Thanks a lot everyone.

Share this post


Link to post
Share on other sites
You don''t by any chance have multiple threads in your program, do you? Or use any libraries that often create their own internal threads? ''Cause threads can be a great source of unpredictable errors like this. Often caused by not carefully synchronizing code with events, mutexes, semaphores, or whatnot.


Most of the greatest evils that man has inflicted upon man have come through people feeling quite certain about something which, in fact, was false.

-Bertrand Russell, Unpopular Essays, "Ideas That Have Harmed Mankind"

Share this post


Link to post
Share on other sites
i''ve never had a problem debugging in release mode (MSVS.NET C++ apps). build release -> F5 to run -> debugger breaks out on line with error... do other people not find this to be the case?

-me

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!