Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Jul 2004 15:37:33 -0400
From:      John Baldwin <jhb@FreeBSD.org>
To:        Robert Watson <rwatson@FreeBSD.org>
Cc:        current@FreeBSD.org
Subject:   Re: panic: Assertion td->td_turnstile != NULL failed at ../../../kern/subr_turnstile.c:478
Message-ID:  <200407091537.33824.jhb@FreeBSD.org>
In-Reply-To: <Pine.NEB.3.96L.1040709135400.53137B-100000@fledge.watson.org>
References:  <Pine.NEB.3.96L.1040709135400.53137B-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 09 July 2004 01:54 pm, Robert Watson wrote:
> On Fri, 9 Jul 2004, John Baldwin wrote:
> > > login: root
> > > Password:panic: Assertion td->td_turnstile != NULL failed at
> > > ../../../kern/subr_turnstile.c:478
> >
> > This means your thread has no turnstile to give to the lock it is
> > blocking on.  Are you using TURNSTILE_PROFILING on this box?
>
> Not currently.  Would you like me to?

No, I was curious if there was a bug in the _PROFILING case. :)  Actually, 
hmm.  Looks like we don't setrunqueue() until after giving the thread a 
turnstile.  Can you see if this assertion is triggered:

Index: subr_turnstile.c
===================================================================
RCS file: /usr/cvs/src/sys/kern/subr_turnstile.c,v
retrieving revision 1.145
diff -u -r1.145 subr_turnstile.c
--- subr_turnstile.c    2 Jul 2004 19:09:49 -0000       1.145
+++ subr_turnstile.c    9 Jul 2004 19:35:27 -0000
@@ -736,6 +736,7 @@
                        td->td_lockname = NULL;
                        TD_CLR_LOCK(td);
                        MPASS(TD_CAN_RUN(td));
+                       MPASS(td->td_turnstile != NULL);
                        setrunqueue(td);
                } else {
                        td->td_flags |= TDF_TSNOBLOCK;

Also, you can try wrapping the entire while() loop there in turnstile_unpend() 
in a critical secton to force it to wake up all the threads before 
preempting.  Also, are you using MUTEX_WAKE_ALL by chance?

-- 
John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



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