public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Assertion `idx >= 0 && idx < num_fields ()' failed.
@ 2023-11-21 15:09 ` sourceware.org
  2023-11-23 12:11   ` mail
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: sourceware.org @ 2023-11-21 15:09 UTC (permalink / raw)
  To: gdb

When debugging QEMU with a breakpoint at `cpu_handle_exception` GDB crashes:

```
hit Breakpoint 1, cpu_handle_exception (cpu=0x5555573a2e00, ret=0x7fffffff99a4) at ../qemu-7.1.0/accel/tcg/cpu-exec.c:647
647	    if (cpu->exception_index < 0) {
../../gdb/gdbtypes.h:985: internal-error: field: Assertion `idx >= 0 && idx < num_fields ()' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
----- Backtrace -----
0x564124985b0b ???
0x564124d6b4c4 ???
0x564124e55503 ???
0x5641248ffdf1 ???
0x564124d8fc49 ???
0x564124c9498c ???
0x564124d7b633 ???
0x564124c940e7 ???
0x564124c945df ???
0x564124d7b633 ???
0x564124c940e7 ???
0x564124c945df ???
0x564124d7b633 ???
0x564124c940e7 ???
0x564124c945df ???
0x564124d7b633 ???
0x564124c484ee ???
0x7f2db3c1abff ???
0x7f2db3c165fc ???
0x7f2db3c03890 ???
0x7f2db3bf1326 ???
0x7f2db3be3838 ???
0x7f2db3c0955f ???
0x7f2db3be722a ???
0x7f2db3c2b582 ???
0x7f2db3c2aa6d ???
0x7f2db3be722a ???
0x7f2db3c0955f ???
0x7f2db3bf9b55 ???
0x7f2db3c28b36 ???
0x564124c2b39a ???
0x5641249c04a4 ???
0x564124d32ed3 ???
0x5641249ce902 ???
0x5641249ceda1 ???
0x564124c4f7d7 ???
0x7f2db3bf9ea0 ???
0x7f2db3bd953b ???
0x7f2db3be3838 ???
0x7f2db3c0955f ???
0x7f2db3bf9b55 ???
0x7f2db3c9e680 ???
0x564124eb084a ???
0x564124c39162 ???
0x564124ea1b41 ???
0x564124b7fcbd ???
0x564124b690de ???
0x564124e55d7d ???
0x564124e98fee ???
0x564124bb5e24 ???
0x5641248e9694 ???
0x7f2db3445ccf ???
0x7f2db3445d89 ???
0x5641248f08e4 ???
0xffffffffffffffff ???
---------------------

This is a bug, please report it.  For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>.
```

Likely unrelated to #29950, as `-gstabs+` is not used.

If you like me to submit bugs using your issue tracker you should make it accessible and allow account registration.


Regards,
Simon Wörner

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

* Re: Assertion `idx >= 0 && idx < num_fields ()' failed.
  2023-11-21 15:09 ` Assertion `idx >= 0 && idx < num_fields ()' failed sourceware.org
@ 2023-11-23 12:11   ` mail
  2023-11-23 12:11   ` mail
  2023-11-23 12:11   ` mail
  2 siblings, 0 replies; 8+ messages in thread
From: mail @ 2023-11-23 12:11 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb

> Which gdb are you using? I wonder if the problem has already been
> fixed.

I'm using the latest version:

```
$ gdb --version
GNU gdb (GDB) 13.2
[...]
```

The only commit mentioning the assert is from two years ago:
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=af5300fe24bf2f4e032d639a5396a16c1762b77b


> I think if you try to make an account, it will give you instructions on
> where to send email to get one made for you.

If I have to jump so many hops to make a simple bug report I might as well not do it.
The ancient project management of GDB is already hard enough.


Regards,
Simon Wörner

November 22, 2023 at 17:29, "Tom Tromey" <tom@tromey.com> wrote:

> 
> > 
> > sourceware org <sourceware.org@brn.li> writes:
> > 
> >  When debugging QEMU with a breakpoint at `cpu_handle_exception` GDB crashes:
> >  ```
> >  hit Breakpoint 1, cpu_handle_exception (cpu=0x5555573a2e00, ret=0x7fffffff99a4) at ../qemu-7.1.0/accel/tcg/cpu-exec.c:647
> >  647 if (cpu->exception_index < 0) {
> >  ../../gdb/gdbtypes.h:985: internal-error: field: Assertion `idx >= 0 && idx < num_fields ()' failed.
> >  A problem internal to GDB has been detected,
> >  further debugging may prove unreliable.
> > 
> 
> Which gdb are you using? I wonder if the problem has already been
> fixed.
> 
> > 
> > If you like me to submit bugs using your issue tracker you should make
> >  it accessible and allow account registration.
> > 
> 
> I think if you try to make an account, it will give you instructions on
> where to send email to get one made for you.
> 
> Direct account creation had to be disabled due to spam.
> 
> Tom
>

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

* Re: Assertion `idx >= 0 && idx < num_fields ()' failed.
  2023-11-21 15:09 ` Assertion `idx >= 0 && idx < num_fields ()' failed sourceware.org
  2023-11-23 12:11   ` mail
@ 2023-11-23 12:11   ` mail
  2023-11-24 16:30     ` Tom Tromey
  2023-11-23 12:11   ` mail
  2 siblings, 1 reply; 8+ messages in thread
From: mail @ 2023-11-23 12:11 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb

> Which gdb are you using? I wonder if the problem has already been
> fixed.

I'm using the latest version:

```
$ gdb --version
GNU gdb (GDB) 13.2
[...]
```

The only commit mentioning the assert is from two years ago:
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=af5300fe24bf2f4e032d639a5396a16c1762b77b


> I think if you try to make an account, it will give you instructions on
> where to send email to get one made for you.

If I have to jump so many hops to make a simple bug report I might as well not do it.
The ancient project management of GDB is already hard enough.


Regards,
Simon Wörner

November 22, 2023 at 17:29, "Tom Tromey" <tom@tromey.com> wrote:

> 
> > 
> > sourceware org <sourceware.org@brn.li> writes:
> > 
> >  When debugging QEMU with a breakpoint at `cpu_handle_exception` GDB crashes:
> >  ```
> >  hit Breakpoint 1, cpu_handle_exception (cpu=0x5555573a2e00, ret=0x7fffffff99a4) at ../qemu-7.1.0/accel/tcg/cpu-exec.c:647
> >  647 if (cpu->exception_index < 0) {
> >  ../../gdb/gdbtypes.h:985: internal-error: field: Assertion `idx >= 0 && idx < num_fields ()' failed.
> >  A problem internal to GDB has been detected,
> >  further debugging may prove unreliable.
> > 
> 
> Which gdb are you using? I wonder if the problem has already been
> fixed.
> 
> > 
> > If you like me to submit bugs using your issue tracker you should make
> >  it accessible and allow account registration.
> > 
> 
> I think if you try to make an account, it will give you instructions on
> where to send email to get one made for you.
> 
> Direct account creation had to be disabled due to spam.
> 
> Tom
>

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

* Re: Assertion `idx >= 0 && idx < num_fields ()' failed.
  2023-11-21 15:09 ` Assertion `idx >= 0 && idx < num_fields ()' failed sourceware.org
  2023-11-23 12:11   ` mail
  2023-11-23 12:11   ` mail
@ 2023-11-23 12:11   ` mail
  2023-11-23 16:01     ` Simon Marchi
  2023-11-23 16:59     ` mail
  2 siblings, 2 replies; 8+ messages in thread
From: mail @ 2023-11-23 12:11 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb

> Which gdb are you using? I wonder if the problem has already been
> fixed.

I'm using the latest version:

```
$ gdb --version
GNU gdb (GDB) 13.2
[...]
```

The only commit mentioning the assert is from two years ago:
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=af5300fe24bf2f4e032d639a5396a16c1762b77b


> I think if you try to make an account, it will give you instructions on
> where to send email to get one made for you.

If I have to jump so many hops to make a simple bug report I might as well not do it.
The ancient project management of GDB is already hard enough.


Regards,
Simon Wörner

November 22, 2023 at 17:29, "Tom Tromey" <tom@tromey.com> wrote:

> 
> > 
> > sourceware org <sourceware.org@brn.li> writes:
> > 
> >  When debugging QEMU with a breakpoint at `cpu_handle_exception` GDB crashes:
> >  ```
> >  hit Breakpoint 1, cpu_handle_exception (cpu=0x5555573a2e00, ret=0x7fffffff99a4) at ../qemu-7.1.0/accel/tcg/cpu-exec.c:647
> >  647 if (cpu->exception_index < 0) {
> >  ../../gdb/gdbtypes.h:985: internal-error: field: Assertion `idx >= 0 && idx < num_fields ()' failed.
> >  A problem internal to GDB has been detected,
> >  further debugging may prove unreliable.
> > 
> 
> Which gdb are you using? I wonder if the problem has already been
> fixed.
> 
> > 
> > If you like me to submit bugs using your issue tracker you should make
> >  it accessible and allow account registration.
> > 
> 
> I think if you try to make an account, it will give you instructions on
> where to send email to get one made for you.
> 
> Direct account creation had to be disabled due to spam.
> 
> Tom
>

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

* Re: Assertion `idx >= 0 && idx < num_fields ()' failed.
  2023-11-23 12:11   ` mail
@ 2023-11-23 16:01     ` Simon Marchi
  2023-11-23 16:59     ` mail
  1 sibling, 0 replies; 8+ messages in thread
From: Simon Marchi @ 2023-11-23 16:01 UTC (permalink / raw)
  To: mail, Tom Tromey; +Cc: gdb

On 11/23/23 07:11, mail@simon-woerner.de wrote:
>> Which gdb are you using? I wonder if the problem has already been
>> fixed.
> 
> I'm using the latest version:
> 
> ```
> $ gdb --version
> GNU gdb (GDB) 13.2
> [...]
> ```

Can you give some steps to reproduce, so that someone has a chance to
start debugging the problem?  Otherwise, it's virtually impossible to
know what happens.

Simon

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

* Re: Assertion `idx >= 0 && idx < num_fields ()' failed.
  2023-11-23 12:11   ` mail
  2023-11-23 16:01     ` Simon Marchi
@ 2023-11-23 16:59     ` mail
  1 sibling, 0 replies; 8+ messages in thread
From: mail @ 2023-11-23 16:59 UTC (permalink / raw)
  To: Simon Marchi, Tom Tromey; +Cc: gdb

> Can you give some steps to reproduce,

Sure, tested on an Arch Linux but this should work on any recent Linux distribution:

```
# dependencies:
# wget zstd python3 gdb libpixman binutils

# get target binary
wget 'https://pixeldrain.com/u/EAUpLuPj?dl=1' -O prebuilt.tar.zst
tar -xvf prebuilt.tar.zst

# or build from source (requires rust and some dependencies)
git clone https://github.com/fuzzware-fuzzer/hoedur.git
cd hoedur
cargo build --bin hoedur-arm
cd target/debug

# get target input/config file
wget 'https://pixeldrain.com/u/FqoekVRY?dl=1' -O reproducer.corpus.tar.zst
echo 'root: {}' > log.yml 

# get gef (not sure which gdb command used by gef triggers the crash)
wget https://github.com/hugsy/gef/raw/2023.08/gef.py

# run reproducer
LD_LIBRARY_PATH=. gdb --nx --args ./hoedur-arm --log-config ./log.yml --import-config ./reproducer.corpus.tar.zst run-corpus ./reproducer.corpus.tar.zst

gdb) start
gdb) b cpu<TAB> # for an unrelated autocomplete crash
gdb) b cpu_handle_exception
gdb) source gef.py
gdb) r # crash after `cpu_handle_exception` breakpoint
```

Regards,
Simon Wörner


November 23, 2023 at 17:01, "Simon Marchi" <simark@simark.ca> wrote:

> 
> On 11/23/23 07:11, mail@simon-woerner.de wrote:
> 
> > 
> > > 
> > > Which gdb are you using? I wonder if the problem has already been
> > >  fixed.
> > > 
> > 
> >  
> >  I'm using the latest version:
> >  
> >  ```
> >  $ gdb --version
> >  GNU gdb (GDB) 13.2
> >  [...]
> >  ```
> > 
> 
> Can you give some steps to reproduce, so that someone has a chance to
> start debugging the problem? Otherwise, it's virtually impossible to
> know what happens.
> 
> Simon
>

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

* Re: Assertion `idx >= 0 && idx < num_fields ()' failed.
  2023-11-23 12:11   ` mail
@ 2023-11-24 16:30     ` Tom Tromey
  2023-11-24 20:42       ` Simon Marchi
  0 siblings, 1 reply; 8+ messages in thread
From: Tom Tromey @ 2023-11-24 16:30 UTC (permalink / raw)
  To: mail; +Cc: Tom Tromey, gdb

> I'm using the latest version:
> ```
> $ gdb --version
> GNU gdb (GDB) 13.2
> [...]
> ```

I suspect this is https://sourceware.org/bugzilla/show_bug.cgi?id=29735
which I believe is fixed for gdb 14.

Tom

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

* Re: Assertion `idx >= 0 && idx < num_fields ()' failed.
  2023-11-24 16:30     ` Tom Tromey
@ 2023-11-24 20:42       ` Simon Marchi
  0 siblings, 0 replies; 8+ messages in thread
