NetBSD Problem Report #52587

From dmb@yenn.ulegend.net  Sun Oct  1 10:23:33 2017
Return-Path: <dmb@yenn.ulegend.net>
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 F3FCB7A104
	for <gnats-bugs@gnats.NetBSD.org>; Sun,  1 Oct 2017 10:23:32 +0000 (UTC)
Message-Id: <20171001102328.97C0A5C16@yenn.ulegend.net>
Date: Sun,  1 Oct 2017 10:23:28 +0000 (UTC)
From: dmb@yenn.ulegend.net
Reply-To: dmb@yenn.ulegend.net
To: gnats-bugs@NetBSD.org
Subject: NetBSD 8 panic after a few days of uptime
X-Send-Pr-Version: 3.95

>Number:         52587
>Category:       kern
>Synopsis:       NetBSD 8 panic after a few days of uptime
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 01 10:25:01 +0000 2017
>Closed-Date:    Mon Nov 20 05:59:27 +0000 2017
>Last-Modified:  Mon Nov 20 05:59:27 +0000 2017
>Originator:     Dominik Bialy
>Release:        NetBSD 8.0_BETA
>Organization:
Underlegend Networks
>Environment:
System: NetBSD yenn 8.0_BETA NetBSD 8.0_BETA (YENN) #0: Fri Sep 15 12:57:31 UTC 2017 builds@yenn:/var/obj/sys/arch/amd64/compile/YENN amd64
Architecture: x86_64
Machine: amd64
>Description:
	After a few days of uptime the server paniced.

panic: kernel diagnostic assertion "(psref->psref_cpu == curcpu())" failed: file "/usr/src/sys/kern/subr_psref.c", line 296 passive reference transferred from CPU 1 to CPU 0
cpu0: Begin traceback...
vpanic() at netbsd:vpanic+0x140
ch_voltag_convert_in() at netbsd:ch_voltag_convert_in
psref_release() at netbsd:psref_release+0x1ee
bridge_input() at netbsd:bridge_input+0x8a3
tap_dev_write.isra.7() at netbsd:tap_dev_write.isra.7+0x12d
cdev_write() at netbsd:cdev_write+0x70
spec_write() at netbsd:spec_write+0xb2
VOP_WRITE() at netbsd:VOP_WRITE+0x37
vn_write() at netbsd:vn_write+0xec
dofilewrite() at netbsd:dofilewrite+0x97
sys_write() at netbsd:sys_write+0x5f
syscall() at netbsd:syscall+0x1d8
--- syscall (number 4) ---
71835583dfda:
cpu0: End traceback...

	There is OpenVPN/tap set up on the server, if this matters.  The CPU is AMD Athlon 64 X2.

>How-To-Repeat:
	Don't know...
>Fix:
	None known... Maybe disabling second core would be a workaround.

>Release-Note:

>Audit-Trail:
From: "Ryota Ozaki" <ozaki-r@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52587 CVS commit: src/sys/net
Date: Mon, 2 Oct 2017 07:40:25 +0000

 Module Name:	src
 Committed By:	ozaki-r
 Date:		Mon Oct  2 07:40:25 UTC 2017

 Modified Files:
 	src/sys/net: if_bridge.c

 Log Message:
 Add curlwp_bind to bridge_input for psref

 It can be called in a thread context via tap (tap_dev_write).

 Fix PR kern/52587


 To generate a diff of this commit:
 cvs rdiff -u -r1.134 -r1.135 src/sys/net/if_bridge.c

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

State-Changed-From-To: open->pending-pullups
State-Changed-By: ozaki-r@NetBSD.org
State-Changed-When: Mon, 02 Oct 2017 07:53:07 +0000
State-Changed-Why:
pullup-8 #297


