Re: stack corruption?

Jason Molenda
2005-06-14T21:26:55Z

On Jun 14, 2005, at 1:52 PM, Louis LeBlanc wrote:

> Basically, I'm not entirely sure. The codebase in question has never
> had this problem in the past, but now (with a newer version of gdb,
> and after much work on my code) I always get the corrupt stack notice
> when I open the process in gdb.

You mean you're doing a backtrace and mid-way through you get an
error message like

Previous frame identical to this frame (corrupt stack?)

and the backtrace stops at that point? These days, the majority of
the time, this is gdb getting confused. Your program don't
necessarily have a corrupt stack.

> The gdb version I am using is:
> $ gdb -v
> GNU gdb 6.3.0.20050516-cvs
>
> I have been planning to get a later snapshot, but haven't gotten
> around to it yet.

In addition, I'd recommend grabbing an older gdb and give that a try,
like 6.0. There was some work done in the frame handling code that
changed the way stack backtraces are done, and it gives up too
easily. I don't remember when the new frame code went in, but
gdb-6.0 is probably early enough. Downloading & building gdb doesn't
take much time; it's worth doing this as a sanity check.

Jason