public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "tromey at sourceware dot org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug record/30455] Debuggee with sanitizer causes: Assertion `regnum < gdbarch_num_regs (arch ())' failed.
Date: Thu, 18 May 2023 14:04:53 +0000	[thread overview]
Message-ID: <bug-30455-4717-gnnMGf8RXH@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-30455-4717@http.sourceware.org/bugzilla/>

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-05-18
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
Here:

          record_full_arch_list_add_reg (ir.regcache,
                                         I387_MM0_REGNUM (tdep) + ir.reg);
          break;

it's recording register 97.

But:

325         gdb_assert (regnum < gdbarch_num_regs (arch ()));
(top) p gdbarch_num_regs(arch())
$10 = 73


So it's some confusion either in the regcache code or in i386-tdep.c.

Here's the relevant parts of the stack trace:

#9  0x000000000103df82 in internal_error_loc (file=<optimized out>, 
    line=<optimized out>, fmt=<optimized out>)
    at ../../binutils-gdb/gdbsupport/errors.cc:58
#10 0x00000000008b5ace in reg_buffer::assert_regnum (this=0x301fcd0, regnum=97)
    at ../../binutils-gdb/gdb/regcache.c:325
#11 0x00000000008b662f in regcache::raw_update (this=0x301fcd0, regnum=97)
--Type <RET> for more, q to quit, c to continue without paging--c
    at ../../binutils-gdb/gdb/regcache.c:590
#12 0x00000000008b6751 in readable_regcache::raw_read (this=0x301fcd0,
regnum=97, buf=0x319eef0 "") at ../../binutils-gdb/gdb/regcache.c:616
#13 0x00000000008aae50 in record_full_arch_list_add_reg (regcache=0x301fcd0,
regnum=97) at ../../binutils-gdb/gdb/record-full.c:623
#14 0x00000000006d76b3 in i386_process_record (gdbarch=0x262adc0,
regcache=<optimized out>, input_addr=<optimized out>) at
../../binutils-gdb/gdb/i386-tdep.c:8065
#15 0x00000000008ab0f9 in record_full_message (regcache=0x301fcd0,
signal=GDB_SIGNAL_0) at ../../binutils-gdb/gdb/record-full.c:751
#16 0x00000000008ab212 in record_full_message_wrapper_safe (regcache=0x301fcd0,
signal=GDB_SIGNAL_0) at ../../binutils-gdb/gdb/record-full.c:786
#17 0x00000000008ac2a3 in record_full_wait_1 (ops=0x2057bd0 <record_full_ops>,
ptid=..., status=0x7fffffffe138, options=...) at
../../binutils-gdb/gdb/record-full.c:1240
#18 0x00000000008ac9d6 in record_full_base_target::wait (this=0x2057bd0
<record_full_ops>, ptid=..., status=0x7fffffffe138, options=...) at
../../binutils-gdb/gdb/record-full.c:1467
#19 0x0000000000a77ac2 in target_wait (ptid=..., status=0x7fffffffe138,
options=...) at ../../binutils-gdb/gdb/target.c:2586
#20 0x0000000000701cba in do_target_wait_1 (inf=<optimized out>, ptid=...,
status=0x7fffffffe138, options=...) at ../../binutils-gdb/gdb/infrun.c:3864

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

      parent reply	other threads:[~2023-05-18 14:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-16 23:51 [Bug gdb/30455] New: " 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 message]

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