Need help with stack smash

Adam Jackson ajax at redhat.com
Thu Aug 27 19:07:07 UTC 2009


On Thu, 2009-08-27 at 12:36 -0600, Orion Poplawski wrote:
> I'm trying to debug a stack smash in of the hdf test programs but am 
> having a hard time tracking down exactly where the smash happens.  Is 
> there any way to watch the guard variable with gdb to find exactly when 
> it happens?  Something similar?

(gdb) help watch
Set a watchpoint for an expression.
A watchpoint stops execution of your program whenever the value of
an expression changes.

Note that this means what it says: if your expression contains a symbol
that goes out of scope before the change happens, then the watchpoint
will be forgotten, because the value of the expression will change from
being a value to being not-a-thing.  So you would need to set the watch
on the address in memory of what you're trying to watch, and not
necessarily on its symbolic name.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/fedora-devel-list/attachments/20090827/a3f54555/attachment.sig>


More information about the fedora-devel-list mailing list