Crashes from .exe file (VSC++ 2005)

This topic is 3833 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

So my program runs from the ide fine when I click the "start debugging" button in both debug and release modes (I know its silly to debut the release version). However, when I build the project in release mode, then copy the .exe from the release folder to the project folder (so it gets all the relevant resource files) and run it, I get a crash soon after startup. The crash actually doesn't even finish its startup routine and enter the main game loop. I have tried to debug it, but I cant even look at the assembly. The only info I have gotten about the crash is it exits with the code: 0xc000000d at address 0x00000000004510e0 (I bet that address is useless to help diagnose the problem). My guess is that this is happening from some uninitialized variable or something similar, but my question is: how do I track it down? or is this some other problem?

Share on other sites
If you turn your Warning Level up, the compiler should be smart enough to catch many of your potential uninitialized variables. Also, you could look at the stack to see which function you crashed in.

Share on other sites
You can turn on debug info in the release build so that you get some info when it crashes. It may step weirdly as things get rearranged by the optimizer.

Share on other sites
You should be able to attach a debugger to the executable after it's crashed. You'll probably just have to tell it where the symbols (.pdb's) and source code are located, and then it will show you in the code where it's crashing.

Share on other sites
Thanks for the Quick and useful answers.

it was this chunk here from some code almost a year old... wonder why it wasn't crashing things before.
strncpy_s(stFileName,sizeof(char)*(strlen(stFileName)-1),			stFile,_TRUNCATE);//

so I changed stFileName to a std::string, like it should have always been, and every thing is just peachy now, thanks again.

-vs

Share on other sites
You can also have your program generate a crash dump file when it crashes. Afterwards, you can take this file and load it into the debugger.

Share on other sites
Quote:
 Original post by Red AntYou can also have your program generate a crash dump file when it crashes. Afterwards, you can take this file and load it into the debugger.

Ah that looks real useful actually. I thanks.

• What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 9
• 33
• 16
• 11
• 10
• Forum Statistics

• Total Topics
634122
• Total Posts
3015637
×