Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Dec 2006 20:42:03 +0300 (MSK)
From:      Yuriy Tsibizov <Yuriy.Tsibizov@gfk.ru>
To:        Andrey Chernov <ache@freebsd.org>
Cc:        current@freebsd.org, kmacy@freebsd.org
Subject:   Re: Fatal trap at booting after last kmacy@ changes
Message-ID:  <20061216203900.G599@free.home.local>
In-Reply-To: <20061216133547.GA1754@nagual.pp.ru>
References:  <20061216133547.GA1754@nagual.pp.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
> Last kernel got immediately fatal trap at boot, right after timer probe.
> This is what I write by hand from the console:
>
> Fatal trap 12: page fault while in kernel mode
> fault code: supervisor read, page not present
> stopped at sleepq_add+0xf6: cmpl $0,0(%rax,%eax,8)
>
> stack trace:
> sleepq_add
> cv_timedwait
> _sema_timedwait
> ata_queue_request
> ...

It seems that with INVARIANTS &sq is referenced while sq is NULL...

This should fix it:

Index: subr_sleepqueue.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/subr_sleepqueue.c,v
retrieving revision 1.32
diff -u -r1.32 subr_sleepqueue.c
--- subr_sleepqueue.c	16 Dec 2006 07:50:39 -0000	1.32
+++ subr_sleepqueue.c	16 Dec 2006 17:34:27 -0000
@@ -295,6 +295,7 @@
  	 * into the sleep queue already in use by this wait channel.
  	 */
  	if (sq == NULL) {
+		sq = td->td_sleepqueue;
  #ifdef INVARIANTS
  		int i;
  		for (i = 0; i < NR_SLEEPQS; i++)
@@ -313,7 +314,6 @@
  				sleepq_max_depth = sc->sc_max_depth;
  		}
  #endif
-		sq = td->td_sleepqueue;
  		LIST_INSERT_HEAD(&sc->sc_queues, sq, sq_hash);
  		sq->sq_wchan = wchan;
  #ifdef INVARIANTS

Yuriy.




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