Debug versus release build
by Daniel Buckmaster · in Torque Game Engine · 09/21/2010 (6:04 am) · 3 replies
Can anyone tell me precisely what the compiler does differently when building Torque in a debug mode? I've just finished my hierarchical A* pathfinding system, and it works flawlessly in debug mode... but has stopped working at all in a release build! To be fair, I should have been checking release builds continuously throughout development (I thought I did do this semi-regularly... apparently not :P), but it's frustrating to say the least.
About the author
Studying mechatronic engineering and computer science at the University of Sydney. Game development is probably my most time-consuming hobby!
#2
A big part of this system did involve writing two of my own low-level data structures, which I figured would be the cause of any underlying memory-allocation errors... but both of them are testing fine in the release build, so the problem's not there.
Aside from that, I don't think I'm using any strings. The problem seems to be confined to a certain update method which isn't doing its job. The method is basically just linked list modification... hmm.
Also, even more bizarrely, I just did some more tests, and things worked perfectly... once. When I tried getting different paths (or even the same path again), it didn't work.
09/22/2010 (12:52 am)
Quote:I find that Release only bugs are usually caused by memory allocation issues.Thanks - I figured it'd be something like this. I guess it'll be a matter of figuring out where a compiler might be breaking my fall in terms of memory allocation... or printf debugging :P.
A big part of this system did involve writing two of my own low-level data structures, which I figured would be the cause of any underlying memory-allocation errors... but both of them are testing fine in the release build, so the problem's not there.
Aside from that, I don't think I'm using any strings. The problem seems to be confined to a certain update method which isn't doing its job. The method is basically just linked list modification... hmm.
Also, even more bizarrely, I just did some more tests, and things worked perfectly... once. When I tried getting different paths (or even the same path again), it didn't work.
#3
Hope this helps :-)
09/22/2010 (1:41 am)
If I understand correctly, everything works fine in debug mode, but in release mode only works once? I would check to see if your pointers are initialized to NULL when they are defined. In debug mode pointers are automatically assigned a NULL value, but not in release mode. Also make sure that all memory in your data structures are properly deallocated and pointers reinitialized to NULL before reused. Hope this helps :-)
Torque Owner Alain Labrie
Ware-Wolf Games