Re: GDB 15/16 crashing in add_thread_silent()

Tom de Vries via Gdb <[email protected]> Fri, 21 Nov 2025 12:59:00 +0100
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
On 11/14/25 8:38 PM, Paul Smith via Gdb wrote:
> However, if I use the native GDB 8.2 that comes with Rocky Linux, then
> it will open the core file without these errors, and even show me the
> backtrace for all threads.

An interesting thing to know here would be the size of the PRSTATUS note:
...
$ eu-readelf -n core | grep -i prstatus
   CORE                 336  PRSTATUS
$ readelf -n core | grep -i prstatus
   CORE                 0x00000150	NT_PRSTATUS (prstatus structure)
...

AFAIU, the note should be grokked by elf_x86_64_grok_prstatus, which 
bails out unless the size is either 296 (x32 abi) or 336.

So, if your core has a PRSTATUS note that has not one of those sizes, 
then it's possible that the system gdb 8.2 you mention works because the 
source package has a patch that makes elf_x86_64_grok_prstatus work for 
that particular number, and then hopefully that patch has more information.

But upstream gdb 8.2 only accepts the same numbers as upstream gdb 
trunk: 296 or 336.

[ My current hypothesis about the related arm problem I'm looking at, is 
that the core was generated by a kernel with a bug that meant that a 
prstatus was generated with the wrong size, which was fixed by commit 
16aead81018c ("take fdpic-related parts of elf_prstatus out").  AFAIU 
that problem didn't trigger on x86_64, but I thought I mention it. ]

Thanks,
- Tom