Bug 26549 - GDB crashes when performing `backtrace` on a binary with full symbols enabled
Summary: GDB crashes when performing `backtrace` on a binary with full symbols enabled
Status: UNCONFIRMED
Alias: None
Product: gdb
Classification: Unclassified
Component: backtrace (show other bugs)
Version: 9.2
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-28 16:40 UTC by Faith
Modified: 2023-11-30 17:03 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Faith 2020-08-28 16:40:51 UTC
Hello,

This issue is very recent. I have built GDB 9.2 (downloaded from https://ftp.gnu.org/gnu/gdb/gdb-9.2.tar.xz) and tried to run V8 built with full debugging symbols. After running the interpreter, attempting to CTRL+C and `backtrace` will cause the following error:

```
../../gdb/dwarf2read.c:5264: internal-error: compunit_symtab* dw2_find_pc_sect_compunit_symtab(objfile*, bound_minimal_symbol, CORE_ADDR, obj_section*, int): Assertion `result != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.

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

Aborted (core dumped)
```

The binary I was using can be found here (it is nearly 400MB): https://drive.google.com/file/d/1JXlFh0ijrlWpj7XwOyxMO4-TorCXiCYt/view?usp=sharing

If you need more information, let me know :)
Comment 1 Faith 2020-08-29 08:17:49 UTC
I checked and confirmed that the issue is with the gdb `index` section that is added at build time. V8 actually comes with a tool that lets you remove the index. You can run it by doing the following from the V8 root directory:

`build/gdb-add-index -r out/x64.release/d8`

Replace the last parameter with the path to the `d8` binary, and it'll remove the index section. This does indeed solve the issue.
Comment 2 Tom Tromey 2020-09-01 14:14:39 UTC
Could you possibly try gdb from git?
I don't know whether it will work or not, but it would
be nice to find out.
Comment 3 Jean-Michaël Celerier 2021-05-27 10:09:49 UTC
Hello,
I'm encountering the same issue with gdb 10.2, but I'm not using --gdb-index
Comment 4 Tom Tromey 2023-11-30 17:03:47 UTC
(In reply to Jean-Michaël Celerier from comment #3)
> Hello,
> I'm encountering the same issue with gdb 10.2, but I'm not using --gdb-index

I think it's probably a separate issue then.
However - can you try a newer gdb?
I feel like there were some bug fixes in this area.