Sign in to follow this  
xpload

Debugging problem

Recommended Posts

xpload    122
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
Palidine    1315
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
xpload    122
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this