Bug 30205 - [qemu-gdbserver -- i386] Gdb crash while debugging the pintos kernel, some kind of readline issue?
Summary: [qemu-gdbserver -- i386] Gdb crash while debugging the pintos kernel, some ki...
Status: UNCONFIRMED
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: 12.1
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-07 03:19 UTC by Liam Naddell
Modified: 2023-03-08 00:43 UTC (History)
1 user (show)

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


Attachments
analysis of the coredump (4.20 KB, text/x-log)
2023-03-07 03:19 UTC, Liam Naddell
Details
gdb-macros file loaded via gdb -x (1.36 KB, text/plain)
2023-03-07 03:20 UTC, Liam Naddell
Details
Output from gdb after the crash (sorry for the png) (122.02 KB, image/png)
2023-03-07 03:22 UTC, Liam Naddell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Liam Naddell 2023-03-07 03:19:11 UTC
Created attachment 14735 [details]
analysis of the coredump

While I was debugging the pintos kernel for a school assignment, I ran into a GDB crash. Specifically, I ran a macro called dumplist (macro file attached, loaded via gdb -x). This macro prints out all the contents of a janky dynamic list implementation in kernel memory. 


Actual result
---------------

I got a coredump file back, and ran a backtrace + looked around the call stack. It looks like the error has something to do with readline. My log of going through the gdb coredump is attached.


Expected result
---------------

N/A gdb shouldn't crash ever even with stupid macros or stupid data


Environment details
-------------------

OS: archlinux
project code: https://github.com/liamnaddell/CSCC69-Pintos
libc version: core/glibc 2.37-2 [installed]
qemu version: extra/qemu-system-x86 7.2.0-3 [installed]
gdb version: GNU gdb (GDB) 12.1
gdb configuration: 
   configure --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
	     --with-auto-load-dir=$debugdir:$datadir/auto-load
	     --with-auto-load-safe-path=$debugdir:$datadir/auto-load
	     --with-expat
	     --with-gdb-datadir=/usr/share/gdb (relocatable)
	     --with-jit-reader-dir=/usr/lib/gdb (relocatable)
	     --without-libunwind-ia64
	     --with-lzma
	     --without-babeltrace
	     --without-intel-pt
	     --with-mpfr
	     --without-xxhash
	     --with-python=/usr (relocatable)
	     --with-python-libdir=/usr/lib (relocatable)
	     --with-debuginfod
	     --with-guile
	     --enable-source-highlight
	     --with-separate-debug-dir=/usr/lib/debug (relocatable)
	     --with-system-gdbinit=/etc/gdb/gdbinit

gcc version: 12.1
Comment 1 Liam Naddell 2023-03-07 03:20:01 UTC
Created attachment 14736 [details]
gdb-macros file loaded via gdb -x
Comment 2 Liam Naddell 2023-03-07 03:22:22 UTC
Created attachment 14737 [details]
Output from gdb after the crash (sorry for the png)
Comment 3 Liam Naddell 2023-03-07 03:28:56 UTC
forgot to mention in original report: I haven't been able to reproduce this issue since coming across it
Comment 4 Tom Tromey 2023-03-07 14:40:22 UTC
Thank you for the bug report.

I'm not sure there is really enough information here to diagnose it.
Lack of reproducibility may also be an issue.
Anyway, my first suggestion would be to build a '-g -O0' gdb in
order to get a more reliable stack trace if it does happen again.
Comment 5 Liam Naddell 2023-03-08 00:43:15 UTC
If I run into it again, I am now using a debug gdb, I'll add it to this ticket