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 breakpoints/16182] New: gdb buggy when attached to PID 1 of Linux PID namespace


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

            Bug ID: 16182
           Summary: gdb buggy when attached to PID 1 of Linux PID
                    namespace
           Product: gdb
           Version: 7.6
            Status: NEW
          Severity: normal
          Priority: P2
         Component: breakpoints
          Assignee: unassigned at sourceware dot org
          Reporter: shawnlandden at gmail dot com

gdb is very buggy when attached to a process that thinks it is PID 1 due to
Linux's PID namespaces via the clone() system call.

It will hit breakpoints, but next/step/etc does not work, and it locks up both
gdb and systemd, they only way to kill the programs is to 1) kill -9 gdb
2) reattach gdb and use the "r" command to re-exec to unfreeze systemd.

lldb-3.4 works fine in the same situation

   from /home/shawn/systemd-nspawn/root.x86_64/usr/lib/libc-2.18.so
(gdb) break socket_enter_running
Breakpoint 1 at 0x4310b0: file src/core/socket.c, line 1433.
(gdb) c
Continuing.

Breakpoint 1, socket_enter_running (s=0xa77ea0, cfd=31) at
src/core/socket.c:1433
1433    static void socket_enter_running(Socket *s, int cfd) {
(gdb) n
Cannot execute this command while the selected thread is running.
...
(gdb) q
A debugging session is active.

    Inferior 1 [process 14243] will be detached.

Quit anyway? (y or n) y


^Z
[1]+  Stopped                 gdb -p 14243

then you have to kill -9 gdb, then reattach to systemd, then 
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y

Starting program:
/home/shawn/systemd-nspawn/root.x86_64/usr/lib/systemd/systemd 
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Trying to run as user instance, but $XDG_RUNTIME_DIR is not set.
[Inferior 1 (process 16924) exited with code 01]
(gdb) q

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


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