From: Ryota Ozaki <ozaki-r@netbsd.org>
To: dmb@yenn.ulegend.net
Cc: "gnats-bugs@NetBSD.org" <gnats-bugs@netbsd.org>, kern-bug-people@netbsd.org, 
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: kern/52587: NetBSD 8 panic after a few days of uptime
Date: Mon, 2 Oct 2017 17:01:07 +0900

 On Sun, Oct 1, 2017 at 7:25 PM,  <dmb@yenn.ulegend.net> wrote:
 >>Number:         52587
 >>Category:       kern
 >>Synopsis:       NetBSD 8 panic after a few days of uptime
 >>Confidential:   no
 >>Severity:       serious
 >>Priority:       medium
 >>Responsible:    kern-bug-people
 >>State:          open
 >>Class:          sw-bug
 >>Submitter-Id:   net
 >>Arrival-Date:   Sun Oct 01 10:25:01 +0000 2017
 >>Originator:     Dominik Bialy
 >>Release:        NetBSD 8.0_BETA
 >>Organization:
 > Underlegend Networks
 >>Environment:
 > System: NetBSD yenn 8.0_BETA NetBSD 8.0_BETA (YENN) #0: Fri Sep 15 12:57:31 UTC 2017 builds@yenn:/var/obj/sys/arch/amd64/compile/YENN amd64
 > Architecture: x86_64
 > Machine: amd64
 >>Description:
 >         After a few days of uptime the server paniced.
 >
 > panic: kernel diagnostic assertion "(psref->psref_cpu == curcpu())" failed: file "/usr/src/sys/kern/subr_psref.c", line 296 passive reference transferred from CPU 1 to CPU 0
 > cpu0: Begin traceback...
 > vpanic() at netbsd:vpanic+0x140
 > ch_voltag_convert_in() at netbsd:ch_voltag_convert_in
 > psref_release() at netbsd:psref_release+0x1ee
 > bridge_input() at netbsd:bridge_input+0x8a3
 > tap_dev_write.isra.7() at netbsd:tap_dev_write.isra.7+0x12d
 > cdev_write() at netbsd:cdev_write+0x70
 > spec_write() at netbsd:spec_write+0xb2
 > VOP_WRITE() at netbsd:VOP_WRITE+0x37
 > vn_write() at netbsd:vn_write+0xec
 > dofilewrite() at netbsd:dofilewrite+0x97
 > sys_write() at netbsd:sys_write+0x5f
 > syscall() at netbsd:syscall+0x1d8
 > --- syscall (number 4) ---
 > 71835583dfda:
 > cpu0: End traceback...
 >
 >         There is OpenVPN/tap set up on the server, if this matters.  The CPU is AMD Athlon 64 X2.
 >
 >>How-To-Repeat:
 >         Don't know...
 >>Fix:
 >         None known... Maybe disabling second core would be a workaround.

 I fixed the issue in -current and requested a pullup to -8 branch.
 So 8.0_BETA will soon fix the issue. If you want the fix right now,
 please apply r1.135 of src/sys/net/if_bridge.c to your kernel by hand.

 Thank you for the report,
   ozaki-r

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52587 CVS commit: [netbsd-8] src/sys/net
Date: Mon, 2 Oct 2017 13:33:41 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Mon Oct  2 13:33:41 UTC 2017

 Modified Files:
 	src/sys/net [netbsd-8]: if_bridge.c

 Log Message:
 Pull up following revision(s) (requested by ozaki-r in ticket #297):
 	sys/net/if_bridge.c: revision 1.135
 Add curlwp_bind to bridge_input for psref
 It can be called in a thread context via tap (tap_dev_write).
 Fix PR kern/52587


 To generate a diff of this commit:
 cvs rdiff -u -r1.134 -r1.134.6.1 src/sys/net/if_bridge.c

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

State-Changed-From-To: pending-pullups->feedback
State-Changed-By: ozaki-r@NetBSD.org
State-Changed-When: Mon, 20 Nov 2017 03:11:49 +0000
State-Changed-Why:
8.0_BETA merged the fix one month ago. Please let us know if the panic still
happens with latest 8.0_BETA.


From: Dominik Bialy <dmb@yenn.ulegend.net>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org, netbsd-bugs@netbsd.org,
	gnats-admin@netbsd.org, ozaki-r@NetBSD.org, dmb@yenn.ulegend.net
Subject: Re: kern/52587 (NetBSD 8 panic after a few days of uptime)
Date: Mon, 20 Nov 2017 06:29:55 +0100

 On Mon, Nov 20, 2017 at 03:11:50AM +0000, ozaki-r@NetBSD.org wrote:
 > Synopsis: NetBSD 8 panic after a few days of uptime
 > 
 > State-Changed-From-To: pending-pullups->feedback
 > State-Changed-By: ozaki-r@NetBSD.org
 > State-Changed-When: Mon, 20 Nov 2017 03:11:49 +0000
 > State-Changed-Why:
 > 8.0_BETA merged the fix one month ago. Please let us know if the panic still
 > happens with latest 8.0_BETA.
 > 
 > 
 > 
 Sorry, I forgot about this PR.

 It doesn't happen anymore in this codepath, so yes,
 I can confirm this one is fixed.

 Thanks
 	Dominik

State-Changed-From-To: feedback->closed
State-Changed-By: ozaki-r@NetBSD.org
State-Changed-When: Mon, 20 Nov 2017 05:59:27 +0000
State-Changed-Why:
The reporter confirmed the fix. Thanks!


>Unformatted:
 		Sources from Sep 15, custom kernel, but only altq added, options GATEWAY, and
 		bridge_ipf set

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.