Re: Bad 2.3.10 + gdb interaction

Tim Waugh (tim@cyberelk.demon.co.uk)
Sat, 17 Jul 1999 00:10:34 +0100 (GMT)


On Sat, 10 Jul 1999, Jim Nance wrote:

> Hi Tim,
> Its not quite that simple for me. I have a breakpoint set in main(),
> and when it get to that breakpoint everthing still works. Then I do
> a continue, and somewhere along the way I cant start other programs.
> I assumed it was due to the pthreads, but I dont know that.

As far as I've got is this:

If I detach from a simple program before it calls exit, nothing goes
wrong.

If I let it exit, everything starts to break.

By 'break', I mean that when processes (unrelated to gdb) execve they get
sent SIGTRAP, even though they aren't PF_PTRACED. But it isn't coming
from the obvious place in binfmt_elf.c, and in fact when
do_load_elf_binary exits, current->signal is 0.

Starting from a freshly-booted system I can do this:

[tim@cocobean tim]$ gdb
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "i386-mandrake-linux".
(gdb) file sleep
Reading symbols from sleep...(no debugging symbols found)...done.
(gdb) set args 1
(gdb) run
Starting program: /bin/sleep 1

Program exited normally.
(gdb)
[1]+ Stopped gdb
[tim@cocobean tim]$ ls
Trace/breakpoint trap

I.e., at this point, things have started breaking.

[tim@cocobean tim]$ fg
gdb
(gdb) run
Starting program: /bin/sleep 1

Program received signal SIGTRAP, Trace/breakpoint trap.
0x4000b191 in ?? ()
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0x40001790 in ?? ()
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0x4000b191 in ?? () from /lib/ld-linux.so.2
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0x4000b191 in ?? () from /lib/ld-linux.so.2
(gdb) c
Continuing.

(1 second pause)

Program exited normally.
(gdb)

So the 4 SIGTRAPs (and there are always 4) get sent before the execve, but
afterwards there are none.

Any ideas, anyone?

Tim.
*/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/