Re: Diagnosing corrupted stacks
Re: Diagnosing corrupted stacks
- Subject: Re: Diagnosing corrupted stacks
- From: Michael Crawford <email@hidden>
- Date: Wed, 29 Apr 2009 20:12:53 -0700
Try checksumming some of your stack variables - but just the ones that
you know shouldn't change. If you pass a non-const pointer or
reference to a stack variable, then that's likely to change, but those
that aren't passed, or only passed as const, would qualify.
There's probably some way to do this in a harmonious fashion, such as
a registration function that takes the address and sizes of areas to
checksum. Then you can add most of your local variables within each
function call, and de-register them just before that function returns.
At first call the function that actually does the checksumming at the
beginning and return of each function. If you can find a checksum
failure in a particular function, then do a binary search within that
function.
It will be a little more tricky if a different thread is overwriting
your stack, but this method should still work in principle.
Mike
--
Michael David Crawford
mdcrawford at gmail dot com
GoingWare's Bag of Programming Tricks
http://www.goingware.com/tips/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden