I have been regularly getting kernel panics on my machine.
I've set up swap and configured the machine to save the crash dumps.
I've tried using kgdb and the output follows:
So I see two issue here:
How do I get the debug symbols?
I've set up swap and configured the machine to save the crash dumps.
Code:
root@mymachine:/var/crash # ls -la
total 6035439
drwxr-x--- 2 root wheel 21 Jul 22 08:55 .
drwxr-xr-x 25 root wheel 25 Jul 22 09:07 ..
-rw-r--r-- 1 root wheel 2 Jul 22 08:54 bounds
-rw-r--r-- 1 root wheel 169 Jul 22 02:21 core.txt.0
-rw-r--r-- 1 root wheel 169 Jul 22 03:15 core.txt.1
-rw-r--r-- 1 root wheel 169 Jul 22 07:29 core.txt.2
-rw-r--r-- 1 root wheel 169 Jul 22 07:56 core.txt.3
-rw-r--r-- 1 root wheel 169 Jul 22 08:55 core.txt.4
-rw------- 1 root wheel 371 Jul 22 02:20 info.0
-rw------- 1 root wheel 370 Jul 22 03:13 info.1
-rw------- 1 root wheel 371 Jul 22 07:28 info.2
-rw------- 1 root wheel 370 Jul 22 07:55 info.3
-rw------- 1 root wheel 371 Jul 22 08:54 info.4
lrwxr-xr-x 1 root wheel 6 Jul 22 08:55 info.last -> info.4
-rw-r--r-- 1 root wheel 5 May 12 09:27 minfree
-rw------- 1 root wheel 4540502016 Jul 22 02:21 vmcore.0
-rw------- 1 root wheel 4627173376 Jul 22 03:14 vmcore.1
-rw------- 1 root wheel 4592214016 Jul 22 07:29 vmcore.2
-rw------- 1 root wheel 4530495488 Jul 22 07:56 vmcore.3
-rw------- 1 root wheel 4536147968 Jul 22 08:55 vmcore.4
lrwxr-xr-x 1 root wheel 8 Jul 22 08:55 vmcore.last -> vmcore.4
root@mymachine:/var/crash # cat core.txt.4
'version' has unknown type; cast it to its declared type
'version' has unknown type; cast it to its declared type
Unable to find matching kernel for /var/crash/vmcore.4
root@mymachine:/var/crash # cat info.last
Dump header from device: /dev/da0p2
Architecture: amd64
Architecture Version: 2
Dump Length: 4536147968
Blocksize: 512
Compression: none
Dumptime: 2022-07-22 08:31:09 +0100
Hostname: nsgnalpsroot
Magic: FreeBSD Kernel Dump
Version String: FreeBSD 13.1-RELEASE GENERIC
Panic String: page fault
Dump Parity: 1801250075
Bounds: 4
Dump Status: good
I've tried using kgdb and the output follows:
Code:
root@mymachine:/var/crash # kgdb -n last
kgdb: couldn't find a suitable kernel image
root@mymachine:/var/crash # kgdb /boot/kernel/kernel /var/crash/vmcore.last
GNU gdb (GDB) 11.2 [GDB v11.2 for FreeBSD]
Copyright (C) 2022 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-portbld-freebsd13.1".
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"...
Reading symbols from /boot/kernel/kernel...
(No debugging symbols found in /boot/kernel/kernel)
/usr/ports/devel/gdb/work-py38/gdb-11.2/gdb/thread.c:1345: internal-error: void switch_to_thread(thread_info *): Assertion `thr != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n
This is a bug, please report it. For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>.
/usr/ports/devel/gdb/work-py38/gdb-11.2/gdb/thread.c:1345: internal-error: void switch_to_thread(thread_info *): Assertion `thr != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) n
Command aborted.
(kgdb)
So I see two issue here:
- No debugging symbols found in /boot/kernel/kernel
- /usr/ports/devel/gdb/work-py38/gdb-11.2/gdb/thread.c:1345: internal-error: void switch_to_thread(thread_info *): Assertion `thr != NULL' failed.
How do I get the debug symbols?