public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/18368] New: gdb with nsenter attaches to wrong process
@ 2015-05-02  2:55 raghu.prabhu13 at gmail dot com
  2015-05-04 10:02 ` [Bug gdb/18368] " palves at redhat dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: raghu.prabhu13 at gmail dot com @ 2015-05-02  2:55 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18368

            Bug ID: 18368
           Summary: gdb with nsenter attaches to wrong process
           Product: gdb
           Version: 7.9
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: raghu.prabhu13 at gmail dot com
  Target Milestone: ---

When trying to attach to a process in a different PID namespace, gdb correctly
identifies it and warns as "warning: Target and debugger are in different PID
namespaces; thread lists and other data are likely unreliable"

however, when used with nsenter (-p for pid namespace), it attaches to the
wrong process.


nsenter  -t 600  -p gdb -p 1      (where 600 is the PID of docker daemon, and 1
is the PID of process inside it, whose host pid is 29120).

GNU gdb (GDB) 7.9
.......
......
Attaching to process 1
Reading symbols from /usr/lib/systemd/systemd...(no debugging symbols
found)...done.
Reading symbols from /usr/lib/libcap.so.2...(no debugging symbols
found)...done.
Reading symbols from /usr/lib/libpam.so.0...(no debugging symbols
found)...done.
Reading symbols from /usr/lib/libkmod.so.2...(no debugging symbols
found)...done.
Reading symbols from /usr/lib/libmount.so.1...(no debugging symbols
found)...done.
Reading symbols from /usr/lib/libseccomp.so.2...(no debugging symbols
found)...done.
Reading symbols from /usr/lib/librt.so.1...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libpthread.so.0...(no debugging symbols
found)...done.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Reading symbols from /usr/lib/libc.so.6...(no debugging symbols found)...done.
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols
found)...done.
Reading symbols from /usr/lib/libattr.so.1...(no debugging symbols
found)...done.
Reading symbols from /usr/lib/libdl.so.2...(no debugging symbols found)...done.
Reading symbols from /usr/lib/liblzma.so.5...(no debugging symbols
found)...done.
Reading symbols from /usr/lib/libz.so.1...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libblkid.so.1...(no debugging symbols
found)...done.
Reading symbols from /usr/lib/libuuid.so.1...(no debugging symbols
found)...done.
0x00007f1439c951d3 in __epoll_wait_nocancel () from /usr/lib/libc.so.6
(gdb) quit
....

As you can see it attaches to systemd of the host than the process inside the
container.

nsenter  -t 600  -p gdb -p 29120 also gives the PID namespace warning and
doesn't work.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-05-13 10:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-02  2:55 [Bug gdb/18368] New: gdb with nsenter attaches to wrong process raghu.prabhu13 at gmail dot com
2015-05-04 10:02 ` [Bug gdb/18368] " palves at redhat dot com
2015-05-05  9:18 ` gbenson at redhat dot com
2015-05-05 14:50 ` raghu.prabhu13 at gmail dot com
2015-05-05 15:06 ` gbenson at redhat dot com
2015-05-05 15:26 ` raghu.prabhu13 at gmail dot com
2015-05-07  9:23 ` gbenson at redhat dot com
2015-05-08  9:49 ` raghu.prabhu13 at gmail dot com
2015-05-13 10:16 ` gbenson at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).