NetBSD Problem Report #38241

From martin@duskware.de  Fri Mar 14 22:53:30 2008
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id C216263B8E3
	for <gnats-bugs@gnats.netbsd.org>; Fri, 14 Mar 2008 22:53:30 +0000 (UTC)
Message-Id: <20080314225125.2093763B8E3@narn.NetBSD.org>
Date: Fri, 14 Mar 2008 22:51:25 +0000 (UTC)
From: ad@netbsd.org
Reply-To: ad@netbsd.org
To: netbsd-bugs-owner@NetBSD.org
Subject: boot -a ... kernel_lock spinout
X-Send-Pr-Version: www-1.0

>Number:         38241
>Category:       kern
>Synopsis:       boot -a ... kernel_lock spinout
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 14 22:55:00 +0000 2008
>Last-Modified:  Fri Aug 16 21:00:00 +0000 2013
>Originator:     Andrew Doran
>Release:        4.99.55
>Organization:
The NetBSD Project
>Environment:
n/a
>Description:
I've heard that boot -a can cause a kernel_lock spinout, probably due
to the boot CPU looping in/over cngetc().


>How-To-Repeat:
Unknown. boot -a? Maybe it only happens with !__HAVE_FAST_SOFTINTS.

>Fix:
Make kernel_lock unnecessary for system bootstrap.

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/38241: boot -a ... kernel_lock spinout
Date: Sat, 15 Mar 2008 00:21:06 +0100

 Here is some ddb output:

 root device (default sd0a): Kernel lock error: _kernel_lock: spinout

 lock address : 0x0000000001479780 type     :               spin
 shared holds :                  0 exclusive:                  1
 shares wanted:                  0 exclusive:                  1
 current cpu  :                  0 last held:                  1
 current lwp  : 0x000000000d04b420 last held: 0x0000000001410700
 last locked  : 0x000000000115801c unlocked : 0x0000000001212cc8
 initialized  : 0x000000000112d680                              
 curcpu holds :                  0 wanted by: 0x000000000d04b420

 panic: LOCKDEBUG
 Stopped in pid 0.5 (system) at  netbsd:cpu_Debugger+0x4:        nop
 db{0}> bt                                                          
 lockdebug_abort1(1491628, 1491628, 1272bd0, 12b8068, 1, 1479400) at netbsd:lockd
 ebug_abort1+0x7c                                                               
 lockdebug_abort(1479780, 140fc98, 1272bd0, 12b8068, 1479780, ffffffffffffffff) a
 t netbsd:lockdebug_abort+0x7c                                                  
 _kernel_lock(10000001, d04b420, 0, fffffff, 1479400, d04b420) at netbsd:_kernel_
 lock+0x158                                                                     
 callout_softclock(147dc00, d04b420, 1458940, 1456940, 1459800, 1000000) at netbs
 d:callout_softclock+0x2c4                                                      
 softint_thread(d68e0c0, d04b420, 0, 12b9c00, 12b9c00, 12b9800) at netbsd:softint
 _thread+0xd4                                                                   
 lwp_trampoline(f0067260, fff83cf8, 110000, 10ee98, fff83df8, 0) at netbsd:lwp_tr
 ampoline+0x8                                                                   
 db{0}> mach cpu 1
 db{1}> bt        
 cngetc(1, 5, 0, 0, 1805b98, 0) at netbsd:cngetc+0x1c
 cngetsn(0, 80, 1493f88, 1479ec8, 1410700, 0) at netbsd:cngetsn+0x1c
 setroot(41d5000, 0, 141e800, 141e800, 141e800, 1479000) at netbsd:setroot+0x114
 main(0, 112d660, 40000, fff83a90, fffffffff006e4d8, ff00000000) at netbsd:main+0
 x338                                                                           
 cpu_initialize(f0067260, fff83cf8, 110000, 10ee98, fff83df8, 0) at netbsd:cpu_in
 itialize+0x158                                                                 


 Martin

From: Patrick Welche <prlw1@cam.ac.uk>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/38241
Date: Fri, 16 Aug 2013 21:57:56 +0100

 It seems that

   http://mail-index.netbsd.org/current-users/2013/08/10/msg023133.html

 is a recent manifestation of this bug, however I don't need the "-a",
 a plain "boot" on a box with 2 raid mirrors which both think they
 are root does it. Unfortunately kgdb seems to be broken, so it
 is hard to add to this PR...

 db{0}> mach cpu 2
 using CPU 2
 db{0}> bt
 bus_space_read_1() at netbsd:bus_space_read_1+0xf
 cngetsn() at netbsd:cngetsn+0x3e
 setroot() at netbsd:setroot+0x183
 rootconf() at netbsd:rootconf+0xff
 cpu_rootconf() at netbsd:cpu_rootconf+0x4e
 rf_buildroothack() at netbsd:rf_buildroothack+0x28f
 rf_autoconfig() at netbsd:rf_autoconfig+0x45
 config_finalize() at netbsd:config_finalize+0x8e
 main() at netbsd:main+0x424

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-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.