strange problem with release and debug builds

Started by
7 comments, last by IFooBar 21 years, 8 months ago
hello i have a problem ...(as if you guys havent heard that sentence enough) anyway...i compile my 2d engine in debug and it compiles fine...the debugger has no warnings and the debug level of d3d is set to maximum, so assume there cant be anything wrong with the code. then i compiled the release version and it also compiled fine _but_ it crashes when u execute it? is this a strange thing or is this common. shouldnt the debug catch any c\glitches...especially with the highes debug output selected? thanks MY HQ
[size=2]aliak.net
Advertisement
hello again
i just found out something else. i sent the release to a few people and it works perfectly fine for them. you think i need new drivers or something for my gfx card?
thanks

MY HQ
[size=2]aliak.net
It might be since the debug-mode will set all variables to 0 when you initialize them, while the retail won''t. So make sure you initialize them all.


--
MFC is sorta like the swedish police... It''''s full of crap, and nothing can communicate with anything else.
thanks for tryingto help. did what u said but it still dosnt work on my machine and it still works for the people ive sent it to.

Al Fareed
MY HQ
[size=2]aliak.net
It never hurts to upgrade your drivers anway...unless the upgrade contains spyware or other things.
-------------------------GBGames' Blog: An Indie Game Developer's Somewhat Interesting ThoughtsStaff Reviewer for Game Tunnel
Like tok_junior says the most common problem of builds working in debug and not release is due to debug setting all variables to 0 (a bad idea in my view) and release not. Often this rears its ugly head when you have forgotten to set a pointer to NULL so it is full of garbage. In debug you might get away with it as it will be set to NULL and code often has special case handling of null pointers e.g. it is perfectly valid to call delete with a null pointer. So fill your code from bottom to top with asserts and check every member variable in every class is initialised to a sensible default in the constructor.
------------------------See my games programming site at: www.toymaker.info
Hey, I thought it was okey to delete NULL.

Johan Ersvik
Johan
Yes, thats what I mean - it is ok to delete null, so in a debug version if you deleted a pointer before it was allocated it would be null by default and the delete would suceed but in release the pointer would be garbage so delete would try to delete a random bit of memory causing an unhandled exception
------------------------See my games programming site at: www.toymaker.info
hello

thanks for all the help. ive been debugging like made putting message boxes EVERYWHERE. ive finally found out where the problem is and why it fails. the problem is comming from
pd3d->EnumAdapterMode(...)
i use it in a for loop.
the for loop loops GetAdapterModeCount number of times. now it seems that GetAdapterModeCount is returning a number which is wrong. it returns 208 number of modes and once enumAdapterMode gets to around middle hundreds it fails and the program crashes even though i have an if(FAILED( macro there.
so i went to my display settings right and i saw modes that i have never seen before. i get modes upto 2048x1536
and im sure that before i had only up to mode 1024x768.
i guess in debug mode direct3d just ignores the wrong modes , but not the case with release mode thast why the release works for others but not for me (because my system assumes teh wrong number of supported modes)

now what to do. i have the latest drivers from nVidia already

thanks

Al Fareed
MY HQ
[size=2]aliak.net

This topic is closed to new replies.

Advertisement