From owner-freebsd-current@FreeBSD.ORG Wed Feb 4 00:26:37 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0D5C116A4CE for ; Wed, 4 Feb 2004 00:26:37 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id C8A0F43D1D for ; Wed, 4 Feb 2004 00:26:35 -0800 (PST) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.10/8.12.10) with ESMTP id i148QYDF028194 for ; Wed, 4 Feb 2004 09:26:34 +0100 (CET) (envelope-from phk@phk.freebsd.dk) To: current@freebsd.org From: Poul-Henning Kamp Date: Wed, 04 Feb 2004 09:26:34 +0100 Message-ID: <28193.1075883194@critter.freebsd.dk> Subject: why do I have to grab Giant before call to kthread_exit() ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2004 08:26:37 -0000 It seems somewhat bogus to me that I can create and run a kthread without Giant but I need to grab Giant before it exits... panic: mutex Giant not owned at ../../../kern/kern_exit.c:123 at line 719 in file ../../../kern/kern_mutex.c cpuid = 0; Debugger("panic") Stopped at 0xc06a7cf5 = Debugger+0x55: xchgl %ebx,0xc07bab24 = in_Debugger.0 db> trace Debugger(c0712b15,0,2cf,c0711f91,100) at 0xc06a7cf5 = Debugger+0x55 __panic(c0711f91,2cf,c07120f9,c0712234,c0710532) at 0xc0532782 = __panic+0x172 _mtx_assert(c076b460,1,c0710532,7b,c05398e3) at 0xc0528dec = _mtx_assert+0x11c exit1(c18ebd20,0,88,87,0) at 0xc0519e43 = exit1+0x33 kthread_exit(0,0,c070d581,29e,64) at 0xc0520126 = kthread_exit+0xb6 g_bde_worker(c1a0fc80,c54b3d48,c0710609,317,c194adc0) at 0xc04f6db5 = g_bde_worker+0x4a5 fork_exit(c04f6910,c1a0fc80,c54b3d48) at 0xc051d065 = fork_exit+0xc5 fork_trampoline() at 0xc06a94bc = fork_trampoline+0x8 --- trap 0x1, eip = 0, esp = 0xc54b3d7c, ebp = 0 --- -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.