From: Simon Marchi @ 2023-11-24 20:42 UTC (permalink / raw)
  To: Tom Tromey, mail; +Cc: gdb

On 11/24/23 11:30, Tom Tromey wrote:
>> I'm using the latest version:
>> ```
>> $ gdb --version
>> GNU gdb (GDB) 13.2
>> [...]
>> ```
> 
> I suspect this is https://sourceware.org/bugzilla/show_bug.cgi?id=29735
> which I believe is fixed for gdb 14.
> 
> Tom

You're right, I was able to reproduce and just finished bisecting it.

The other crash mentionned, when using tab-completion, is also fixed,
by this commit:

https://gitlab.com/gnutools/binutils-gdb/-/commit/6e7eef72164c00d6a5a7b0bce9fa01f5481f33cb

Simon

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

end of thread, other threads:[~2023-11-24 20:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87wmu9hhu5.fsf@tromey.com>
2023-11-21 15:09 ` Assertion `idx >= 0 && idx < num_fields ()' failed sourceware.org
2023-11-23 12:11   ` mail
2023-11-23 12:11   ` mail
2023-11-24 16:30     ` Tom Tromey
2023-11-24 20:42       ` Simon Marchi
2023-11-23 12:11   ` mail
2023-11-23 16:01     ` Simon Marchi
2023-11-23 16:59     ` mail

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