From nobody@FreeBSD.org  Tue Aug 31 14:48:41 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id B533D16A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 31 Aug 2004 14:48:41 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id AB03543D1D
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 31 Aug 2004 14:48:41 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i7VEmfe1054598
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 31 Aug 2004 14:48:41 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i7VEmfCU054597;
	Tue, 31 Aug 2004 14:48:41 GMT
	(envelope-from nobody)
Message-Id: <200408311448.i7VEmfCU054597@www.freebsd.org>
Date: Tue, 31 Aug 2004 14:48:41 GMT
From: bettan <bettan@nerim.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: bug in altq when i reboot
X-Send-Pr-Version: www-2.3

>Number:         71195
>Category:       i386
>Synopsis:       bug in altq when i reboot
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    mlaier
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 31 14:50:18 GMT 2004
>Closed-Date:    Wed Sep 01 19:57:23 GMT 2004
>Last-Modified:  Wed Sep 01 19:57:23 GMT 2004
>Originator:     bettan
>Release:        FreeBSD 5.3-beta2
>Organization:
>Environment:
FreeBSD linux-win.com 5.3-BETA2 FreeBSD 5.3-BETA2 #0: Mon Aug 30 15:30:15 CEST 2004     root@linux-win.com:/usr/obj/usr/src/sys/FREEBSD  i386

>Description:
Altq works good in my freebsd 5.3-beta2 but when i reboot my kernel crashs and he says there is an error in altq_cbq.c.This error is :

panic mutex tun0 not owned at /usr/src/sys/contrib/altq/altq/altq_cbq.c:202
cpuid=0;
DDB: enter: panic
[thread 100059]
Stopped  at kdb_enter+0x2b: nop
 
db> trace
panic (c0847cbd,c159f820,c08132e1cac25e7800) at panic+0x131
_mtx_assert (c1c9f8fc,1,c081,32e1,ca) at _mtx_assert +0x5c
cbq_request (c15c9f8e8,1,0) at cbq_request+0x1f
if_qflush (c1c9f8e8,80206910,d9496c60,0,d9496ba0) at if_qflush+0x16
if_unroute (c1c9f814,1,0,d9496be4,c0690919) at if_unroute+0x69
if_down (c1c9f814) at if_down+0xf
ifhwioctl (80206910,c1c9f814,d9496c60c1abb580,c1ca4828) at ifhwioctl+0x281
ifioctl (c1cac510,80206910,d9496c60,c1abb580,0) at ifioctl+0xc3
s00ioctl (c1c3f000,80206910,d9496c60,c1c41580,c1abb580) at soo_ioctl+0x2b1
ioctl (c1abb580,d9496d14,3,2f4a,292) at ioctl+0x3e0
syscall (480a002f,2f,bfbf,002f,bfbfe9e0,80206910) at syscall+0x217
Xint0x80_syscall () at Xint0x80_syscall+0x1f
--- syscall (54, FreeBSD ELF32, ioctl), eip = 0x2825f247 , esp = 0xbfbfe97c , ebbp = 0xb



>How-To-Repeat:
      
>Fix:
      
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-i386->mlaier 
Responsible-Changed-By: mlaier 
Responsible-Changed-When: Tue Aug 31 23:32:46 GMT 2004 
Responsible-Changed-Why:  
ALTQ -> take over. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71195 
State-Changed-From-To: open->feedback 
State-Changed-By: mlaier 
State-Changed-When: Wed Sep 1 00:57:34 GMT 2004 
State-Changed-Why:  
Patch at: http://people.freebsd.org/~mlaier/altq_qflush.patch 

Please test! 

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

From: Max Laier <max@love2party.net>
To: freebsd-gnats-submit@FreeBSD.org, bettan@nerim.net
Cc:  
Subject: Re: i386/71195: bug in altq when i reboot
Date: Wed, 1 Sep 2004 02:55:35 +0200

 --Boundary-00=_I4RNBSSLAjy8uTD
 Content-Type: text/plain;
   charset="us-ascii"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 Please test the attached patch, also available at:
  http://people.freebsd.org/~mlaier/altq_qflush.patch
 
 This is untested yet so please report whether it works or not. It does compile 
 cleanly and the callpaths are rather obvious here I don't think there will be 
 issues. Just can't get to my console right now.
 
 -- 
     Max
 
 --Boundary-00=_I4RNBSSLAjy8uTD
 Content-Type: text/x-diff;
   charset="us-ascii";
   name="altq_qflush.patch"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment;
 	filename="altq_qflush.patch"
 
 Index: if.c
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /usr/store/mlaier/fcvs/src/sys/net/if.c,v
 retrieving revision 1.201
 diff -u -r1.201 if.c
 =2D-- if.c	30 Aug 2004 06:29:26 -0000	1.201
 +++ if.c	31 Aug 2004 23:38:36 -0000
 @@ -985,6 +985,7 @@
  {
  	struct mbuf *m, *n;
 =20
 +	IFQ_LOCK(ifq);
  #ifdef ALTQ
  	if (ALTQ_IS_ENABLED(ifq))
  		ALTQ_PURGE(ifq);
 @@ -997,6 +998,7 @@
  	ifq->ifq_head =3D 0;
  	ifq->ifq_tail =3D 0;
  	ifq->ifq_len =3D 0;
 +	IFQ_UNLOCK(ifq);
  }
 =20
  /*
 
 --Boundary-00=_I4RNBSSLAjy8uTD--

From: "bettan" <bettan@nerim.net>
To: <freebsd-gnats-submit@FreeBSD.org>, <bettan@nerim.net>
Cc:  
Subject: Re: i386/71195: bug in altq when i reboot
Date: Wed, 1 Sep 2004 21:48:50 +0200

 This is a multi-part message in MIME format.
 
 ------=_NextPart_000_0012_01C4906D.779F7370
 Content-Type: text/plain;
 	charset="iso-8859-1"
 Content-Transfer-Encoding: quoted-printable
 
 I have tested this patch and it works good.I reboot without problems =
 when altq is actived now.
 ------=_NextPart_000_0012_01C4906D.779F7370
 Content-Type: text/html;
 	charset="iso-8859-1"
 Content-Transfer-Encoding: quoted-printable
 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <HTML><HEAD>
 <META http-equiv=3DContent-Type content=3D"text/html; =
 charset=3Diso-8859-1">
 <META content=3D"MSHTML 6.00.2800.1458" name=3DGENERATOR>
 <STYLE></STYLE>
 </HEAD>
 <BODY bgColor=3D#ffffff>
 <DIV><FONT face=3DArial size=3D2>I have tested this patch and it works =
 good.I reboot=20
 without problems when altq is actived now.</FONT></DIV></BODY></HTML>
 
 ------=_NextPart_000_0012_01C4906D.779F7370--
 
State-Changed-From-To: feedback->closed 
State-Changed-By: mlaier 
State-Changed-When: Wed Sep 1 19:56:57 GMT 2004 
State-Changed-Why:  
Patch committed. Thanks. 

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