public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug record/31610] New: Abort when stepping through a restored recording
@ 2024-04-05 11:16 brandon.belew at zetier dot com
  2024-04-05 11:48 ` [Bug record/31610] " brandon.belew at zetier dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: brandon.belew at zetier dot com @ 2024-04-05 11:16 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 31610
           Summary: Abort when stepping through a restored recording
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: record
          Assignee: unassigned at sourceware dot org
          Reporter: brandon.belew at zetier dot com
  Target Milestone: ---

Gdb crashes due to a failed assertion if trying to step through a restored
recording. 

In one gdb session, generate a recording and save it to a file: 

- record full 
- step, step, continue, etc.... 
- record save /tmp/my_recording 
- quit

In a new gdb instance, try to load the recording and then step through it: 
- record restore /tmp/my_recording
- stepi 

This immediately crashes gdb with a failed assertion in gdb/inferior.c, in the
`find_inferior_pid` function, which does a `gdb_assert (pid != 0)`. 

This crash reproduces on the 13.2, 14.1, and latest git HEAD commit
0ffdc37b98964477e70bfd63ca28f374193dcdb2. I'm running on an x86_64 Ubuntu 18.04
system and configured gdb with `./configure --enable-targets=all`. The issue
does *not* reproduce with either the gdb or gdb-multiarch version in the Ubuntu
18.04 repository: GNU gdb (Ubuntu 8.1.1-0ubuntu1) 8.1.1. On that older version,
I can step or continue through the restore recording as I would expect. 

The full backtrace, from my git HEAD build, follows: 

```
../../gdb/inferior.c:405: internal-error: find_inferior_pid: Assertion `pid !=
0' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
----- Backtrace -----
0x55b4989bd997 gdb_internal_backtrace_1
        ../../gdb/bt-utils.c:121
0x55b4989bd997 _Z22gdb_internal_backtracev
        ../../gdb/bt-utils.c:167
0x55b498e9c3dc internal_vproblem
        ../../gdb/utils.c:420
0x55b498e9c63a _Z15internal_verrorPKciS0_P13__va_list_tag
        ../../gdb/utils.c:500
0x55b4993f894e _Z18internal_error_locPKciS0_z
        ../../gdbsupport/errors.cc:57
0x55b498b5ff65 _Z17find_inferior_pidP22process_stratum_targeti
        ../../gdb/inferior.c:405
0x55b498b5ff65 _Z17find_inferior_pidP22process_stratum_targeti
        ../../gdb/inferior.c:400
0x55b498c94004 _ZN22process_stratum_target11find_threadE6ptid_t
        ../../gdb/process-stratum-target.c:190
0x55b498e2c434 _Z16switch_to_threadP22process_stratum_target6ptid_t
        ../../gdb/thread.c:1437
0x55b498cfa09d record_full_wait_1
        ../../gdb/record-full.c:1288
0x55b498cfa09d
_ZN23record_full_base_target4waitE6ptid_tP17target_waitstatus10enum_flagsI16target_wait_flagE
        ../../gdb/record-full.c:1469
0x55b498e267a7
_Z11target_wait6ptid_tP17target_waitstatus10enum_flagsI16target_wait_flagE
        ../../gdb/target.c:2570
0x55b498b6a685 do_target_wait_1
        ../../gdb/infrun.c:4139
0x55b498b7c5dc operator()
        ../../gdb/infrun.c:4201
0x55b498b7c5dc do_target_wait
        ../../gdb/infrun.c:4220
0x55b498b7c5dc _Z20fetch_inferior_eventv
        ../../gdb/infrun.c:4661
0x55b498976e20 _Z26check_async_event_handlersv
        ../../gdb/async-event.c:337
0x55b4993f9f68 _Z16gdb_do_one_eventi
        ../../gdbsupport/event-loop.cc:220
0x55b498bdf1b6 start_event_loop
        ../../gdb/main.c:400
0x55b498bdf1b6 captured_command_loop
        ../../gdb/main.c:464
0x55b498be1044 captured_main```

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

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

* [Bug record/31610] Abort when stepping through a restored recording
  2024-04-05 11:16 [Bug record/31610] New: Abort when stepping through a restored recording brandon.belew at zetier dot com
@ 2024-04-05 11:48 ` brandon.belew at zetier dot com
  2024-04-05 15:16 ` brandon.belew at zetier dot com
  2024-04-06  9:46 ` ssbssa at sourceware dot org
  2 siblings, 0 replies; 4+ messages in thread
From: brandon.belew at zetier dot com @ 2024-04-05 11:48 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Brandon Belew <brandon.belew at zetier dot com> ---
As a follow-up, even on builds that crash with this assertion, I can still
`record goto INSN` to move through the recording history. I hacked up a rf and
rb command (reverse forward and reverse backward) that looks essentially like 

```
set $_r_inst = 1

define rf
record goto $_r_inst + 1
set $_r_inst = $_r_inst + 1
end 

define rb
record goto $_r_inst - 1
set $_r_inst = $_r_inst -1 
end 
```

And this works as a hacky way to step forwards and backwards through the
restored recording without triggering the crash, but this for instance does not
let me do the equivalent of `continue` or `reverse-continue`.

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

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

* [Bug record/31610] Abort when stepping through a restored recording
  2024-04-05 11:16 [Bug record/31610] New: Abort when stepping through a restored recording brandon.belew at zetier dot com
  2024-04-05 11:48 ` [Bug record/31610] " brandon.belew at zetier dot com
@ 2024-04-05 15:16 ` brandon.belew at zetier dot com
  2024-04-06  9:46 ` ssbssa at sourceware dot org
  2 siblings, 0 replies; 4+ messages in thread
From: brandon.belew at zetier dot com @ 2024-04-05 15:16 UTC (permalink / raw)
  To: gdb-prs

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

Brandon Belew <brandon.belew at zetier dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |brandon.belew at zetier dot com

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

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

* [Bug record/31610] Abort when stepping through a restored recording
  2024-04-05 11:16 [Bug record/31610] New: Abort when stepping through a restored recording brandon.belew at zetier dot com
  2024-04-05 11:48 ` [Bug record/31610] " brandon.belew at zetier dot com
  2024-04-05 15:16 ` brandon.belew at zetier dot com
@ 2024-04-06  9:46 ` ssbssa at sourceware dot org
  2 siblings, 0 replies; 4+ messages in thread
From: ssbssa at sourceware dot org @ 2024-04-06  9:46 UTC (permalink / raw)
  To: gdb-prs

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

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] 4+ messages in thread

end of thread, other threads:[~2024-04-06  9:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-05 11:16 [Bug record/31610] New: Abort when stepping through a restored recording brandon.belew at zetier dot com
2024-04-05 11:48 ` [Bug record/31610] " brandon.belew at zetier dot com
2024-04-05 15:16 ` brandon.belew at zetier dot com
2024-04-06  9:46 ` 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).