Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Nov 2021 22:57:04 +0300
From:      Rozhuk Ivan <rozhuk.im@gmail.com>
To:        Alexander <alex@alexslomka.xyz>
Cc:        "freebsd-current@freebsd.org" <freebsd-current@freebsd.org>
Subject:   Re: Problems with getting a crash dump
Message-ID:  <20211108225704.243752a6@rimwks.local>
In-Reply-To: <v5_t5VART-vha7P8SGBRZ35WvfTGSjVObzcgu3dTOMyCnkmFx7yDSDPCVI-MeKICc9HZ7xDJtBJRHq0xxFtUMBO8oiMWqRO62t8Vlebb9rw=@alexslomka.xyz>
References:  <v5_t5VART-vha7P8SGBRZ35WvfTGSjVObzcgu3dTOMyCnkmFx7yDSDPCVI-MeKICc9HZ7xDJtBJRHq0xxFtUMBO8oiMWqRO62t8Vlebb9rw=@alexslomka.xyz>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 08 Nov 2021 19:08:31 +0000
Alexander <alex@alexslomka.xyz> wrote:

> Hello, I am currently using FreeBSD 14.0-CURRENT and I found a bug
> that triggers a kernel panic. I wanted to make a kernel crash dump to
> further investigate the issue, but after a few tries I still did not
> manage to do it. I started by following the instructions in the
> FreeBSD Handbook. I checked that /dev/nvd0p2.eli is an active swap
> device and I configured it to be used as a dump device like this:
> 
> # dumpon -v /dev/nvd0p2.eli
> # sysctl debug.kdb.panic=1
> 
> Then I booted into single user mode to extract the core dumb:
> 
> # savecore -vC /dev/nvd0p2
> checking for kernel dump on device /dev/nvd0p2
> mediasize = 2147483648 bytes
> sectorsize = 512 bytes
> magic mismatch on last dump header on /dev/nvd0p2
> No dump exists
> 
> A you can see the core dump was not written to the device. Later I
> also tried using /dev/nvd0p2 (with out the "eli" part), because
> /dev/nvd0p2.eli is only available after I enable it using swapon, but
> the handbook states the I should first extract the dump, before I use
> the device as swap again. But the result was the same. /dev/nvd0p2 is
> only 2gb in size and it's an encrypted swap device, so I thought that:
> 1) Maybe the size of the device is to small even for a minidump.
> 2) Perhaps using encrypted swap as a dump device is not supported.
> 
> Because of those complications I decided to use an external 8gb USB
> drive as my dump device.
> 
> # gpart create -s gpt /dev/da0
> # gpart add -t freebsd-swap /dev/da0
> # swapoff -a
> # swapon /dev/da0p1
> # dumpon -v /dev/da0p1
> kernel dumps on priority: device
> 0: da0p1
> 
> I have 8gb of RAM so a 8gb dump device should be big enough for a
> minidump. I used `sysctl debug.kdb.panic=1` to crash the kernel and
> rebooted the system. I also waited for 10 minutes to ensure the the
> kernel finished writing the core dump to the device.
> 
> # savecore -vC /dev/da0p1
> checking for kernel dump on device /dev/da0p1
> mediasize = 7744741376 bytes
> sectorsize = 512 bytes
> magic mismatch on last dump header on /dev/da0p1
> No dump exists
> 
> As you can see I still did not manage to get a kernel crash dump. Any
> ideas?
> 
> Here is a picture of the output I get after running `sysctl
> debug.kdb.panic=1`:
> https://forums.freebsd.org/attachments/img_20211108_163313-jpeg.11936/
> 
> PS yes kern.coredump is set to 1.
> 


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238301
http://netlab.dhis.org/wiki/ru:software:freebsd:kernel_debug

It work for 12 and 13, may be 14 have bugs/changes.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20211108225704.243752a6>