Jump to content
  • Advertisement
Sign in to follow this  
POLSKASH

What's the problem here?

This topic is 4719 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 been writing my saving/loading system for my game, and everything compiles fine. However, when I run the program without debugging, it crashes. When I run it under the debugger (no break points), it works flawlessly. Same code. What's the deal?

Share this post


Link to post
Share on other sites
Advertisement
2 possible things right off.

1. The debugger is often very nice about initializing memory for unused variables [or vice versa, I never remember...]. Anyways, check for any variables used without first assigning or initializing them.

2. The executables will be different sizes. If you're overwriting an array/buffer somewhere it might overwrite something important in one version [explosion], and something benign in another.

Plus, if the app is multithreaded, I imagine there might be timing changes between the versions.

Share this post


Link to post
Share on other sites
As Telastyn has said, probably you are overwriting memory somewhere. Only other possible reason that comes to my mind would be assertions. Do you use them? If so, it might be something like assert(DoSomething()); which wouldn't be executed in release builds.

Share this post


Link to post
Share on other sites
a description of the 'crash' would be helpful. Usually read/write errors to invalid memory locations will be an access violation. There is much that you can learn based on the address given for the error.

also something to consider: my project at work had a similar issue. In my specific case, it was due to compiler optimization. One of the modules simply doesn't work if compiler optimization was enabled on it. By default, release builds are optimization-enabled on VC++. Its a long shot, but you might wanna give it a check.

Share this post


Link to post
Share on other sites
Quote:
Original post by Telastyn
1. The debugger is often very nice about initializing memory for unused variables [or vice versa, I never remember...]. Anyways, check for any variables used without first assigning or initializing them.


I just figured out that this was biting me in the ass today. On debug mode, no problem. But in release, my boolean wasn't getting set to false --> game didn't work right.

Share this post


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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!