Date: Fri, 26 Oct 2007 10:00:34 -0700 From: Julian Elischer <julian@elischer.org> To: Ed Schouten <ed@fxq.nl> Cc: FreeBSD Current <current@freebsd.org> Subject: Re: kthread/kproc panic Message-ID: <47221D32.8010300@elischer.org> In-Reply-To: <20071026135428.GO5411@hoeg.nl> References: <4720335D.6020404@elischer.org> <20071026135428.GO5411@hoeg.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
Ed Schouten wrote:
> Hello Julian,
>
> I just upgraded my box, because I wanted to test AHCI ATAPI support that
> got added yesterday. I get the following panic right after the kernel
> copyright message. Have to type it by hand, so Typo's Copyright (c) me.
>
> | kernel trap 12 with interrupts disabled
> | Fatal trap 12: page fault while in kernel mode
> | cpuid = 0; apic_id = 00
> | fault virtual address = 0x248
> | // too lazy to copy this by hand
> | db> bt
> | Tracing pid 0 tid 0 td 0xfffff...
> | bcopy() at bcopy+0x16
> | kproc_kthread_add() at kproc_kthread_add+0xbe
> | idle_setup() at idle_setup+0x7f
> | mi_startup() at mi_startup+0x59
> | btext() at btext+0x2c
>
> I'm running FreeBSD on an amd64.
>
> oldtd seems to be NULL
>
> Yours,
I'm struggling to reproduce this.
from your description the following might be a work around.
(Maybe something in your setup has thread0 not set up as early as in mine?
in terms of being linked into proc0)
Index: kern_kthread.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/kern_kthread.c,v
retrieving revision 1.40
diff -u -r1.40 kern_kthread.c
--- kern_kthread.c 26 Oct 2007 08:00:41 -0000 1.40
+++ kern_kthread.c 26 Oct 2007 16:51:49 -0000
@@ -254,7 +254,10 @@
p = &proc0;
oldtd = &thread0;
} else {
- oldtd = FIRST_THREAD_IN_PROC(p);
+ if (p == &proc0)
+ oldtd = &thread0;
+ else
+ oldtd = FIRST_THREAD_IN_PROC(p);
}
/* Initialize our td */
if this doesn't help,
reverting just these two files will fix it as then nothing will be using the new code..
Index: src/sys/kern/kern_idle.c
diff -u src/sys/kern/kern_idle.c:1.49 src/sys/kern/kern_idle.c:1.50
--- src/sys/kern/kern_idle.c:1.49 Sat Oct 20 23:23:21 2007
+++ src/sys/kern/kern_idle.c Fri Oct 26 08:00:41 2007
[...]
Index: src/sys/kern/kern_intr.c
diff -u src/sys/kern/kern_intr.c:1.148 src/sys/kern/kern_intr.c:1.149
--- src/sys/kern/kern_intr.c:1.148 Sat Oct 20 23:23:21 2007
+++ src/sys/kern/kern_intr.c Fri Oct 26 08:00:41 2007
[...]
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?47221D32.8010300>
