<<< Date Index >>>     <<< Thread Index >>>

Re: Segmentation fault



In the last episode (May 13), Brendan Cully said:
> On Friday, 13 May 2005 at 12:17, Thomas Glanzmann wrote:
> > > ==30662== Source and destination overlap in strncpy(0x52BFCF10, 
> > > 0x52BFCF19, 128)
> > > ==30662==    at 0x1B9019B6: strncpy (mac_replace_strmem.c:113)
> >
> > I guess I found the problem. CTX has three hashes: id_hash, subj_hash *and*
> > thread_hash. But the thread_hash isn't handled at all. So it breaks of
> > course.
> 
> Nice job tracking it down. You've convinced me I should check out
> valgrind one of these days :)

Another tool to look at is the bounds-checking gcc patches at
http://sourceforge.net/projects/boundschecking/ .  It attacks the
problem from the other end: all C variables are tracked individually,
which lets it catch things valgrind doesn't, like array or struct
overflow into adjacent memory.  It's also more portable than valgrind.

-- 
        Dan Nelson
        dnelson@xxxxxxxxxxxxxxx