* LD_PRELOAD, SIGTRAP and step/next
@ 2005-03-17 12:45 David Lecomber
2005-03-17 14:12 ` Daniel Jacobowitz
0 siblings, 1 reply; 4+ messages in thread
From: David Lecomber @ 2005-03-17 12:45 UTC (permalink / raw)
To: gdb
Dear all,
I am debugging using a memory checking library -- dmalloc -- this does
the usual things via an LD_PRELOAD over the malloc. I am getting
SIGTRAP when trying to call a function in this library -- but only after
a step or a next; after a user-defined breakpoint behaviour is correct!
Can anyone explain/resolve the behaviour:
(gdb) set environment LD_PRELOAD=lib/libdmalloc.so
(gdb) b main
(gdb) run
Starting program: /home/david/projects/code/ddt/examples/a.out
Breakpoint 1, main (argc=1, argv=0xbffff604, environ=0xbffff60c) at
hello.c:65
65 int tag = 50; /* Tag for messages */
(gdb) print dmalloc_message("hello")ne}
void
(gdb) step
79 t2 = malloc(sizeof(typeThree));
(gdb) p dmalloc_message ("ho")
Program received signal SIGTRAP, Trace/breakpoint trap.
0xb7f831c3 in dmalloc_message (format=0x0) at malloc.c:2079
2079 {
The program being debugged was signaled while in a function called from
GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on"
Evaluation of the expression containing the function (dmalloc_message)
[..]
Very odd indeed!
d.
--
David Lecomber <david@allinea.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: LD_PRELOAD, SIGTRAP and step/next
2005-03-17 12:45 LD_PRELOAD, SIGTRAP and step/next David Lecomber
@ 2005-03-17 14:12 ` Daniel Jacobowitz
2005-03-17 14:17 ` David Lecomber
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2005-03-17 14:12 UTC (permalink / raw)
To: David Lecomber; +Cc: gdb
On Thu, Mar 17, 2005 at 12:44:15PM +0000, David Lecomber wrote:
> Dear all,
>
> I am debugging using a memory checking library -- dmalloc -- this does
> the usual things via an LD_PRELOAD over the malloc. I am getting
> SIGTRAP when trying to call a function in this library -- but only after
> a step or a next; after a user-defined breakpoint behaviour is correct!
Kernel version? This sounds like a Linux kernel bug that has since
been fixed...
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: LD_PRELOAD, SIGTRAP and step/next
2005-03-17 14:12 ` Daniel Jacobowitz
@ 2005-03-17 14:17 ` David Lecomber
2005-03-17 18:09 ` Daniel Jacobowitz
0 siblings, 1 reply; 4+ messages in thread
From: David Lecomber @ 2005-03-17 14:17 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb
On Thu, 2005-03-17 at 09:12 -0500, Daniel Jacobowitz wrote:
> On Thu, Mar 17, 2005 at 12:44:15PM +0000, David Lecomber wrote:
> > Dear all,
> >
> > I am debugging using a memory checking library -- dmalloc -- this does
> > the usual things via an LD_PRELOAD over the malloc. I am getting
> > SIGTRAP when trying to call a function in this library -- but only after
> > a step or a next; after a user-defined breakpoint behaviour is correct!
>
> Kernel version? This sounds like a Linux kernel bug that has since
> been fixed...
2.6.10-1.770_FC3smp
so pretty recent!
d,
--
David Lecomber <david@allinea.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: LD_PRELOAD, SIGTRAP and step/next
2005-03-17 14:17 ` David Lecomber
@ 2005-03-17 18:09 ` Daniel Jacobowitz
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2005-03-17 18:09 UTC (permalink / raw)
To: David Lecomber; +Cc: gdb
On Thu, Mar 17, 2005 at 02:15:22PM +0000, David Lecomber wrote:
> On Thu, 2005-03-17 at 09:12 -0500, Daniel Jacobowitz wrote:
> > On Thu, Mar 17, 2005 at 12:44:15PM +0000, David Lecomber wrote:
> > > Dear all,
> > >
> > > I am debugging using a memory checking library -- dmalloc -- this does
> > > the usual things via an LD_PRELOAD over the malloc. I am getting
> > > SIGTRAP when trying to call a function in this library -- but only after
> > > a step or a next; after a user-defined breakpoint behaviour is correct!
> >
> > Kernel version? This sounds like a Linux kernel bug that has since
> > been fixed...
>
> 2.6.10-1.770_FC3smp
>
> so pretty recent!
That's the one. Try an even more recent kernel.
(The bug wasn't very long lived; it was introduced and fixed between
2.6.10 and 2.6.11. I'm getting the feeling that FC3 picked it up
however.)
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-03-17 18:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-17 12:45 LD_PRELOAD, SIGTRAP and step/next David Lecomber
2005-03-17 14:12 ` Daniel Jacobowitz
2005-03-17 14:17 ` David Lecomber
2005-03-17 18:09 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox