From rapiere@renaissance.homeip.net  Sat May  8 04:12:50 2004
Return-Path: <rapiere@renaissance.homeip.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8F6F016A4CF
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  8 May 2004 04:12:50 -0700 (PDT)
Received: from renaissance.homeip.net (m73.net81-65-152.noos.fr [81.65.152.73])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4E46A43D1F
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  8 May 2004 04:12:49 -0700 (PDT)
	(envelope-from rapiere@renaissance.homeip.net)
Received: from renaissance.homeip.net (none@localhost [127.0.0.1])
	by renaissance.homeip.net (8.12.11/8.12.11) with ESMTP id i48BCluY001149
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 8 May 2004 13:12:47 +0200 (CEST)
	(envelope-from rapiere@renaissance.homeip.net)
Received: (from rapiere@localhost)
	by renaissance.homeip.net (8.12.11/8.12.11/Submit) id i48BClIv001148;
	Sat, 8 May 2004 13:12:47 +0200 (CEST)
	(envelope-from rapiere)
Message-Id: <200405081112.i48BClIv001148@renaissance.homeip.net>
Date: Sat, 8 May 2004 13:12:47 +0200 (CEST)
From: anthony.ginepro@laposte.net
Reply-To: anthony.ginepro@laposte.net
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Panic: mutex "tunmtx" 0xc0792dc0 already initialized
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         66382
>Category:       kern
>Synopsis:       panic: mutex "tunmtx" 0xc0792dc0 already initialized
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    brooks
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 08 04:20:25 PDT 2004
>Closed-Date:    Sat Jul 24 06:39:59 GMT 2004
>Last-Modified:  Sat Jul 24 06:39:59 GMT 2004
>Originator:     Anthony Ginepro <anthony.ginepro@laposte.net>
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
>Environment:
System: FreeBSD renaissance.homeip.net 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Sat May 8 12:42:44 CEST 2004 rapiere@renaissance.homeip.net:/usr/obj/usr/src/sys/RENAISSANCE i386


>Description:
	Kernel panics when loading if_tun module but was already compiled statically.
	
	(kgdb) bt
	#0  doadump () at /usr/src/sys/kern/kern_shutdown.c:236
	#1  0xc0524b1c in boot (howto=256) at /usr/src/sys/kern/kern_shutdown.c:370
	#2  0xc0524ecc in poweroff_wait (junk=0xc06fccb0, howto=819)
	    at /usr/src/sys/kern/kern_shutdown.c:548
	#3  0xc051bbe6 in mtx_init (m=0xc0792dc0, name=---Can't read userspace from dump, or kernel process---

	)
	    at /usr/src/sys/kern/kern_mutex.c:818
	#4  0xc0599dce in tunmodevent (mod=0xc21e0800, type=0, data=0x0)
	    at /usr/src/sys/net/if_tun.c:187
	#5  0xc051a9b2 in module_register_init (arg=0xc651310c)
	    at /usr/src/sys/kern/kern_module.c:108
	#6  0xc05155a5 in linker_file_sysinit (lf=0x0)
	    at /usr/src/sys/kern/kern_linker.c:192
	#7  0xc05158af in linker_load_file (filename=0xc627b160 "/boot/kernel/if_tun.ko", 
	    result=0xe0b6eca8) at /usr/src/sys/kern/kern_linker.c:357
	#8  0xc0517d2f in linker_load_module (kldname=0xc073aec0 "Fo`s", 
	    modname=0xc627b160 "/boot/kernel/if_tun.ko", parent=0x0, verinfo=0x0, 
	    lfpp=0xe0b6ecd4) at /usr/src/sys/kern/kern_linker.c:1672
	#9  0xc05162b1 in kldload (td=0xc6155dc0, uap=0x0)
	    at /usr/src/sys/kern/kern_linker.c:775
	#10 0xc06b7b21 in syscall (frame=
	      {tf_fs = 47, tf_es = 47, tf_ds = 47, tf_edi = 0, tf_esi = -1077940672, tf_ebp = -1077940716, tf_isp = -524882572, tf_ebx = 0, tf_edx = -1, tf_ecx = -1077940504, tf_eax = 304, tf_trapno = 12, tf_err = 2, tf_eip = 671890847, tf_cs = 31, tf_eflags = 531, tf_esp = -1077940772, tf_ss = 47}) at /usr/src/sys/i386/i386/trap.c:1004
	#11 0x280c3d9f in ?? ()


>How-To-Repeat:
	having "device tun" in kernel configuration (GENERIC).
	and using command : 'kldload if_tun'
>Fix:



>Release-Note:
>Audit-Trail:

From: "Simon L. Nielsen" <simon@FreeBSD.org>
To: anthony.ginepro@laposte.net
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: kern/66382: Panic: mutex "tunmtx" 0xc0792dc0 already initialized
Date: Sun, 9 May 2004 22:05:13 +0200

 --raC6veAxrt5nqIoY
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 On 2004.05.08 13:12:47 +0200, anthony.ginepro@laposte.net wrote:
 
 > 	Kernel panics when loading if_tun module but was already compiled static=
 ally.
 
 I think the current solution is: Don't do that :-).
 
 I remember seeing somewhere that there is a general problem with loading
 a modules when the same code is compiled into the kernel, and that it is
 being worked on.
 
 I'm not sure if this PR is the general problem, so I won't close the PR,
 but I wouldn't hold my breath for a fix.
 
 --=20
 Simon L. Nielsen
 FreeBSD Documentation Team
 
 --raC6veAxrt5nqIoY
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.4 (FreeBSD)
 
 iD8DBQFAno75h9pcDSc1mlERApWxAKCMXTmasuWxoQn/fWpVuGfxxNRi/wCfdi44
 nsMuQqIpe1bHwvTY7uxLFwI=
 =Uapx
 -----END PGP SIGNATURE-----
 
 --raC6veAxrt5nqIoY--
State-Changed-From-To: open->feedback 
State-Changed-By: brooks 
State-Changed-When: Fri Jul 23 17:48:45 GMT 2004 
State-Changed-Why:  
I can't replicate this on my -current laptop.  Tun is compiled in and I 
just get errors when I try to load it.  Can you verify the status of this 
problem? 

-- Brooks 


Responsible-Changed-From-To: freebsd-bugs->brooks 
Responsible-Changed-By: brooks 
Responsible-Changed-When: Fri Jul 23 17:48:45 GMT 2004 
Responsible-Changed-Why:  
Take this PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=66382 
State-Changed-From-To: feedback->closed 
State-Changed-By: brooks 
State-Changed-When: Sat Jul 24 06:38:11 GMT 2004 
State-Changed-Why:  
Per out of band discussion with submitter, close this PR since the panic 
no longer occurs.  The more generic kernel linker bug is documented 
in kern/69502. 

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