From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2D7E9397303A; Fri, 11 Dec 2020 16:38:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2D7E9397303A From: "simark at simark dot ca" To: gdb-prs@sourceware.org Subject: [Bug gdb/27055] New: Attaching to a process in non-stop mode doesn't work Date: Fri, 11 Dec 2020 16:38:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simark at simark dot ca X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2020 16:38:52 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27055 Bug ID: 27055 Summary: Attaching to a process in non-stop mode doesn't work Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: simark at simark dot ca Target Milestone: --- The program a.out is a simple infinite loop: #include int main() { for (;;) { sleep (5); } } Attaching to the process in non-stop mode gives this: $ ./gdb -q -nx --data-directory=3Ddata-directory -ex "set non-stop on" (gdb) attach 2896612 Attaching to process 2896612 No unwaited-for children left. (gdb) i th Id Target Id Frame=20 * 1 process 2896612 "a.out" 0xc856e334 in ?? () (gdb) bt #0 0xc856e334 in ?? () The state seems a bit broken. However, continuing and doing ^C makes GDB f= all back on its feet: (gdb) c Continuing. ^C Program received signal SIGINT, Interrupt. 0xc856e334 in ?? () Reading symbols from /home/smarchi/build/binutils-gdb-all-targets/gdb/a.out= ... Reading symbols from /lib/x86_64-linux-gnu/libc.so.6... Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libc-2.31.so... Reading symbols from /lib64/ld-linux-x86-64.so.2... Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/ld-2.31.so... Program received signal SIGINT, Interrupt. 0x00007f01c856e334 in __GI___clock_nanosleep (clock_id=3D, clock_id@entry=3D0, flags=3Dflags@entry=3D0, req=3Dreq@entry=3D0x7ffc5dbb6f= 70, rem=3Drem@entry=3D0x7ffc5dbb6f70) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:78 78 ../sysdeps/unix/sysv/linux/clock_nanosleep.c: No such file or directory. (gdb) bt #0 0x00007f01c856e334 in __GI___clock_nanosleep (clock_id=3D, clock_id@entry=3D0,=20 flags=3Dflags@entry=3D0, req=3Dreq@entry=3D0x7ffc5dbb6f70, rem=3Drem@entry=3D0x7ffc5dbb6f70) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:78 #1 0x00007f01c8574047 in __GI___nanosleep ( requested_time=3Drequested_time@entry=3D0x7ffc5dbb6f70,=20 remaining=3Dremaining@entry=3D0x7ffc5dbb6f70) at nanosleep.c:27 #2 0x00007f01c8573f7e in __sleep (seconds=3D0) at ../sysdeps/posix/sleep.c= :55 #3 0x0000563bb85cb15b in main () at test.c:7 A second test is making GDB attach to a process while another one is runnin= g: $ ./gdb -q -nx --data-directory=3Ddata-directory a.out -ex "set non-stop on= " -ex "r&" -ex "add-inferior" -ex "inferior 2" Reading symbols from a.out... Starting program: /home/smarchi/build/binutils-gdb-all-targets/gdb/a.out=20 [New inferior 2] Added inferior 2 on connection 1 (native) [Switching to inferior 2 [] ()] (gdb) attach 2896985 Attaching to process 2896985 ^C^C^C^C The attach doesn't go through and GDB doesn't respond to inputs. --=20 You are receiving this mail because: You are on the CC list for the bug.=