RE: [GD-Windows] Call stack
Brought to you by:
vexxed72
From: Grills, J. <jg...@so...> - 2005-02-09 19:11:04
|
I went through three months of harassing MS about this, providing them with a sample app that reproduced the problem, and still they didn't figure out what the problem was. And here it is, the real reason, just like Dan said: if (!GetThreadContext(GetCurrentThread(), &context)) It sure would have been nice it this routine had failed. Looking at the docs for GetThreadContext(), MS claims the following: If you call GetThreadContext for the current thread, the function returns successfully; however, the context returned is not valid. Nice, an API with a silent failure. I really need to be able to capture call stacks at runtime from the running thread. We have a warning system used when the game detects but recovers from an error (usually caused by faulty data coming from our own staff), and call stacks have proven vital to fixing those problems. Good thing I broke down and wrote my own routine to capture the call stack - it was only 25 lines of code, and much faster than StackWalk, too. j -----Original Message----- From: gam...@li... [mailto:gam...@li...] On Behalf Of Daniel Vogel Sent: Wednesday, February 09, 2005 12:50 PM To: gam...@li... Subject: RE: [GD-Windows] Call stack > with the SP2 upgrade. StackWalk won't walk the whole stack -=20 > it just gives up after returning 2 call stack frames. I've=20 I attached the code of our stack walking implementation (sorry for the formatting, notepad didn't like our usage of tabs). It works fine for walking the stack after a crash as we have easy access to all the information we need to feed StackWalk64. > the stack. I have plenty of cases in the engine where I=20 > capture a call stack for debugging later if something else=20 IMO StackWalk64 is mostly useless for this case as you cannot call GetThreadContext on a running thread. http://msdn.microsoft.com/library/default.asp?url=3D/library/en-us/debug/= b ase/getthreadcontext.asp I assume you're doing this as that's exactly what we did with our proxy malloc and it broke with SP2 as well. -- Daniel, Epic Games Inc. |