Solved How to enable crash dumps?

Hi all,

My kernel is crashing due to some changes I am making. When I enter ddb, I type in dump, which appears to dump the image state but when I boot up there is no content in /var/crash. Running `kgdb` does not find any crash logs. What might be causing that? Please advise.

Thanks!
 
I do not believe so. How does one add that? I suspect adding something to /boot/loader.conf, but it isn't obvious to me what exactly?
 
Because sometimes it's the very small things one may stumble (or as we say in germany: one may not see the forest because of the trees.) :

While installation the installer asks if you want to enable kernel crash dumps to /var/crash (see hb 2.8.3 enabling services) maybe you unchecked this button.
However this only sets dumpdev within /etc/rc.conf, can be changed easily:

Code:
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"

You already checked this is not set to "NO"?
 
Because sometimes it's the very small things one may stumble (or as we say in germany: one may not see the forest because of the trees.) :

While installation the installer asks if you want to enable kernel crash dumps to /var/crash (see hb 2.8.3 enabling services) maybe you unchecked this button.
However this only sets dumpdev within /etc/rc.conf, can be changed easily:

Code:
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"

You already checked this is not set to "NO"?

Verified, it is set to "AUTO". I suspect this is a swap issue?
I previously had this:

My fstab options are as follows:

Code:
/dev/vtbd0p2       none    swap    sw      0   0
md99     none      swap    sw,file=/usr/swap0,late       0  0

I should say, at bootup I see what appears to the very error scroll across the screen, so there is some preservation of state but /var/crash is still empty.
 
It's a file backed (/usr/swap0) swap. Is that swap big enough to handle a full savecore(8)? I'm not sure if you can use a file backed swap for this.
 
Still stuck, no crash logs.

My /etc/fstab is:
Code:
# Device        Mountpoint    FStype    Options        Dump    Pass#
/dev/vtbd0p2        none        swap    sw        1    0
md99       none       swap       sw,file=/usr/swap0,late       0     0

My /etc/rc.conf is:
Code:
sendmail_enable="NONE"
hostname="freebsddev"
ifconfig_vtnet0="DHCP"
sshd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"

I am triggering a panic, at the ddb prompt I run dump. It appears to be dumping.
At reboot, I see a line that appears related where the crash occurred in code, but then I get a line that says
No crash dumps in /var/crash.

I'm out of options. Is this a bug?
 
When system is up and running you can use dumpon -l to determine if you have dump devices set. If you go through the dumpon(8) you'll see other options that are available.

For local dumps you do need to have proper swap partition defined. vtbd0p2 seems ok from your output, maybe it's just too small. Or something is rejecting the device to be a dump device. If you are certain ddb wrote the dump just fine to the device you could try to attempt the savecore yourself with savecore /var/crash /dev/da0pX where da0pX is a swap device.
Code:
# verify dump device (if /dev/null set it)
# dumpon -l 
# dumpon /dev/vtbd0p2
# enter the ddb either with panic or manually ; in ddb do
db> call doadump(0)
db> reset
If you don't see the dump there try to force the savecore manually as I mentioned above.
 
For the first step, I checked that /dev/dumpdev is a symlink to /dev/vtbd0p2.
Ran the rest accordingly, no files in var/crash on reboot.
 
Try following: Drop from multi user to single user mode (file system must be read/write) by executing shutdown now, change to ttyv0, execute sysctl debug.kdb.panic=1 .
 
Back
Top