Steps to create a crash dump drive?

Stilez

Guru
Joined
Apr 8, 2016
Messages
529
I've stumbled across a bug that seems to cause a kernel crash (immediate reboot on clicking "OK" in the GUI). I need to get a crash dump when it's triggered. But I don't yet have any significant swap on my system - just the boot drive and pool.

I probably need to add a spare drive, format it as swap, add some RC tunables to set it up as a dump device, and other magic, to ensure that I capture a crash dump next time. But what are the exact steps needed to set up my system to capture kernel crash dumps?

Then, after a crash, what do I do to ensure I recover the crash dump onto another disk from the new swap before it's overwritten?

Last, the system has 256 GB RAM, which is much bigger than kernel space (ARC = 240+ GB), so what size swap should I configure?
 
Last edited:

freqlabs

iXsystems
iXsystems
Joined
Jul 18, 2019
Messages
50
The system is set up to automatically save a textdump when a crash occurs. Did you find those already?
 

Stilez

Guru
Joined
Apr 8, 2016
Messages
529
The system is set up to automatically save a textdump when a crash occurs. Did you find those already?
Thanks! I don't know much about BSD crash handling and didn't know textdumps were a thing, or where to find them. So all dump, debug, and crash related settings and data capture of all kinds, are at default.

I've just tried savecore -Cvv and nothing's listed ("No dump exists"), then again its been a few reboots.

But I see in man savecore, it states it'll save them on any dump or swap device - as I mentioned, I doubt I've got such a device and can't tell if its suitable if I do. But perhaps its configured to save them elsewhere? If its trying to dump more than a couple of GB, then there isn't really a disk other than the data pool it can do it on. Like I said, I suspect I'm not configured in a way that allows saving of crash data even if the build is configured to capture it?

What do I need to do, to make my system able to.capture full crashdumps, or text dumps?
 
Last edited:

freqlabs

iXsystems
iXsystems
Joined
Jul 18, 2019
Messages
50
Look in /data/crash for the textdumps. Getting full dumps you can inspect with kgdb would go something like this (untested off-the-top-of-my-head no-warranty not-recommended etc):
Code:
# Attach a device for the crash dump, let's say it's da6,
# and remove the partitions (for the sake of example)
gpart destroy -F da6
# Instruct the system to dump to this device
dumpon da6
# Remove the default panic behavior
ddb unscript kdb.enter.default
# Then do whatever you do to cause a panic
# You will be dropped to an interactive kdb prompt on the console,
# where you can type
continue
# to start the dump and reset the system when finished.
# When the system comes back online, run
savecore -v ./ /dev/da6
# Then you can inspect the core with kgdb,
# but it probably won't be very useful without a kernel built with debug symbols
kgdb /boot/kernel/kernel ./vmcore
 

Stilez

Guru
Joined
Apr 8, 2016
Messages
529
Look in /data/crash for the textdumps. Getting full dumps you can inspect with kgdb would go something like this (untested off-the-top-of-my-head no-warranty not-recommended etc):
Code:
# Attach a device for the crash dump, let's say it's da6,
# and remove the partitions (for the sake of example)
gpart destroy -F da6
# Instruct the system to dump to this device
dumpon da6
# Remove the default panic behavior
ddb unscript kdb.enter.default
# Then do whatever you do to cause a panic
# You will be dropped to an interactive kdb prompt on the console,
# where you can type
continue
# to start the dump and reset the system when finished.
# When the system comes back online, run
savecore -v ./ /dev/da6
# Then you can inspect the core with kgdb,
# but it probably won't be very useful without a kernel built with debug symbols
kgdb /boot/kernel/kernel ./vmcore
/data/crash stays resolutely empty. Even after using debug.kdb.panic=1 to trigger a panic.

Also from what you're saying, it doesn't sound like full dumps are that helpful, i need to get a textdump?

Everyone seems convinced the system should "make textdumps/crashdumps happen", by magic or automatically. Ive been told both that i should never need to.add swap, and that "the system will automatically capture a textdump automatically on crashing". It looks like neither of those statements is true. (I'm also sceptical because I thought it needs adequate swap/dump too). Maybe other config too.

Is it possible for someine to.let me know, definitively and step by step, what i need to do, to capture textdump debug information for a kernel crash bug on a clean install of 12-beta1, for devs, whether kernel or text dump or whatever else they need?
 
Last edited:

freqlabs

iXsystems
iXsystems
Joined
Jul 18, 2019
Messages
50
Is it possible for someine to.let me know, definitively and step by step, what i need to do, to capture textdump debug information for a kernel crash bug on a clean install of 12-beta1, for devs, whether kernel or text dump or whatever else they need?
All you should need to provide for devs is a debug file from System / Advanced / Save Debug. That includes any textdumps. You don't have to configure anything. Text dumps are very small, they do not need a lot of swap space.
 
Last edited:
Top