Jump to content
  • Advertisement
Sign in to follow this  
xpload

Debugging problem

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a real strange problem. Perhaps my question is not exactly for this forum but I didn't find more suitable one :( I use Visual C++ and its compiler. An access violation runtime error occurs in my game, but only when I run the project without debug-option. With F5(Debug) the problem does not appear. Moreover, when I add a certain function call on the problematic place, the error disappears. Usually I use 'printf' methods to find the problematic line of code and then analyze the behavior of the program, but this method does not work for errors, which appear randomly :(. I would be very grateful if someone would suggest suitable debugging method...

Share this post


Link to post
Share on other sites
Advertisement
It sounds like you might have some uninitalized variable somewhere in your code. It can often cause this kind of behaviour.

Share this post


Link to post
Share on other sites
you can compile Release builds with debugging symbols that will not initialize memory. You have a very good chance of finding the callstack: though release build callstacks sometimes lie.

Look in the linker setting and enable the debugging symbols and try to run it again as a release build through the debugger.

Another possibility (if you have multiple threads) is that your problem is a memory stomp (i.e. one bit of code is writing onto someone else's memory). If this is the case you're in for a world of hurt because it's only showing up not in the debugger because the debugger can effect the timing of the execution of the threads. funtimes.

It's probably just an uninitialized variable though.

-me

Share this post


Link to post
Share on other sites
Hmm I observed precisely the code and saw no unitialized variable. However, I use a linked list structure within my engine, so maybe the problem is an invalid pointer? The problem is, the error occurs on a place with no linked-list code, so I can't realize how can an access violation appear on place, where nothing is accessed at all?!

@Palidine
I'm not sure whether I understand your suggestion but I'll try to 'educate' myself before asking further :) Is callstack the order the functions are called? I haven't used any debuggers til yet and don't know how to use this one :(

P.S. I'm quite a beginner in Windows programming, but I doubt that my application is multi-threaded. It is a common WinApi with message loop and WndProc...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!