From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7D13A3858C52; Wed, 18 May 2022 11:12:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D13A3858C52 From: "theojehl76 at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug breakpoints/29155] New: After disabling "detach-on-fork" , syscalls are not catched in both parent and child Date: Wed, 18 May 2022 11:12:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: breakpoints X-Bugzilla-Version: 12.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: theojehl76 at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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: Wed, 18 May 2022 11:12:44 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29155 Bug ID: 29155 Summary: After disabling "detach-on-fork" , syscalls are not catched in both parent and child Product: gdb Version: 12.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: breakpoints Assignee: unassigned at sourceware dot org Reporter: theojehl76 at gmail dot com Target Milestone: --- When "detach-on-fork" is set to off, GDB is not able to catch syscalls anym= ore, this behavior started from GDB 10, GDB 9.2 is still able to track syscalls = with "detach-on-fork" disabled example: #include #include #include #include #include int main(){ pid_t pid =3D fork(); if(pid =3D=3D 0){ write(1, "child", 5); while(1); } if(pid > 0){ write(1, "parent", 6); } return 0; } Expected behavior: (gdb) set detach-on-fork off (gdb) catch syscall write Catchpoint 1 (syscall 'write' [64]) (gdb) r Starting program [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1". [Detaching after fork from child process 2167] child Catchpoint 1 (call to syscall write), 0x0000fffff7ee7c50 in __GI___libc_wri= te (fd=3D1, buf=3D0xaaaaaaaa0858, nbytes=3D6) at ../sysdeps/unix/sysv/linux/wr= ite.c:26 26 ../sysdeps/unix/sysv/linux/write.c: No such file or directory. Actual behavior: (gdb) set detach-on-fork off (gdb) catch syscall write Catchpoint 1 (syscall 'write' [64]) (gdb) r Starting program [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1". [New inferior 2 (process 2184)] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1". parent[Inferior 1 (process 2182) exited normally] This was tested on Linux running on X86_64 and AARCH64 with the same results --=20 You are receiving this mail because: You are on the CC list for the bug.=