public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug record/31353] New: gdb hangs when btrace replaying from a conditional breakpoint
@ 2024-02-07 15:49 ssbssa at sourceware dot org
  2024-02-07 15:51 ` [Bug record/31353] " ssbssa at sourceware dot org
  0 siblings, 1 reply; 2+ messages in thread
From: ssbssa at sourceware dot org @ 2024-02-07 15:49 UTC (permalink / raw)
  To: gdb-prs

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

            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=15353&action=edit
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 condition.

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 != 0' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)                                           
```

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

                === gdb Summary ===

# of expected passes            11
# of unexpected failures        1
```

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

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

* [Bug record/31353] gdb hangs when btrace replaying from a conditional breakpoint
  2024-02-07 15:49 [Bug record/31353] New: gdb hangs when btrace replaying from a conditional breakpoint ssbssa at sourceware dot org
@ 2024-02-07 15:51 ` ssbssa at sourceware dot org
  0 siblings, 0 replies; 2+ messages in thread
From: ssbssa at sourceware dot org @ 2024-02-07 15:51 UTC (permalink / raw)
  To: gdb-prs

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

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ssbssa at sourceware dot org

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

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

end of thread, other threads:[~2024-02-07 15:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-07 15:49 [Bug record/31353] New: gdb hangs when btrace replaying from a conditional breakpoint ssbssa at sourceware dot org
2024-02-07 15:51 ` [Bug record/31353] " ssbssa at sourceware dot org

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).