From nobody@FreeBSD.org  Thu Jun  7 15:25:47 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 9E0CA16A400
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  7 Jun 2007 15:25:47 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 77A8613C44B
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  7 Jun 2007 15:25:47 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l57FPlHw094449
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 7 Jun 2007 15:25:47 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l57FPlOs094448;
	Thu, 7 Jun 2007 15:25:47 GMT
	(envelope-from nobody)
Message-Id: <200706071525.l57FPlOs094448@www.freebsd.org>
Date: Thu, 7 Jun 2007 15:25:47 GMT
From: Kena<kena@vodka-pomme.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Deadlock 
X-Send-Pr-Version: www-3.0

>Number:         113457
>Category:       kern
>Synopsis:       [ipv6] [lor] deadlock occurs if a tunnel goes down while there are tcp6 connections opened
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-net
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 07 15:30:02 GMT 2007
>Closed-Date:    Tue Feb 26 10:32:35 UTC 2008
>Last-Modified:  Sun Feb 15 19:04:26 UTC 2009
>Originator:     Kena
>Release:        7.0-CURRENT
>Organization:
>Environment:
FreeBSD fungus.kahlua 7.0-CURRENT FreeBSD 7.0-CURRENT #3: Fri Jun  1 10:49:34 CEST 2007     root@fungus.kahlua:/usr/obj/usr/src/sys/FUNGUS  i386
>Description:
Using a tunnel to access ipv6 (gw6c from www.go6.net): a deadlock occurs
if the tunnel goes down while there are tcp6 connections opened.

Sample panic report on this system:

em0: watchdog timeout -- resetting
Jun 7 10:17:21 fungus gw6c: Connection timeout occured.
Jun 7 10:17:21 fungus gw6c: Disconnected. Retrying in 30 seconds.
em0: watchdog timeout -- resetting
lock order reversal:
 1st 0xc30630d8 rtentry (rtentry) @ /usr/src/sys/netinet6/nd6.c:1963
 2nd 0xc2ed977c radix node head (radix node head) @ /usr/src/sys/net/route.c:147

KDB: stack backtrace
db_trace_self_wrapper(....) at db_trace_self_wrapper+0x26
kdb_backtrace(...) at kbd_backtrace+0x29
witness_checkorder(...) at witness_checkorder+0x6b7
_mtx_lock_flags(...) at _mtx_lock_flags+0xb0
rtalloc1(...) at rtalloc1+0x60
nd6_lookup(...) at nd6_loockup+0x55
nd6_is_addr_neighbor(...) at nd6_is_addr_neighbor+0x37
nd6_output(...) at nd6_output+0x10d
ip6_output(...) at ip6_output+0x108a
tcp_output(...) at tcp_output+0x12b3
tcp_timer(...) at tcp_timer+0x2ad
softclock(...) at softclock+0x293
ithread_loop(...) at ithread_loop+0x1a8
fork_exit(...) at fork_exit+0xed
fork_trampoline() at fork_trampoline+0x8
--- trap 0, eip = 0, esp = 0xd3c81d70, ebp = 0 ---
panic: _mtx_lock_sleep: recursed on non-recursive mutex rtentry @ /usr/src/sys/net/route.c:197

cpuid = 0
KBD: enter: panic
[thread pid 11 tid 100004 ]
Stopped at   kbd_enter+0x32: leave
db>


Configuration for kernel "FUNGUS" is GENERIC from 7.0-CURRENT with cpu I486_CPU and  I586_CPU disabled.




>How-To-Repeat:
1. set up a ip6 link with gw6c (from www.go6.net), "router" mode

2. open a tcp6 connection (for example irssi -c ipv6.chat.freenode.net)

3. break the network link (pull ethernet cable)

4. wait for gw6c to timeout

A few seconds after gw6c reports the disconnect on the console the panic occurs.

Crash 100% reproducible.
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Jun 7 23:44:46 UTC 2007 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=113457 

From: Kena <kena@vodka-pomme.net>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/113457: [ipv6] deadlock occurs if a tunnel goes down while there are tcp6 connections opened
Date: Sat, 9 Jun 2007 11:15:21 +0200

 Issue does not reproduce after upgrading kernel source. - can close  
 this PR.
 
 -- 
 Kena
State-Changed-From-To: open->closed 
State-Changed-By: maxim 
State-Changed-When: Sun Jun 10 10:04:13 UTC 2007 
State-Changed-Why:  
The submitter reports he can't reproduce the problem any more. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=113457 
State-Changed-From-To: closed->open 
State-Changed-By: cognet 
State-Changed-When: Sun Jun 10 14:08:04 UTC 2007 
State-Changed-Why:  
The problem still happens after all. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=113457 
State-Changed-From-To: open->closed 
State-Changed-By: gavin 
State-Changed-When: Tue Feb 26 10:31:57 UTC 2008 
State-Changed-Why:  
Close, kern/116172 is a duplicate of this PR, but has much more 
information. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=113457 
>Unformatted:
