public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "hi-angel at yandex dot ru" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/30455] New: Debuggee with sanitizer causes: Assertion `regnum < gdbarch_num_regs (arch ())' failed.
Date: Tue, 16 May 2023 23:51:43 +0000	[thread overview]
Message-ID: <bug-30455-4717@http.sourceware.org/bugzilla/> (raw)

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.

             reply	other threads:[~2023-05-16 23:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-16 23:51 hi-angel at yandex dot ru [this message]
2023-05-17  0:41 ` [Bug record/30455] " tromey at sourceware dot org
2023-05-18 14:04 ` tromey at sourceware dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-30455-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).