Bug 6281 - Attaching to external process segfaults. Process being attached to locks up.
Summary: Attaching to external process segfaults. Process being attached to locks up.
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gdb
Version: 6.1
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 1999-10-23 03:07 UTC by Sam Varshavchik
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 1999-10-26 16:55:37 UTC

Attachments (Terms of Use)

Description Sam Varshavchik 1999-10-23 03:07:56 UTC
When gdb is attached to an existing process, the 'info
files' command causes gdb to segfault.  The process being
traced locks up, and must be kill -9ed.  This severely
impacts the Data Display Debugger front end for gdb.  I
cannot find a workaround.

Script started on Fri Oct 22 22:45:31 1999
[mrsam@gwl testdir]$ rpm -q egcs
[mrsam@gwl testdir]$ rpm -q gdb
[mrsam@gwl testdir]$ cat t.c

int main()
        return (0);

[mrsam@gwl testdir]$ gcc -g -o t t.c
[mrsam@gwl testdir]$ ./t &
[1] 9788
[mrsam@gwl testdir]$ gdb t 9788
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-redhat-linux"...

/usr/home/mrsam/testdir/9788: No such file or directory.
Attaching to program: /usr/home/mrsam/testdir/t, Pid 9788
Reading symbols from /lib/libc.so.6...done.
Reading symbols from /lib/ld-linux.so.2...done.
0x400a87f1 in __libc_nanosleep () from /lib/libc.so.6
(gdb) info files
Symbols from "/usr/home/mrsam/testdir/t".
Unix child process:
        Using the running image of attached Pid 9788.
        While running this, GDB does not access memory
Local exec file:
        `/usr/home/mrsam/testdir/t', file type elf32-i386.
        Entry point: 0x8048320
Segmentation fault (core dumped)
[mrsam@gwl testdir]$ exit

Script done on Fri Oct 22 22:46:02 1999

Comment 1 Jim Kingdon 1999-10-26 16:55:59 UTC
I was able to reproduce this with the GDB which ships with Red Hat
Linux 6.1.  I then tried a development version of GDB (see
http://sourceware.cygnus.com/gdb/) and did not see the problem.
So it is presumably fixed in gdb-4.18-6 which is in rawhide (or
failing that, a GDB you build yourself from the development sources).

Note You need to log in before you can comment on or make changes to this bug.