public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/30339] New: GDB crashes on malformed debuginfod files.
@ 2023-04-12 15:23 felics-sourceware at kettenbruch dot de
  2023-04-12 15:37 ` [Bug gdb/30339] " felics-sourceware at kettenbruch dot de
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: felics-sourceware at kettenbruch dot de @ 2023-04-12 15:23 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 30339
           Summary: GDB crashes on malformed debuginfod files.
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: felics-sourceware at kettenbruch dot de
  Target Milestone: ---

## Problem description.

GDB crashes for me when it encounters some malformed debuginfod files.

I want to debug the programme `marble`, and so I run `gdb marble`, then in the
gdb prompt I type `run`.

On the terminal, I get the following:

```
GNU gdb (GDB) 14.0.50.20230412-git
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
pwndbg: loaded 195 commands. Type pwndbg [filter] for a list.
pwndbg: created $rebase, $ida gdb functions (can be used with print/break)
Support for the 'qSearch:memory' packet on future remote targets is set to
"off".
Reading symbols from marble...
Downloading separate debug info for /usr/bin/marble
(No debugging symbols found in marble)                                          
pwndbg> run
Starting program: /usr/bin/marble 
Downloading separate debug info for /usr/lib/libKF5Parts.so.5                   
Downloading separate debug info for /usr/lib/libKF5Crash.so.5                   
Downloading separate debug info for /usr/lib/libKF5XmlGui.so.5                  
Downloading separate debug info for /usr/lib/libKF5ConfigWidgets.so.5           
Downloading separate debug info for /usr/lib/libKF5I18n.so.5                    
Downloading separate debug info for /usr/lib/libKF5WidgetsAddons.so.5           
Downloading separate debug info for /usr/lib/libKF5ConfigGui.so.5               
Downloading separate debug info for /usr/lib/libKF5ConfigCore.so.5              
Downloading separate debug info for /usr/lib/libKF5CoreAddons.so.5              
[Thread debugging using libthread_db enabled]                                   
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Downloading separate debug info for /usr/lib/libKF5KIOWidgets.so.5              
Downloading separate debug info for /usr/lib/libKF5IconThemes.so.5              
Downloading separate debug info for /usr/lib/libKF5KIOGui.so.5                  
Downloading separate debug info for /usr/lib/libKF5KIOCore.so.5                 
Downloading separate debug info for /usr/lib/libKF5JobWidgets.so.5              
Downloading separate debug info for /usr/lib/libKF5Service.so.5                 
Downloading separate debug info for /usr/lib/libQt5X11Extras.so.5               
Downloading separate debug info for /usr/lib/libKF5GlobalAccel.so.5             
Downloading separate debug info for /usr/lib/libKF5ItemViews.so.5               
Downloading separate debug info for /usr/lib/libKF5GuiAddons.so.5               
Downloading separate debug info for /usr/lib/libKF5Codecs.so.5                  
Downloading separate debug info for /usr/lib/libKF5AuthCore.so.5                
Downloading separate debug info for /usr/lib/libudev.so.1                       
BFD: warning:
/home/[...]/.cache/debuginfod_client/5f9b3e5635c7d6fec6e8607532bd57d01068c487/debuginfo
has a section extending past end of file               
Error while reading shared library symbols for /usr/lib/libQt5Qml.so.5:
`/home/[...]/.cache/debuginfod_client/5f9b3e5635c7d6fec6e8607532bd57d01068c487/debuginfo':
can't read symbols: file format not recognized.
Downloading separate debug info for /usr/lib/libKF5Solid.so.5                   
Downloading separate debug info for /usr/lib/libKF5Completion.so.5              
Downloading separate debug info for /usr/lib/libKF5WindowSystem.so.5            
Downloading separate debug info for /usr/lib/libKF5Archive.so.5                 
Downloading separate debug info for /usr/lib/libacl.so.1                        
Downloading separate debug info for /usr/lib/libKF5DBusAddons.so.5              
Downloading separate debug info for /usr/lib/libQt5WaylandClient.so.5           
Downloading separate debug info for /usr/lib/libwayland-client.so.0             
Downloading separate debug info for /usr/lib/libimobiledevice-1.0.so.6          
Downloading separate debug info for /usr/lib/libplist-2.0.so.3                  
Downloading separate debug info for /usr/lib/libwayland-cursor.so.0             
Downloading separate debug info for /usr/lib/libgcrypt.so.20                    
Downloading separate debug info for /usr/lib/libusbmuxd-2.0.so.6                
Downloading separate debug info for /usr/lib/libgpg-error.so.0                  
BFD: warning:
/home/[...]/.cache/debuginfod_client/5f9b3e5635c7d6fec6e8607532bd57d01068c487/debuginfo
has a section extending past end of file               
Error while reading shared library symbols for /usr/lib/libQt5Qml.so.5:
`/home/[...]/.cache/debuginfod_client/5f9b3e5635c7d6fec6e8607532bd57d01068c487/debuginfo':
can't read symbols: file format not recognized.
[New Thread 0x7fffd785e6c0 (LWP 6041)]                                          
[New Thread 0x7fffcbfff6c0 (LWP 6042)]
free(): invalid pointer


