Exception Only In Release Mode

BlitzMax Forums/BlitzMax Programming/Exception Only In Release Mode

BLaBZ(Posted 2011) [#1]
I have an exception that keeps being thrown only in release mode.

I tried wrapping my main loop in a try catch block but I can't seem to catch it and decipher it.

Does try catch only work in Debug mode?


ima747(Posted 2011) [#2]
Shot in the dark but try rebuilding your modules, might be something out of whack in there...


GfK(Posted 2011) [#3]
Happens to all of us sooner or later. I generally use a load of DebugLogs that spit out unique codes at various points - that way when the game falls over I can see roughly where it happened.


H&K(Posted 2011) [#4]
Its even worse when all your Debuglogs are wrapped in conditional build only in Debug blocks.

I Dont know if catch only works in debug, Id be supprised if that was the case tho.


ima747(Posted 2011) [#5]
try/catch works in release, I use to to catch a potentially fatal read exception with malformed data.


Czar Flavius(Posted 2011) [#6]
I've not had success in wrapping entire sections of program in try-catch before. It just made the errors weird.

In release mode there are less checks for errors than in debug mode. For example, using a null object, having an array of objects and using them before initialising them, can sometimes go through without an error in release mode. But this just means you get a harder to track error later on. Do arrays check bounds in release mode?

Last edited 2011


SLotman(Posted 2011) [#7]
Open a log file, and write to it all the time. Best way to debug a 'release mode only' bug.

You can have the log file - or maybe show some infos on a debug area on screen.

But the first method works best, since the game could freeze, but still be running without updating the screen.

With this, at least you can narrow down the problem to a specific area/function/variable or command in the code.

Last edited 2011