NetBSD Problem Report #55967
From root@whooppee.com Sun Jan 31 20:43:11 2021
Return-Path: <root@whooppee.com>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 5B47C1A9239
for <gnats-bugs@gnats.NetBSD.org>; Sun, 31 Jan 2021 20:43:11 +0000 (UTC)
Message-Id: <20210131204308.0564230F2C4@speedy.whooppee.com>
Date: Sun, 31 Jan 2021 12:43:08 -0800 (PST)
From: paul@whooppee.com
Reply-To: paul@whooppee.com
To: gnats-bugs@NetBSD.org
Subject: savecore(8) needs a ``-D dumpdev'' option
X-Send-Pr-Version: 3.95
>Number: 55967
>Category: bin
>Synopsis: savecore(8) needs a ``-D dumpdev'' option
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Sun Jan 31 20:45:00 +0000 2021
>Originator: Paul Goyette
>Release: NetBSD 9.99.79
>Organization:
+--------------------+--------------------------+-----------------------+
| Paul Goyette | PGP Key fingerprint: | E-mail addresses: |
| (Retired) | FA29 0E3B 35AF E8AE 6651 | paul@whooppee.com |
| Software Developer | 0786 F758 55DE 53BA 7731 | pgoyette@netbsd.org |
+--------------------+--------------------------+-----------------------+
>Environment:
System: NetBSD speedy.whooppee.com 9.99.79 NetBSD 9.99.79 (SPEEDY 2021-01-25 22:34:21 UTC) #0: Tue Jan 26 07:24:41 UTC 2021 paul@speedy.whooppee.com:/build/netbsd-local/obj/amd64/sys/arch/amd64/compile/SPEEDY amd64
Architecture: x86_64
Machine: amd64
>Description:
When using savecore(8) to copy a kernel core dump created by a
version of NetBSD other than the current running kernel, it can
fail to determine the correct dump device.
When the kernel that created the core dump has no ``dump on dev''
clause in its configuration file's config line, and you use the
``-N kernel'' option, savecore reads the dumpdev's major/minor
from the kernel file and gets 0/0. It then attempts to look-up
that major/minor and finds /dev/console !!! Subsequent checks
explicity disallow this, and produce an error message instructing
the user to "override kernel" (even though the kernel has already
been overridden with the -N option).
>How-To-Repeat:
1. Build an old-kernel (ie, 9.99.78) with ``config netbsd root on
? type ffs''
2. Build a new-kernel (ie, 9.99.79)
3. Boot old-kernel, and install a dumpdev (with ``swapctl -D ...'')
4. Force the old-kernel to crash, and write a core dump
5. Reboot, this time using new-kernel.
6. Attempt to grab the core-dump using
savecore -f -N new-kernel
7. Observe the error message
Note that the core dump can still be retrieved by rebooting with
the old-kernel in single-user mode, and then execute savecore(8)
without the -N option.
>Fix:
I started to look into this, and got as far as reading the
dump header, but then it always seemed to get the dumpbytes
counter as zero, so did not copy any dump content. :( I
got lost trying to figure it out.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.