Fatal signal: Aborted
----- Backtrace -----
0x55c008c52226 ???
0x55c008d680cf ???
0x7fa607451f4f ???
0x7fa6074a08ec ???
0x7fa607451ea7 ???
0x7fa60743b53c ???
0x7fa60743c29d ???
0x7fa6074aa656 ???
0x7fa6074ac4bb ???
0x7fa6074aee62 ???
0x55c008fbe701 ???
0x55c008eaf66f ???
0x55c008d63bf9 ???
0x55c008fba721 ???
0x55c008fba16e ???
0x55c008f8290a ???
0x55c0091e6b4b ???
0x55c008f8375f ???
0x55c008c3cf64 ???
0x55c008e293d0 ???
0x55c008e2bd14 ???
0x55c008e1f6ec ???
0x55c00918e64d ???
0x55c009205ece ???
0x55c008e74154 ???
0x55c008bb14e4 ???
0x7fa60743c78f ???
0x7fa60743c849 ???
0x55c008bbac94 ???
0xffffffffffffffff ???
---------------------
A fatal error internal to GDB has been detected, further
debugging is not possible.  GDB will now terminate.

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

Aborted
```

I tried to debug gdb with gdb, but that somehow fails (if you tell me what to
do, I can help out).

I attach the offending file
`/home/[...]/.cache/debuginfod_client/5f9b3e5635c7d6fec6e8607532bd57d01068c487/debuginfo`.


## System configuration:

My `~/.gdbinit` says  
```
source /usr/share/pwndbg/gdbinit.py
set debuginfod enabled on
```

`/etc/debuginfod/` just one file with the content  
```
https://debuginfod.artixlinux.org
```

I am on Artix GNU Linux, an Arch Linux variant without systemd.

I have used GDB from https://sourceware.org/git/binutils-gdb.git, self compiled
today, latest git commit hash: `0a12bf174dd`.

The problem also appears with GDB 13.1 from Artix Linux.

The two GDB versions have been compiled the following way:

* GDB 13.1 from Artix Linux:  
  ```
  mkdir -p build && cd build
  ../configure \
    --prefix=/usr \
    --disable-nls \
    --enable-source-highlight \
    --enable-tui \
    --with-system-readline \
    --with-python=/usr/bin/python \
    --with-system-gdbinit=/etc/gdb/gdbinit
  make
  ```

* GDB 14.0.50.20230412-git:  
  ```
  mkdir -p build
  cd build
  CFLAGS="  -g0 -march=x86-64 -mtune=native -O3 -flto -ffat-lto-objects -pipe
-fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2
-fomit-frame-pointer -fPIC -fcommon"
  CXXFLAGS="-g0 -march=x86-64 -mtune=native -O3 -flto -ffat-lto-objects -pipe
-fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2
-fomit-frame-pointer -fPIC -fpermissive -fpermissive"
  export CFLAGS
  export CXXFLAGS
  ../configure \
    --prefix=/usr \
    --disable-nls \
    --disable-gold \
    --disable-ld \
    --disable-gprofng \
    --enable-source-highlight \
    --enable-tui \
    --with-system-readline \
    --with-python=/usr/bin/python \
    --with-guile=guile-3.0 \
    --with-system-gdbinit=/etc/gdb/gdbinit \
    --enable-default-compressed-debug-sections-algorithm=zstd \
    --enable-year2038 \
    --enable-libada \
    --enable-libssp \
    --enable-lto \
    --disable-gdbtk \
    --enable-plugins \
    --enable-threading \
    --enable-libbacktrace \
    --enable-libctf \
    --disable-werror \
    --with-debuginfod \
    --without-libunwind-ia64 \
    --with-system-zlib \
    --with-zstd \
    --with-expat \
    --with-intel-pt \
    --with-xxhash \
    --with-lzma \
    --without-tcl \
    --without-tk \
    --with-x \
    --with-babeltrace
  make
  ```

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

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

end of thread, other threads:[~2023-04-14 19:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-12 15:23 [Bug gdb/30339] New: GDB crashes on malformed debuginfod files felics-sourceware at kettenbruch dot de
2023-04-12 15:37 ` [Bug gdb/30339] " felics-sourceware at kettenbruch dot de
2023-04-12 15:38 ` felics-sourceware at kettenbruch dot de
2023-04-12 15:46 ` [Bug gdb/30339] GDB crashes on (some) " felics-sourceware at kettenbruch dot de
2023-04-12 15:53 ` felics-sourceware at kettenbruch dot de
2023-04-13 14:54 ` tromey at sourceware dot org
2023-04-13 16:53 ` felics-sourceware at kettenbruch dot de
2023-04-13 17:46 ` tromey at sourceware dot org
2023-04-13 20:09 ` felics-sourceware at kettenbruch dot de
2023-04-13 20:10 ` felics-sourceware at kettenbruch dot de
2023-04-13 23:27 ` tromey at sourceware dot org
2023-04-14 19:22 ` felics-sourceware at kettenbruch dot de

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