Advertisement

Compiler optimization causes program to crash

Started by November 21, 2000 08:40 AM
4 comments, last by MothaBrain 24 years, 2 months ago
Hi developers, in our game we'd like to use the compiler optimization (Watcom 11.0, Win32) since it makes it quite faster. However the program crashes with an error when i _quit_ the game although it runs fine the rest of the time. (Without optimization it works perfect) Could it be my fault? Perhaps i caused some memory shit and now, with different compiled code, the system recognizes the error? Hope you can help Robert Clemens, 17, Germany Have a look at our action-stunt-game "Crashday" at http://www.moonbyte.de Edited by - MothaBrain on 11/21/00 8:46:19 AM
I''d lay pretty good odds on this being your fault somehow. Bugs in the compiler happen but they''re very rare compare to user error.

These problems are a pain to figure out. In my experience they''re cause by one of two things. You may have an unitialized variable someplace that just happens to be set to 0 or some other "correct" value in debug mode but not in optimized mode. Or you''re trashing memory someplace as you say and it just happens to not affect the debug version for some reason.

Try scattering printf''s or some other logging code in your program to try to figure out the exact line it''s crashing on and work backwords from there.

-Mike
Advertisement
Thanx Mike,

i thought it would be hard to find the bug out, so i have to do it now
i`ll try to find the "crash point" out, it seems to me as the best solution.

Robert Clemens, 17, Germany
Have a look at our action-stunt-game "Crashday" at http://www.moonbyte.de
There''s an excellent memory-manager posted on www.flipcode.com under the "Ask Midnight" section. That would give you lot''s of useful info and help you track down any memory problems.

ftp://ftp.flipcode.com/code/mmgr.zip



David
More than likely it''s the uninitialized var. In debug mode -most- compilers init all vars to binary or default 0.




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I have no name that you may call me. I am merely Succinct.
~Succinct Demos Online~
"Hey, where''d that display list rotate off to now?"
-(Drop me a line here)-

-- Succinct(Don't listen to me)
Thanx to all, i''m searchin...

This topic is closed to new replies.

Advertisement