Solved: Crashes when run outside the debugger in release builds

Started by
4 comments, last by eq 18 years, 8 months ago
As the title suggest my application crashes when I execute it outside the debugger. Debug build works inside and outside the debugger environment. Release build works inside the debugger environment. I recall that I've had similar problems before and it's most probably because the debugger uses some other memory manager. I also realize that the most probable cause is an uninitiated variable somewhere in my code (that get's initiated diffrently by the different memory managers). The question is: how do you find a bug like this? I know exactly where the crash happens (after some logging), it's using a variable that all of a sudden turned zero (the exact same variable wasn't zero when it was used several times before). So probably something overwrites the space of the crashing variable with zero!? I've tried tools like DevPartner's Integration Error Detection without any luck :( Any ideas are welcomed! [Edited by - eq on August 17, 2005 7:24:13 AM]
Advertisement
Just off the top of my head because I read something random related to what I'm doing.. are you using dynamic_cast? check you've enabled Run-Time Type Information (RTTI) in both your debug and release settings (Project settings under c/c++ | c++ Language)

Without it I get this error when I run a release build.
"MSVC++ Runtime Library - Runtime Error!"

To that end, just check out all the differences in project settings between debug and release versions.

DaveC
maybe your cache size is too small?

I ran into this problem when i had a HUGE struct for my units.. :D
"Game Maker For Life, probably never professional thou." =)
I had the same problem in one of my projects. My mistake was that I didn't properly initialize my local variables.
bobason456: Nope, not using RTTI.
Rasmadrak: !? The cache usage and size should be the same inside the debugger or outside, right?
It's the same .exe without any recompile inbetween.
Kalasjniekof: Exactly what I wrote, the problem is to find which ones...
It's quite a huge project, the .exe is over 6mb.
Found the uninitiated variable..
How the **** has this application been working for months without this one hitting me before?!

That's scary =)

Thanks for all suggestions.

This topic is closed to new replies.

Advertisement