NetBSD Problem Report #52709

From gson@gson.org  Thu Nov  9 15:34:33 2017
Return-Path: <gson@gson.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 BB97F7A1C6
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  9 Nov 2017 15:34:33 +0000 (UTC)
Message-Id: <20171109153424.08564989E67@guava.gson.org>
Date: Thu,  9 Nov 2017 17:34:24 +0200 (EET)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@NetBSD.org
Subject: Panic in filt_genfsread building lang/go package
X-Send-Pr-Version: 3.95

>Number:         52709
>Category:       kern
>Synopsis:       Panic in filt_genfsread building lang/go package
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 09 15:35:00 +0000 2017
>Closed-Date:    Tue Jan 09 16:51:23 +0000 2018
>Last-Modified:  Tue Jan 09 16:51:23 +0000 2018
>Originator:     Andreas Gustafsson
>Release:        NetBSD 7.1 kernel, 7.0 userland
>Organization:

>Environment:
System: NetBSD
Architecture: x86_64
Machine: amd64
>Description:

I am trying to update pkgsrc on a NetBSD 7.0/amd64 system by running
"pkg_rolling-replace -v -u -k", but every time it reaches lang/go
pacakge (go-1.9.2), the kernel panics.  I upgraded the kernel to 7.1,
but that didn't help.

guido /var/crash # gdb /netbsd
(gdb) target kvm netbsd.2.core
0xffffffff806417b5 in cpu_reboot (howto=howto@entry=260, bootstr=bootstr@entry=0x0) at /bracket/prod/7.1/src/sys/arch/amd64/amd64/machdep.c:671
671                     dumpsys();
(gdb) where
#0  0xffffffff806417b5 in cpu_reboot (howto=howto@entry=260, bootstr=bootstr@entry=0x0) at /bracket/prod/7.1/src/sys/arch/amd64/amd64/machdep.c:671
#1  0xffffffff80869bf2 in vpanic (fmt=fmt@entry=0xffffffff80d1be42 "trap", ap=ap@entry=0xfffffe8158f0e9e0) at /bracket/prod/7.1/src/sys/kern/subr_prf.c:340
#2  0xffffffff80869cad in panic (fmt=fmt@entry=0xffffffff80d1be42 "trap") at /bracket/prod/7.1/src/sys/kern/subr_prf.c:256
#3  0xffffffff808acf86 in trap (frame=0xfffffe8158f0eb00) at /bracket/prod/7.1/src/sys/arch/amd64/amd64/trap.c:298
#4  0xffffffff80100f46 in alltraps ()
#5  0xffffffff805d1bcd in mutex_oncpu (owner=owner@entry=18446744073709551600) at /bracket/prod/7.1/src/sys/kern/kern_mutex.c:395
#6  0xffffffff805d1cea in mutex_oncpu (owner=18446744073709551600) at /bracket/prod/7.1/src/sys/kern/kern_mutex.c:518
#7  mutex_vector_enter (mtx=0xfffffe8bafbf73c0) at /bracket/prod/7.1/src/sys/kern/kern_mutex.c:527
#8  0xffffffff80360901 in filt_genfsread (kn=0xfffffe8bc2644f00, hint=<optimized out>) at /bracket/prod/7.1/src/sys/miscfs/genfs/genfs_vnops.c:538
#9  0xffffffff805c34f8 in kqueue_scan (kevcnt=8, keops=0xffffffff80be3720 <kevent_native_ops>, keops=0xffffffff80be3720 <kevent_native_ops>, kevbuf=0xfffffe8158f0ed18, retval=0xfffffe8158f0eeb8, tsp=0x0, ulistp=0xc420293438, maxevents=64, 
    fp=<optimized out>) at /bracket/prod/7.1/src/sys/kern/kern_event.c:1233
#10 kevent1 (retval=0xfffffe8158f0eeb8, fd=4, changelist=<optimized out>, nchanges=<optimized out>, eventlist=0xc420293438, nevents=64, timeout=0x0, keops=keops@entry=0xffffffff80be3720 <kevent_native_ops>)
    at /bracket/prod/7.1/src/sys/kern/kern_event.c:896
