This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/10256] New: gdb hangs when attaching to a suspended process


This is happening completely consistently for me. At first I thought it was a
problem with the process i was trying to trace, but it doesn't seem to matter
what process.

Simple repro steps:

dnikdel@s-us-prog-1:~$ pico blah
^Z (suspend process)
[1]+  Stopped                 pico blah
dnikdel@s-us-prog-1:~$ ps a
  PID TTY      STAT   TIME COMMAND
 1728 pts/0    Ss+    0:00 -bash
 2693 tty1     Ss+    0:00 /sbin/getty 38400 tty1
18745 pts/4    T      0:00 pico blah
18747 pts/4    R+     0:00 ps a
dnikdel@s-us-prog-1:~$ gdb --pid=18745
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Attaching to process 18745

gdb just hangs here. If I start gdb up in the background and then manually
unsuspend the original process 'kill -CONT <pid>' I get the following bailout
from gdb:

/build/buildd/gdb-6.8/gdb/linux-nat.c:988: internal-error: linux_nat_attach:
Assertion `pid == GET_PID (inferior_ptid) && WIFSTOPPED (status) && WSTOPSIG
(status) == SIGSTOP' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)

Here is the system info:

$ uname -a
Linux <servername> 2.6.28-11-server #42-Ubuntu SMP Fri Apr 17 02:45:36 UTC 2009
x86_64 GNU/Linux
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.04
DISTRIB_CODENAME=jaunty
DISTRIB_DESCRIPTION="Ubuntu 9.04"

I was under the impression that stopping a process with SIGSTOP and then
attaching to it with the debugger is supposed to be supported, but I'm not
entirely familiar with the idiosyncrasies so please let me know if I'm doing
something horribly wrong here.

-- 
           Summary: gdb hangs when attaching to a suspended process
           Product: gdb
           Version: 6.8
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: dnikdel at red5studios dot com
                CC: gdb-prs at sourceware dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=10256

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]