[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gdb, stderr, totally baffing experience!
From: |
Leland Hovey |
Subject: |
Re: gdb, stderr, totally baffing experience! |
Date: |
Fri, 24 Jan 2003 15:58:31 -0500 (EST) |
I'm been working with a Valgrind, an open-source memory debugger, and its
been useful for finding minor memory bugs. I think its designed for C++
but it actually works ok on heatbugs. The manual is easy to read and
with only a few options set you can fix your code. Specifically, the
option to attach to gdb was the most helpful.
http://developer.kde.org/~sewardj/
-Leland H.
On Fri, 24 Jan 2003, Paul E Johnson wrote:
> thanks. line 438 is the fprintf line.
>
> Paul Box's suggestion that some class is running off the end of an array
> and damaging memory is a pretty good guess. I've been going through this
> code getting rid of C arrays and converting to Swarm lists and the seg
> fault has disappeared.
>
> address@hidden wrote:
> > Paul Johnson writes:
> > > Program received signal SIGSEGV, Segmentation fault.
> > > 0x420503da in vfprintf () from /lib/i686/libc.so.6
> > > (gdb) bt
> > > #0 0x420503da in vfprintf () from /lib/i686/libc.so.6
> > > #1 0x4205a297 in fprintf () from /lib/i686/libc.so.6
> > > #2 0x08050ff4 in _i_Agent__updateFamily (self=0x8b6d2d8,
> > > _cmd=0x8058790) at Agent.m:438
> > > #3 0x08050907 in _i_Agent__step (self=0x8b6d2d8, _cmd=0x8056e00) at
> > > Agent.m:256
> > > #4 0x40017ddb in L10 () from /usr/lib/swarm/libswarm.so.0
> > > #5 0x40205120 in objc_call (fa=0x8c36f10)
> > [...]
> > > Is it possible that, when some part of a program accesses memory so
> > > badly that it could damage memory in use by uniformIntRand in a way that
> > > totally baffles the gdb?
> >
> > It's not necessarily true that gdb is baffled. I suspect there
> > is something in Agent::updateFamily() that is screwing up the
> > memory... dropping something that shouldn't be dropped, overwriting
> > something... missing a null character at the end of a string...
> > buffer overrun... etc. that is only being detected by the
> > vfprintf() function. You're error is most likely at line
> > 438 in Agent.m.
>
>
>
> --
> Paul E. Johnson email: address@hidden
> Dept. of Political Science http://lark.cc.ku.edu/~pauljohn
> 1541 Lilac Lane, Rm 504
> University of Kansas Office: (785) 864-9086
> Lawrence, Kansas 66044-3177 FAX: (785) 864-5700
>
>
> ==================================
> Swarm-Support is for discussion of the technical details of the day
> to day usage of Swarm. For list administration needs (esp.
> [un]subscribing), please send a message to <address@hidden>
> with "help" in the body of the message.
>
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.