#11 0xffffffff805c3670 in sys___kevent50 (l=<optimized out>, uap=<optimized out>, retval=<optimized out>) at /bracket/prod/7.1/src/sys/kern/kern_event.c:817
#12 0xffffffff80884c2a in sy_call (rval=0xfffffe8158f0eeb8, uap=0xfffffe8158f0ef00, l=0xfffffe8bbaac51a0, sy=0xffffffff810093b0 <sysent+6960>) at /bracket/prod/7.1/src/sys/sys/syscallvar.h:61
#13 sy_invoke (code=435, rval=0xfffffe8158f0eeb8, uap=0xfffffe8158f0ef00, l=0xfffffe8bbaac51a0, sy=0xffffffff810093b0 <sysent+6960>) at /bracket/prod/7.1/src/sys/sys/syscallvar.h:85
#14 syscall (frame=0xfffffe8158f0ef00) at /bracket/prod/7.1/src/sys/arch/x86/x86/syscall.c:156
#15 0xffffffff80100691 in Xsyscall ()
(gdb) frame 5
#5  0xffffffff805d1bcd in mutex_oncpu (owner=owner@entry=18446744073709551600) at /bracket/prod/7.1/src/sys/kern/kern_mutex.c:395
395             l = (lwp_t *)MUTEX_OWNER(owner);
(gdb) print /x owner
$2 = 0xfffffffffffffff0
538                     mutex_enter(vp->v_interlock);
(gdb) frame 8
#8  0xffffffff80360901 in filt_genfsread (kn=0xfffffe8bc2644f00, hint=<optimized out>) at /bracket/prod/7.1/src/sys/miscfs/genfs/genfs_vnops.c:538
(gdb) print *vp
$4 = {v_uobj = {vmobjlock = 0xfffffe8bafbf73c0, pgops = 0xffffffff80c67620 <uvm_vnodeops>, memq = {tqh_first = 0x0, tqh_last = 0xfffffe8bdaa3e5e0}, uo_npages = 0, uo_refs = 0, rb_tree = {rbt_root = 0x0, rbt_ops = 0xffffffff80c67500 <uvm_page_tree_ops>, 
      rbt_minmax = {0x0, 0x0}}, uo_ubc = {lh_first = 0x0}}, v_cv = {cv_opaque = {0x0, 0xfffffe8bdaa3e620, 0xffffffff80d078da}}, v_size = 0, v_writesize = 0, v_iflag = 1572864, v_vflag = 48, v_uflag = 0, v_numoutput = 0, v_writecount = 0, v_holdcnt = 0, 
  v_synclist_slot = 0, v_mount = 0x0, v_op = 0xfffffe8c166d6e00, v_freelist = {tqe_next = 0xfffffe815870b260, tqe_prev = 0xfffffe8bc8e0b700}, v_freelisthd = 0x0, v_mntvnodes = {tqe_next = 0x0, tqe_prev = 0xfffffe8158071310}, v_cleanblkhd = {
    lh_first = 0x0}, v_dirtyblkhd = {lh_first = 0x0}, v_synclist = {tqe_next = 0x0, tqe_prev = 0x0}, v_dnclist = {lh_first = 0x0}, v_nclist = {lh_first = 0x0}, v_un = {vu_mountedhere = 0x0, vu_socket = 0x0, vu_specnode = 0x0, vu_fifoinfo = 0x0, 
    vu_ractx = 0x0}, v_type = VDIR, v_tag = VT_NON, v_lock = {rw_owner = 0}, v_data = 0x0, v_klist = {slh_first = 0x0}}
(gdb) print /x *vp->v_uobj.vmobjlock
$8 = {u = {mtxa_owner = 0xfffffffffffffff0}}

See also https://github.com/golang/go/issues/20836 and PR 44402.

>How-To-Repeat:

Perhaps try to build lang/go from pkgsrc on a NetBSD 7/amd64 system?

>Fix:

>Release-Note:

>Audit-Trail:
From: coypu@sdf.org
To: gnats-bugs@NetBSD.org
Cc: gson@gson.org
Subject: Re: kern/52709: Panic in filt_genfsread building lang/go package
Date: Thu, 9 Nov 2017 21:31:56 +0000

 pullup-7 #1442? it is newer than 7.1. please try a newer kernel in the
 same branch.

From: Andreas Gustafsson <gson@gson.org>
To: coypu@sdf.org
Cc: gnats-bugs@NetBSD.org
Subject: Re: kern/52709: Panic in filt_genfsread building lang/go package
Date: Fri, 10 Nov 2017 13:27:00 +0200

 coypu@sdf.org wrote:
 > pullup-7 #1442? it is newer than 7.1. please try a newer kernel in the
 > same branch.

 With a kernel built from the -7 branch, the pkgsrc build succeeded.
 Thanks for the hint.

 It seems to me this bug is likely to affect a lot of people and would
 be cause for a 7.1.1 release.
 -- 
 Andreas Gustafsson, gson@gson.org

From: Soren Jacobsen <snj@blef.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/52709: Panic in filt_genfsread building lang/go package
Date: Sat, 11 Nov 2017 00:48:27 -0800

 On 11/10 11:30, Andreas Gustafsson wrote:
 >  
 >  It seems to me this bug is likely to affect a lot of people and would
 >  be cause for a 7.1.1 release.

 Coming soon.

 Soren

State-Changed-From-To: open->closed
State-Changed-By: gson@NetBSD.org
State-Changed-When: Tue, 09 Jan 2018 16:51:23 +0000
State-Changed-Why:
7.1.1 is out and has the fix.


>Unformatted:

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.