From owner-freebsd-current@FreeBSD.ORG Fri Oct 26 17:00:08 2007 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8626016A469 for ; Fri, 26 Oct 2007 17:00:08 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outA.internet-mail-service.net (outA.internet-mail-service.net [216.240.47.224]) by mx1.freebsd.org (Postfix) with ESMTP id 6811913C48E for ; Fri, 26 Oct 2007 17:00:07 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Fri, 26 Oct 2007 10:00:06 -0700 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 199B912681B; Fri, 26 Oct 2007 10:00:06 -0700 (PDT) Message-ID: <47221D32.8010300@elischer.org> Date: Fri, 26 Oct 2007 10:00:34 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Ed Schouten References: <4720335D.6020404@elischer.org> <20071026135428.GO5411@hoeg.nl> In-Reply-To: <20071026135428.GO5411@hoeg.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: FreeBSD Current Subject: Re: kthread/kproc panic X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2007 17:00:08 -0000 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 [...]