Advertisement

Debug vs. Release

Started by July 05, 2000 11:09 AM
8 comments, last by Gandalf 24 years, 5 months ago
Why does my program not run i release mode but only in debug mode? Thanx, Gandalf the White
You'll find a golden ring...
Gandalf the Black

make sure all variables are initialized to a known state. Debug builds do this automagically and release does not.

Funky problems that show up in release builds and not debug are usually the result of uninitialized data ( check all pointers ).

Advertisement
Thanks, I do so.

Gandalf the White

You'll find a golden ring...
Gandalf the Black
The shit is, it works on all computer without the the fucking compaq! In both release an debug.

Gandalf the White

You'll find a golden ring...
Gandalf the Black
what i hate is the fact that when I compile my engine in release mode and it runs faster than in debug mode...



dw

--
davidw@heehaw.com
neonstar entertainment
--david@neonstar.netneonstar entertainment
There are a few factors at play here that can cause a release build to break when it works fine in debug mode. The variable initialization, as touched on earlier, is by far the most common. If your using Assert macros, those often break things as well..consider:

Assert(myObj->Function());

Your actually making a real function call here, and it is going to go away in release mode. Make sure your only using assert to check values of stuff, not actually doing anything in the assert.

From there it gets a little crazy. The "new" operator (i''m not sure about malloc) in debug mode inserts ''guard bytes'' into each memory allocation. Often people overwrite into these guard bytes during a debug release without ever realizing it..and down it goes in release mdoe where these bytes don''t exist. In debug mode the compiler inserts a stack check into each function. In release mode the compiler usually does no stack checking..if your accessing memory in a non linear (sequential) order..that can cause some problems.

There are some other bizzare things that can cause it to go down..the best thing to do is figure out exactly where the crash is and closely examine the environment in which it''s happening.
Advertisement
neonstar,

Why do you hate that it runs faster in release mode than in debug mode? You are lucky, that is what is supposed to happen

-Andreas
-Andreas
Maybe you forgot to link the libs?
quote: Original post by Jrz

Maybe you forgot to link the libs?


If Gandalf forget to link with the libs, the program wouldn''t compile at all.

- Muzzafarath

Mad House Software
The Field Marshals
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
Intresting thing about "guard bytes" in debug mode, Enjolras. I think I access the memory in a linear order. It only crash on this compaq computer. On 4 other computers it works fine in both release and debug mode. Im not using any Asserts.

I think I have to put on the brain cap again...

Gandalf the White

You'll find a golden ring...
Gandalf the Black

This topic is closed to new replies.

Advertisement