Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jun 2002 19:55:30 +0100
From:      Ian Dowse <iedowse@maths.tcd.ie>
To:        Andy Sporner <sporner@nentec.de>
Cc:        freebsd-hackers <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: Kernel Panic using kproc_exit() on FreeBSD 5.0-20020302-PREVIEW 
Message-ID:   <200206191955.aa29511@salmon.maths.tcd.ie>
In-Reply-To: Your message of "Mon, 17 Jun 2002 11:47:13 %2B0200." <3D0DB021.4080102@nentec.de> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <3D0DB021.4080102@nentec.de>, Andy Sporner writes:
>SYSINIT(modtcpd, SI_SUB_KTHREAD_BUF, SI_ORDER_FIRST, kproc_start, &kp)
>static void modtcpd(void)
>{
>                tsleep(0x0dead0001, 0, "General Wait", 400);
>                kthread_exit(0);
>}
...
>panic: mutex Giant not owned at ../../../kern/kern_exit.c"131

If you haven't guessed already by looking at other kernel threads,
you need to "mtx_lock(&Giant);" before calling kthread_exit(). Most
kthreads acquire Giant at the start and hold it throughout their
execution (it it implicitly dropped when the thread is sleeping).
You should do this too unless you are sure that all operations that
the thread is performing are safe to do without Giant.

Ian

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi? <200206191955.aa29511>