NetBSD Problem Report #39940

From yamt@mwd.biglobe.ne.jp  Mon Nov 17 06:58:56 2008
Return-Path: <yamt@mwd.biglobe.ne.jp>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 003A063B874
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 17 Nov 2008 06:58:55 +0000 (UTC)
Message-Id: <20081117065851.6E8A911704@yamt.dyndns.org>
Date: Mon, 17 Nov 2008 15:58:51 +0900 (JST)
From: yamt@mwd.biglobe.ne.jp
Reply-To: yamt@mwd.biglobe.ne.jp
To: gnats-bugs@gnats.NetBSD.org
Subject: agr locking error
X-Send-Pr-Version: 3.95

>Number:         39940
>Category:       kern
>Synopsis:       agr locking error
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    dyoung
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 17 07:00:00 +0000 2008
>Closed-Date:    Fri Oct 15 04:42:32 +0000 2010
>Last-Modified:  Fri Oct 15 04:42:32 +0000 2010
>Originator:     YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
>Release:        NetBSD 5.99.02
>Organization:

>Environment:
>Description:
	see below.
	while agr_ioctl is not expected to be called recursively,
	it has been changed to call ifioctl_common, which seems to call
	if_ioctl handler recursively.

IPv6 mode: host
Configuring network interfaces: wm0nfs server 172.17.80.51:/nfsroot: not responding
nfs server 172.17.80.51:/nfsroot: is alive again
 agr0ifconfig: SIOCSEMutex error: lockdebug_wantlock: locking against myself

lock address : 0x00000000c4f05c00 type     :     sleep/adaptive
initialized  : 0x00000000c01d3136
shared holds :                  0 exclusive:                  1
shares wanted:                  0 exclusive:                  1
current cpu  :                  0 last held:                  0
current lwp  : 0x00000000d7db5ca0 last held: 0x00000000d7db5ca0
last locked  : 0x00000000c01d35c5 unlocked : 0x00000000c01d364f
owner field  : 0x00000000d7db5ca0 wait/spin:                0/0

Turnstile chain at 0xc05c2240.
=> No active turnstile for this lock.

panic: LOCKDEBUG
fatal breakpoint trap in supervisor mode
trap type 1 code 0 eip c015575c cs 8 eflags 246 cr2 bb90a010 ilevel 6
Stopped in pid 71.1 (ifconfig) at       netbsd:breakpoint+0x4:  popl    %ebp
breakpoint(c054b12a,d7d9f648,c056c680,c03c8ddf,6,1,0,0,d7d9f648,8) at netbsd:bre
akpoint+0x4
panic(c054b12c,c051c16e,c04f3963,c051c13d,c01d35c5,1db5ca0,6,c0446984,0,c4f05c00
) at netbsd:panic+0x1bc
lockdebug_abort1(c051c13d,1,0,0,0,d7db5ca0,6,6,c4d9e800,c05b082c) at netbsd:lock
debug_abort1+0xbb
mutex_enter(c4f05c00,c05c08c0,c05c07a0,c02661e2,c05c07a2,c0263d87,c4f05c00,c4d9e
701,c4d9e800,c05c08c0) at netbsd:mutex_enter+0x464
agr_ioctl(c4f05c48,c0446984,c4d9e800,c0263cfc,0,d7db5ca0,6,6,c4d9cb30,c05b082c) a
t netbsd:agr_ioctl+0x25
in6_update_ifa(c4f05c48,d7d9f8f0,c4d9e800,1,d7db5ca0,d7d07268,18,c0270cd6,d7d072
68,18) at netbsd:in6_update_ifa+0x6a9
in6_ifattach(c4f05c48,0,d7d9fa5c,c01d0a0a,6,d72b8e88,d7d9fa7c,c01d235c,c4f05c48,
0) at netbsd:in6_ifattach+0x205
in6_if_up(c4f05c48,0,d7d9fa8c,80906910,0,80906910,d7d9fafc,c01d3680,c4f05c48,809
06910) at netbsd:in6_if_up+0x5e
ifioctl_common(c4f05c48,80906910,d72b8e88,c024dbe1,d4f66f00,4,c4f05c00,14,c4f05c
48,80906910) at netbsd:ifioctl_common+0x41c
agr_ioctl(c4f05c48,80906910,d72b8e88,c4f05c48,80906910,0,0,c4f05c48,d72b8e88,0) a
t netbsd:agr_ioctl+0xe0
ifioctl(c4cb6b40,80906910,d72b8e88,d7db5ca0,d7fcfdcc,d7d12d5c,1,d7d12d40,90,8090
6910) at netbsd:ifioctl+0x21e
soo_ioctl(d7d12d40,80906910,d72b8e88,c026626a,8,c0251fbb,0,d7d11b80,8090,3) at n
etbsd:soo_ioctl+0x241
sys_ioctl(d7db5ca0,d7d9fd00,d7d9fd28,bb90a010,bb90a000,d7d01c30,2,3,80906910,bfb
fe9f8) at netbsd:sys_ioctl+0x11f
syscall(d7d9fd48,b3,ab,1f,1f,1,bfbfe9f8,bfbfea98,bb903b00,5) at netbsd:syscall+0
xc8
ds          0x10
es          0x10
fs          0x30
gs          0x10
edi         0xc04f3963  __func__.7123
esi         0xc054b12c  copyright+0x4d46c
ebp         0xd7d9f5fc
ebx         0x100
edx         0x8
ecx         0x6
eax         0x1
eip         0xc015575c  breakpoint+0x4
cs          0x8
eflags      0x246
esp         0xd7d9f5fc
ss          0x10
netbsd:breakpoint+0x4:  popl    %ebp
db{0}>

>How-To-Repeat:

>Fix:


>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->dyoung
Responsible-Changed-By: dyoung@NetBSD.org
Responsible-Changed-When: Wed, 10 Jun 2009 17:06:55 +0000
Responsible-Changed-Why:
Looks like I broke it.  Let me see if I can fix it.


State-Changed-From-To: open->feedback
State-Changed-By: dyoung@NetBSD.org
State-Changed-When: Thu, 13 Aug 2009 00:36:26 +0000
State-Changed-Why:
Should be fixed in -current.


From: David Young <dyoung@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/39940 CVS commit: src/sys/net/agr
Date: Mon, 8 Feb 2010 17:59:06 +0000

 Module Name:	src
 Committed By:	dyoung
 Date:		Mon Feb  8 17:59:06 UTC 2010

 Modified Files:
 	src/sys/net/agr: if_agr.c if_agrtimer.c if_agrvar_impl.h

 Log Message:
 Take another stab at fixing the LOCKDEBUG panic reported in PR
 kern/39940 and by Martti Kuparinen on current-users@:  replace the
 ioctl lock with finer-grained locking.  Lock the ports list and
 wait to if_clone_destroy() until all threads are out of the softc.

 Thanks to Martti Kuparinen for testing these changes.


 To generate a diff of this commit:
 cvs rdiff -u -r1.25 -r1.26 src/sys/net/agr/if_agr.c
 cvs rdiff -u -r1.5 -r1.6 src/sys/net/agr/if_agrtimer.c
 cvs rdiff -u -r1.8 -r1.9 src/sys/net/agr/if_agrvar_impl.h

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

State-Changed-From-To: feedback->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Fri, 15 Oct 2010 04:42:32 +0000
State-Changed-Why:
feedback timeout.


>Unformatted:

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.