From owner-freebsd-current@FreeBSD.ORG Sat Sep 11 10:00:06 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E192A16A4CE for ; Sat, 11 Sep 2004 10:00:06 +0000 (GMT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 72A3343D54 for ; Sat, 11 Sep 2004 10:00:06 +0000 (GMT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.11/8.12.11) with ESMTP id i8B9xj01048328; Sat, 11 Sep 2004 02:59:49 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200409110959.i8B9xj01048328@gw.catspoiler.org> Date: Sat, 11 Sep 2004 02:59:45 -0700 (PDT) From: Don Lewis To: julian@elischer.org MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii cc: freebsd-current@FreeBSD.org Subject: page fault in sched_pin() X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Sat, 11 Sep 2004 10:00:07 -0000 I just cvsup'ed a few hours ago and I'm getting a page fault in sched_pin() early in the boot process. It looks like a NULL pointer dereference. I'm using SCHED_4BSD+PREEMPTION. It looks like the problem is that proc0_init() (which calls schedinit()) needs to be called before kmeminit(), so that the thread0->td_sched is initialized before it is dereferenced in sched_pin(). The SYSINIT for kmeminit() is SI_SUB_KMEM, which is defined as 0x1800000, while the SYSINIT for proc0_init() is SI_SUB_INTRINSIC, which is defined as 0x2200000. An alternative would be to make sched_pin() a no-op this early in the boot process. Copyright (c) 1992-2004 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 6.0-CURRENT #241: Sat Sep 11 02:23:16 PDT 2004 dl@scratch.catspoiler.org:/usr/obj/usr/src/sys/GENERICSMB WARNING: WITNESS option enabled, expect reduced performance. kernel trap 12 with interrupts disabled Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0x30 fault code = supervisor write, page not present instruction pointer = 0x8:0xc0620c47 stack pointer = 0x10:0xc0c21cc0 frame pointer = 0x10:0xc0c21cc0 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, def32 1, gran 1 processor eflags = resume, IOPL = 0 current process = 0 () [thread 0] Stopped at sched_pin+0xf: incl 0x30(%eax) db> tr sched_pin(c0c21cdc,c07a0edc,c1047828,bfeff000,c103a000) at sched_pin+0xf pmap_zero_page(c1047828,bfeff000,c103a000,c0c21cf4,c075f724) at pmap_zero_page+0x35 pmap_growkernel(d6247000) at pmap_growkernel+0xf4 vm_map_findspace(c103a000,bfeff000,14000000,c08d3c3c) at vm_map_findspace+0x118 vm_map_find(c103a000,0,0,0,c08d3c3c,14000000,1,7,7,0) at vm_map_find+0x41 kmem_suballoc(c103a000,c08d3c3c,c08d3c40,14000000,14000) at kmem_suballoc+0x36 kmeminit(0,c1ec00,c1e000,0,c0440b85) at kmeminit+0xe5 mi_startup() at mi_startup+0x96 begin() at begin+0x2c db>