--- //depot/projects/smpng/sys/kern/subr_turnstile.c 2003/11/19 08:35:27 +++ //depot/user/jhb/lock/kern/subr_turnstile.c 2003/12/03 11:42:37 @@ -254,6 +259,25 @@ } td1 = TAILQ_PREV(td, threadqueue, td_lockq); + if (td1 == NULL) { + printf("%s: td1 is NULL dang it\n", __func__); + printf( + "td %p, ts %p ; td->td_blocked %p, ts->ts_lockobj %p\n", + td, ts, td->td_blocked, ts->ts_lockobj); + printf("blocked threads:\n"); + TAILQ_FOREACH(td1, &ts->ts_blocked, td_lockq) { + printf("\t%p (pid %d) %s\n", td1, + td1->td_proc->p_pid, td1->td_proc->p_comm); + } + printf("pending threads:\n"); + TAILQ_FOREACH(td1, &ts->ts_blocked, td_lockq) { + printf("\t%p (pid %d) %s\n", td1, + td1->td_proc->p_pid, td1->td_proc->p_comm); + } + mtx_unlock_spin(&tc->tc_lock); + Debugger("yowzers batman"); + return; + } if (td1->td_priority <= pri) { mtx_unlock_spin(&tc->tc_lock); continue;