NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/57713: gdb can't read kernel core dumps



>Number:         57713
>Category:       bin
>Synopsis:       gdb can't read kernel core dumps
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 20 21:05:00 +0000 2023
>Originator:     Paul Goyette
>Release:        NetBSD 10.99.10
>Organization:
+---------------------+--------------------------+----------------------+
| Paul Goyette (.sig) | PGP Key fingerprint:     | E-mail addresses:    |
| (Retired)           | 1B11 1849 721C 56C8 F63A | paul%whooppee.com@localhost    |
| Software Developer  | 6E2E 05FD 15CE 9F2D 5102 | pgoyette%netbsd.org@localhost  |
| & Network Engineer  |                          | pgoyette99%gmail.com@localhost |
+---------------------+--------------------------+----------------------+
>Environment:
	
	
System: NetBSD speedy.whooppee.com 10.99.10 NetBSD 10.99.10 (SPEEDY 2023-11-20 00:19:14 UTC) #0: Mon Nov 20 03:50:56 UTC 2023 paul%speedy.whooppee.com@localhost:/build/netbsd-local/obj/amd64/sys/arch/amd64/compile/SPEEDY amd64
Architecture: x86_64
Machine: amd64
>Description:
gdb(1) can't process a simple kernel crash
	
>How-To-Repeat:
1. Create a VM
# anita --workdir ./work.amd64 --disk-size 15G --memory-size 8192M --sets kern-GENERIC,modules,base,comp,etc,misc,text,tests install /build/netbsd-local/release/amd64/

2. Boot the VM
# qemu-system-x86_64 -nographic -machine graphics=on -m 8192 -drive file=./work.amd64/wd0.img,index=0,media=disk,format=raw,snapshot=on

3. Force a panic, let it generate crash file and reboot
# sysctl -w debug.crashme_enable=1
debug.crashme_enable: 0 -> 1
# sysctl -w debug.crashme.panic=1

4. Unzip the crash files
# cd /var/crash/
# file netbsd*
# gunzip netbsd.0.gz 
# gunzip netbsd.0.core.gz 

5. Check file type
# file netbsd*
netbsd.0:      ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, for NetBSD 10.99.10, not stripped
netbsd.0.core: NetBSD kernel core file, amd64 BSD, (headersize = 16, segmentsize = 8, segments = 2)

6. Confirm that core file can be read by crash(8)
# crash -M netbsd.0.core
Crash version 10.99.10, image version 10.99.10.
crash: _kvm_kvatop(0)
Kernel compiled without options LOCKDEBUG.
System panicked: crashme plain old panic
Backtrace from time of crash is available.

7. Now try to open the core file in gdb(1)
# gdb
<Copyright etc elided>
(gdb) target core netbsd.0.core 
"/var/crash/netbsd.0.core" is not a core dump: file format not recognized
(gdb) 

8. Just for the heck of it, try target kvm

(gdb) target kvm netbsd.0.core 


Fatal signal: Segmentation fault
----- Backtrace -----
0x7ff2da ???
0x7fcfe8 ???
0x7fd151 ???
<stack trace elided>
0xba46fa ???
0x69eedc ???
---------------------
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/>.

[1]   Segmentation fault (core dumped) gdb
# 
	
>Fix:
	

>Unformatted:
 	
 	


Home | Main Index | Thread Index | Old Index