NetBSD Problem Report #54336

From www@netbsd.org  Tue Jul  2 00:15:56 2019
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 8E2887A1AA
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  2 Jul 2019 00:15:56 +0000 (UTC)
Message-Id: <20190702001555.37EB17A1DA@mollari.NetBSD.org>
Date: Tue,  2 Jul 2019 00:15:55 +0000 (UTC)
From: coypu@sdf.org
Reply-To: coypu@sdf.org
To: gnats-bugs@NetBSD.org
Subject: panic in kern_lwp.c when running a script
X-Send-Pr-Version: www-1.0

>Number:         54336
>Category:       kern
>Synopsis:       panic in kern_lwp.c when running a script
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 02 00:20:00 +0000 2019
>Last-Modified:  Tue Jul 02 17:20:01 +0000 2019
>Originator:     coypu
>Release:        NetBSD 8.99.47
>Organization:
>Environment:
NetBSD planets 8.99.47 NetBSD 8.99.47 (GENERIC) #2: Tue Jun 25 05:55:09 UTC 2019  fly@ns3105053:/home/fly/obj/sys/arch/amd64/compile/GENERIC amd64
>Description:
I accidentally pasted a few hundred lines of C code to fish (shell).
netbsd didn't like that.

I don't have the exact script, though.

[ 62397.585980] panic: kernel diagnostic assertion "l->l_refcnt != 0" failed: file "/home/fly/src/sys/kern/kern_lwp.c", line 1625 
[ 62397.585980] cpu1: Begin traceback...
[ 62397.585980] vpanic() at netbsd:vpanic+0x160
[ 62397.585980] stge_eeprom_wait.isra.4() at netbsd:stge_eeprom_wait.isra.4
[ 62397.585980] lwp_addref() at netbsd:lwp_addref+0xc7
[ 62397.585980] procfs_lookup() at netbsd:procfs_lookup+0x555
[ 62397.595987] VOP_LOOKUP() at netbsd:VOP_LOOKUP+0x52
[ 62397.595987] lookup_once() at netbsd:lookup_once+0x260
[ 62397.595987] namei_tryemulroot() at netbsd:namei_tryemulroot+0x2de
[ 62397.595987] namei() at netbsd:namei+0x29
[ 62397.595987] fd_nameiat.isra.2() at netbsd:fd_nameiat.isra.2+0x54
[ 62397.595987] do_sys_statat() at netbsd:do_sys_statat+0x87
[ 62397.595987] sys___stat50() at netbsd:sys___stat50+0x28
[ 62397.595987] syscall() at netbsd:syscall+0x181
[ 62397.595987] --- syscall (number 439) ---
[ 62397.595987] 77660ab8f07a:
[ 62397.595987] cpu1: End traceback...
[ 62397.595987] WARNING: SPL NOT LOWERED ON SYSCALL 60 3 EXIT 38771800 7

[ 62397.595987] dumping to dev 0,1 (offset=1896, size=1013425):
[ 62397.595987] dump wddump: wd0: (aborted command)

[ 62398.686629] i/o error


>How-To-Repeat:

>Fix:

>Audit-Trail:
From: David Holland <dholland-gnats@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/54336: panic in kern_lwp.c when running a script
Date: Tue, 2 Jul 2019 16:56:19 +0000

 On Tue, Jul 02, 2019 at 12:20:00AM +0000, coypu@sdf.org wrote:
  > [ 62397.585980] panic: kernel diagnostic assertion "l->l_refcnt != 0" failed: file "/home/fly/src/sys/kern/kern_lwp.c", line 1625 
  > [ 62397.585980] cpu1: Begin traceback...
  > [ 62397.585980] vpanic() at netbsd:vpanic+0x160
  > [ 62397.585980] stge_eeprom_wait.isra.4() at netbsd:stge_eeprom_wait.isra.4
  > [ 62397.585980] lwp_addref() at netbsd:lwp_addref+0xc7
  > [ 62397.585980] procfs_lookup() at netbsd:procfs_lookup+0x555

 Do you have any idea what might have been near the string /proc in the
 paste? (Seems sort of surprising for that to appear at all...)

 -- 
 David A. Holland
 dholland@netbsd.org

From: coypu@sdf.org
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/54336: panic in kern_lwp.c when running a script
Date: Tue, 2 Jul 2019 17:18:57 +0000

 Looking at the fish code, its use of procfs consists of reading
 /proc/PID/stat to do job time statistics.

 It's possible it hit a race with reading /proc/PID/stat and something
 else, I've seen something along this line before with htop.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.