NetBSD Problem Report #56445

From www@netbsd.org  Wed Oct  6 12:06:38 2021
Return-Path: <www@netbsd.org>
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 DB9AD1A921F
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  6 Oct 2021 12:06:37 +0000 (UTC)
Message-Id: <20211006120636.C92A91A9239@mollari.NetBSD.org>
Date: Wed,  6 Oct 2021 12:06:36 +0000 (UTC)
From: uwe@stderr.spb.ru
Reply-To: uwe@stderr.spb.ru
To: gnats-bugs@NetBSD.org
Subject: DDB_DUMPSTACK is not documented and counterintuitive
X-Send-Pr-Version: www-1.0

>Number:         56445
>Category:       kern
>Synopsis:       DDB_DUMPSTACK is not documented and counterintuitive
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 06 12:10:00 +0000 2021
>Last-Modified:  Wed Oct 06 12:15:01 +0000 2021
>Originator:     Valery Ushakov
>Release:        NetBSD-9.99.90
>Organization:
>Environment:
>Description:
When current kernel panics it spews out ddb stack trace.

This is apparently (from a quick RTFS) controlled by the kernel option
DDB_DUMPSTACK that is not in any kernel config in the tree and is not
documented in ddb(4).

The behaviour is completely counter-productive when db_onpanic is true
(the user presumably knows how to use bt), especially on non-serial
consoles when large/infinite scrollback is not available.

sys/ddb/db_panic.c:

revision 1.7
date: 2018-02-17 03:41:09 +0300;  author: sevan;  state: Exp;  lines: +6 -6;  commitid: fYewV3fKl2bA89rA;
branches:  1.7.2;
Opt to print a backtrace on panic by default with the intention of improving bug reports.
Instead of relying on ddb.onpanic=2, introduce a new sysctl called dumpstack to handle this.
via <jmcneill> channeled through <mrg> on tech-kern[1]

[1] https://mail-index.netbsd.org/tech-kern/2018/02/15/msg023103.html

>How-To-Repeat:
Get a kernel panic with GENERIC on something with a wscons console.

>Fix:
Make the defaults sane, db_onpanic should be factored into the
decision to dump the stack.

Document the kernel option, add it (commented out) to configs.

>Audit-Trail:
From: "Valeriy E. Ushakov" <uwe@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56445 CVS commit: src/sys/ddb
Date: Wed, 6 Oct 2021 12:14:51 +0000

 Module Name:	src
 Committed By:	uwe
 Date:		Wed Oct  6 12:14:51 UTC 2021

 Modified Files:
 	src/sys/ddb: files.ddb

 Log Message:
 Add DDB_DUMPSTACK to opt_ddbparam.h.
 PR kern/56445


 To generate a diff of this commit:
 cvs rdiff -u -r1.14 -r1.15 src/sys/ddb/files.ddb

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

NetBSD Home
NetBSD PR Database Search

(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.