Bug 6281 - Attaching to external process segfaults. Process being attached to locks up.
Attaching to external process segfaults. Process being attached to locks up.
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: gdb (Show other bugs)
6.1
i386 Linux
high Severity high
: ---
: ---
Assigned To: Nalin Dahyabhai
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-10-22 23:07 EDT by Sam Varshavchik
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-10-26 12:55:37 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Sam Varshavchik 1999-10-22 23:07:56 EDT
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
egcs-1.1.2-24
[mrsam@gwl testdir]$ rpm -q gdb
gdb-4.18-4
[mrsam@gwl testdir]$ cat t.c

int main()
{
        sleep(500);
        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
from...
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 12:55:59 EDT
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.