Random crashes when starting some applications with KDE

From: Mike Clarke <jmc-freebsd2_at_milibyte.co.uk>
Date: Sat, 17 Jun 2023 18:48:56 UTC
I get occasional random crashes when opening some applications in KDE. The most 
common culprits are libreoffice. gimp and audacity though they frequently start without 
any problem. Everything freezes as soon as the application starts and after a few seconds 
the system reboots.

Here's some typical crash files:

curlew:/var/crash# cat core.txt.2 
'version' has unknown type; cast it to its declared type 
'version' has unknown type; cast it to its declared type 
'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.2 
curlew:/var/crash# cat info.2 
Dump header from device: /dev/gpt/swap1 
 Architecture: amd64 
 Architecture Version: 2 
 Dump Length: 1692549120 
 Blocksize: 512 
 Compression: none 
 Dumptime: 2023-06-08 12:29:44 +0100 
 Hostname: curlew 
 Magic: FreeBSD Kernel Dump 
 Version String: FreeBSD 13.2-RELEASE releng/13.2-n254617-525ecfdad597 GENERIC 
 Panic String: page fault 
 Dump Parity: 3806917495 
 Bounds: 2 
 Dump Status: good

I've tried to debug the dump following the instructions in section 10.2 of the handbook 
https://docs.freebsd.org/en/books/developers-handbook/kerneldebug/#kerneldebug-gdb[1] but with no success:

curlew:/var/crash# kgdb /boot/kernel/kernel /var/crash/vmcore.2 
*GNU gdb (GDB) 13.1 [GDB v13.1 for FreeBSD]* 
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-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) 
/wrkdirs/usr/ports/devel/gdb/work-py39/gdb-13.1/gdb/thread.c:1337: internal-error: 
switch_to_thread: Assertion
`thr != NULL' failed. 
A problem internal to GDB has been detected, 
further debugging may prove unreliable. 
----- Backtrace ----- 
0x1320d61 ??? 
0x17c7751 ??? 
0x17c75b8 ??? 
0x1c5d723 ??? 
0x17869ef ??? 
0x1458ab0 ??? 
0x17677ff ??? 
0x1355614 ??? 
0x1794d75 ??? 
0x1541ac5 ??? 
0x15404bb ??? 
0x153ee9e ??? 
0x122c35b ??? 
--------------------- 
/wrkdirs/usr/ports/devel/gdb/work-py39/gdb-13.1/gdb/thread.c:1337: internal-error: 
switch_to_thread: Assertion
`thr != NULL' failed. 
A problem internal to GDB has been detected, 
further debugging may prove unreliable. 
Quit this debugging session? (y or n)
-- 
Mike Clarke

--------
[1] https://docs.freebsd.org/en/books/developers-handbook/kerneldebug/#kerneldebug-gdb