From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 815B13858297; Wed, 7 Feb 2024 15:49:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 815B13858297 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1707320988; bh=D1T9AHuN1/j4yNcKm0jdvRyurt1BA5lOzrfcc5awm/Q=; h=From:To:Subject:Date:From; b=g6vwKZBF7HrwjLGJGoWDqRqPDGmxVTaeN+P2Qt7BW6MhOJ4xQDQPdNFNiag00oGx4 hPH7IlUBy92rrHlmzCXwTx+0oq3v74PFp4nD7tNyM4ncRrcfLA3M1XOW5kWgSJGD2y BuyScu/Ah15R/oNwGW8tylrxFdaIMFtu6VkJTTM8= From: "ssbssa at sourceware dot org" To: gdb-prs@sourceware.org Subject: [Bug record/31353] New: gdb hangs when btrace replaying from a conditional breakpoint Date: Wed, 07 Feb 2024 15:49:47 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: record X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ssbssa at sourceware dot org 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 attachments.created 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31353 Bug ID: 31353 Summary: gdb hangs when btrace replaying from a conditional breakpoint Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: record Assignee: unassigned at sourceware dot org Reporter: ssbssa at sourceware dot org Target Milestone: --- Created attachment 15353 --> https://sourceware.org/bugzilla/attachment.cgi?id=3D15353&action=3Ded= it testsuite reproducer gdb can hang when backward/forward stepping in a btrace recording, when on = the recording start is also a breakpoint which doesn't hit because of a conditi= on. Using gdb.btrace/record_goto.c: ``` void fun1 (void) { /* fun1.1 */ } /* fun1.2 */ void fun2 (void) { /* fun2.1 */ fun1 (); /* fun2.2 */ } /* fun2.3 */ void fun3 (void) { /* fun3.1 */ fun1 (); /* fun3.2 */ fun2 (); /* fun3.3 */ } /* fun3.4 */ void fun4 (void) { /* fun4.1 */ fun1 (); /* fun4.2 */ fun2 (); /* fun4.3 */ fun3 (); /* fun4.4 */ } /* fun4.5 */ int main (void) { /* main.1 */ fun4 (); /* main.2 */ return 0; /* main.3 */ } /* main.4 */ ``` And these steps: ``` Reading symbols from record_goto.exe... (gdb) b *fun4 Breakpoint 1 at 0x140001634: file record_goto.c, line 40. (gdb) r Starting program: C:\src\repos\gdb-git-python3\gdb\record_goto.exe [New Thread 21748.0x3d2c] Thread 1 hit Breakpoint 1, fun4 () at record_goto.c:40 40 { /* fun4.1 */ (gdb) record btrace pt (gdb) n 41 fun1 (); /* fun4.2 */ (gdb) n 42 fun2 (); /* fun4.3 */ (gdb) reverse-next 41 fun1 (); /* fun4.2 */ (gdb) reverse-next Thread 1 hit Breakpoint 1, fun4 () at record_goto.c:40 40 { /* fun4.1 */ (gdb) reverse-next No more reverse-execution history. fun4 () at record_goto.c:40 40 { /* fun4.1 */ (gdb) n 41 fun1 (); /* fun4.2 */ (gdb) cond 1 0 (gdb) reverse-next No more reverse-execution history. fun4 () at record_goto.c:40 40 { /* fun4.1 */ (gdb) n ``` At that point it will hang, and when I press ctrl-c, I get: ``` C:/src/repos/binutils-gdb.git/gdb/inferior.c:394: internal-error: find_inferior_pid: Assertion `pid !=3D 0' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n)=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20 ``` I hit this on Windows, but Tromey confirmed this happens on Linux as well. I've also attached a testsuite reproducer, where the last test gets in a timeout: ``` reverse-next No more reverse-execution history. fun4 () at C:/src/repos/binutils-gdb.git/gdb/testsuite/gdb.btrace/record_goto.c:40 40 { /* fun4.1 */ (gdb) PASS: gdb.btrace/cond-break-on-record-start.exp: reverse to beginning again next FAIL: gdb.btrace/cond-break-on-record-start.exp: replay first step to fun1 again (timeout) testcase /c/src/repos/binutils-gdb.git/gdb/testsuite/gdb.btrace/cond-break-on-record= -start.exp completed in 18 seconds =3D=3D=3D gdb Summary =3D=3D=3D # of expected passes 11 # of unexpected failures 1 ``` --=20 You are receiving this mail because: You are on the CC list for the bug.=