NetBSD Problem Report #55327

From www@netbsd.org  Sun May 31 13:23:02 2020
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-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 7DDA81A9218
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 31 May 2020 13:23:02 +0000 (UTC)
Message-Id: <20200531132301.B33F01A921A@mollari.NetBSD.org>
Date: Sun, 31 May 2020 13:23:01 +0000 (UTC)
From: rokuyama.rk@gmail.com
Reply-To: rokuyama.rk@gmail.com
To: gnats-bugs@NetBSD.org
Subject: !cpu_intr_p() assertion failure in DDB
X-Send-Pr-Version: www-1.0

>Number:         55327
>Category:       kern
>Synopsis:       !cpu_intr_p() assertion failure in DDB
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 31 13:25:00 +0000 2020
>Last-Modified:  Wed Jun 09 04:45:01 +0000 2021
>Originator:     Rin Okuyama
>Release:        9.99.64
>Organization:
Department of Physics, Meiji University
>Environment:
Should be MI problem, but,
NetBSD obs266 9.99.64 NetBSD 9.99.64 (OBS266) #214: Sun May 31 18:33:52 JST 2020  rin@latipes:/usr/src/sys/arch/evbppc/compile/OBS266 evbppc
>Description:
DDB can be running in the interrupt context, when, e.g., activated from
console. This results in !cpu_intr_p() assertion failure here and there.

Recently, I've hacked db_alloc() and friends to use kmem_intr_alloc(9),
instead of malloc(9). But, still, kill command at least triggers that
assertion failure:

~Stopped in pid 0.2 (system) at  netbsd:comintr+0x82c:   stw     r25, 0x6c(r27)
db> ps
PID    LID S CPU     FLAGS       STRUCT LWP *               NAME WAIT
1663  1663 3   0        80            77949c0                 sh ttyraw
...
db> kill 67f
panic: kernel diagnostic assertion "!cpu_intr_p()" failed: file "../../../../kern/kern_sig.c", line 1308
...
>How-To-Repeat:
Enable DIAGNOSTIC, enter DDB from console, then, kill some process.
>Fix:
No idea at the moment...

>Audit-Trail:
From: Christos Zoulas <christos@zoulas.com>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org,
 gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Subject: Re: kern/55327: !cpu_intr_p() assertion failure in DDB
Date: Sun, 31 May 2020 19:44:15 -0400

 --Apple-Mail=_D223AC2C-5394-438C-A50D-BEEEB23A45E0
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=us-ascii


 > Still, DDB kill command at least is broken.

 That has been broken for a long time for different reasons.

 christos

 --Apple-Mail=_D223AC2C-5394-438C-A50D-BEEEB23A45E0
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename=signature.asc
 Content-Type: application/pgp-signature;
 	name=signature.asc
 Content-Description: Message signed with OpenPGP

 -----BEGIN PGP SIGNATURE-----
 Comment: GPGTools - http://gpgtools.org

 iF0EARECAB0WIQS+BJlbqPkO0MDBdsRxESqxbLM7OgUCXtRBTwAKCRBxESqxbLM7
 Ov5HAKDilQ68aNVJqGz+HwWoBLaAIVujRACgworqYEFaY5hXq5llsf3aQwXBFKs=
 =zo4i
 -----END PGP SIGNATURE-----

 --Apple-Mail=_D223AC2C-5394-438C-A50D-BEEEB23A45E0--

From: Rin Okuyama <rokuyama.rk@gmail.com>
To: Christos Zoulas <christos@zoulas.com>, gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: kern/55327: !cpu_intr_p() assertion failure in DDB
Date: Mon, 1 Jun 2020 09:21:09 +0900

 On 2020/06/01 8:44, Christos Zoulas wrote:
 >> Still, DDB kill command at least is broken.
 > 
 > That has been broken for a long time for different reasons.
 Thanks. DDB is something like a tightrope walking, and I can imagine
 it is difficult to implement commands like "kill" consistently with
 other parts of kernel...

 Thanks,
 rin

From: matthew green <mrg@eterna.com.au>
To: Christos Zoulas <christos@zoulas.com>
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
    netbsd-bugs@netbsd.org, gnats-bugs@netbsd.org
Subject: re: kern/55327: !cpu_intr_p() assertion failure in DDB
Date: Mon, 01 Jun 2020 10:43:25 +1000

 > > Still, DDB kill command at least is broken.
 > 
 > That has been broken for a long time for different reasons.

 i thought you fixed it a while ago... ;-)

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/55327: !cpu_intr_p() assertion failure in DDB
Date: Wed, 9 Jun 2021 04:41:41 +0000

 not sent to gnats-bugs:

    ------

 From: Rin Okuyama <rokuyama.rk@gmail.com>
 To: kern-bug-people@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
 Subject: Re: kern/55327: !cpu_intr_p() assertion failure in DDB
 Date: Mon, 1 Jun 2020 08:39:53 +0900

 On 2020/05/31 22:25, rokuyama.rk@gmail.com wrote:
 > Recently, I've hacked db_alloc() and friends to use kmem_intr_alloc(9),
 > instead of malloc(9).

 For buffers in DDB session, I've stopped using dynamically allocated
 buffers and switched to static buffers in BSS. db_alloc(sz) is now
 kmem_alloc(sz, KM_SLEEP), and used only for permanent data storage
 when initializing DDB.

 Still, DDB kill command at least is broken.

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.