public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/30455] New: Debuggee with sanitizer causes: Assertion `regnum < gdbarch_num_regs (arch ())' failed.
@ 2023-05-16 23:51 hi-angel at yandex dot ru
  2023-05-17  0:41 ` [Bug record/30455] " tromey at sourceware dot org
  2023-05-18 14:04 ` tromey at sourceware dot org
  0 siblings, 2 replies; 3+ messages in thread
From: hi-angel at yandex dot ru @ 2023-05-16 23:51 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 30455
           Summary: Debuggee with sanitizer causes: Assertion `regnum <
                    gdbarch_num_regs (arch ())' failed.
           Product: gdb
           Version: 13.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: hi-angel at yandex dot ru
  Target Milestone: ---

This is a bug in `record` gdb function.

Note: `record` doesn't work as is on modern CPUs (because they usually have AVX
which is used for example by glibc), but at least in my environment the
workaround is using 32bit debugee (i.e. -m32 in the steps-to-reproduce below).

# Steps to reproduce

     λ cat test.c
    int main(){}
     λ gcc test.c -o a -fsanitize=address -m32
     λ gdb ./a
    Reading symbols from ./a...
    (No debugging symbols found in ./a)
    gdb λ br main
    Breakpoint 1 at 0x11a0
    gdb λ r
    Starting program: /tmp/a
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/usr/lib/libthread_db.so.1".

    Breakpoint 1, 0x565561a0 in main ()
    gdb λ record
    gdb λ c
    Continuing.
    ../../gdb/regcache.c:324: internal-error: assert_regnum: Assertion `regnum
< gdbarch_num_regs (arch ())' failed.
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.
    ----- Backtrace -----
    0x55618b5d2cfb ???
    0x55618b982cf4 ???
    0x55618ba664d3 ???
    0x55618b887113 ???
    0x55618b887466 ???
    0x55618b8876d1 ???
    0x55618b87f415 ???
    0x55618b767d2a ???
    0x55618b87f6d2 ???
    0x55618b89133a ???
    0x55618b929bbb ???
    0x55618b794d77 ???
    0x55618b795864 ???
    0x55618ba66d5d ???
    0x55618bab84c6 ???
    0x55618b7e34a4 ???
    0x55618b53e664 ???
    0x7fd649a3984f ???
    0x7fd649a39909 ???
    0x55618b545ac4 ???
    0xffffffffffffffff ???
    ---------------------
    ../../gdb/regcache.c:324: internal-error: assert_regnum: Assertion `regnum
< gdbarch_num_regs (arch ())' failed.
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.
    Quit this debugging session? (y or n)

## Expected

No assertion is triggered

## Actual

It fails with assertion

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

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

end of thread, other threads:[~2023-05-18 14:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-16 23:51 [Bug gdb/30455] New: Debuggee with sanitizer causes: Assertion `regnum < gdbarch_num_regs (arch ())' failed hi-angel at yandex dot ru
2023-05-17  0:41 ` [Bug record/30455] " tromey at sourceware dot org
2023-05-18 14:04 ` tromey 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).