From owner-cvs-all@FreeBSD.ORG Fri Jan 27 22:46:36 2006 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8286D16A420; Fri, 27 Jan 2006 22:46:36 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id 52C7B43D45; Fri, 27 Jan 2006 22:46:35 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 7152531 for multiple; Fri, 27 Jan 2006 17:45:26 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k0RMkWpf054106; Fri, 27 Jan 2006 17:46:32 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: src-committers@freebsd.org Date: Fri, 27 Jan 2006 17:45:15 -0500 User-Agent: KMail/1.9.1 References: <200601272222.k0RMMAoR062022@repoman.freebsd.org> In-Reply-To: <200601272222.k0RMMAoR062022@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200601271745.17186.jhb@freebsd.org> X-Virus-Scanned: ClamAV 0.87.1/1254/Fri Jan 27 12:22:39 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: cvs-src@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/i386/i386 trap.c src/sys/amd64/amd64 trap.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2006 22:46:36 -0000 On Friday 27 January 2006 17:22, John Baldwin wrote: > jhb 2006-01-27 22:22:10 UTC > > FreeBSD src repository > > Modified files: > sys/i386/i386 trap.c > sys/amd64/amd64 trap.c > Log: > Call WITNESS_CHECK() in the page fault handler and immediately assume it > is a fatal fault if we are holding any non-sleepable locks. This should > cut down on the number of bogus LORs we currently get when the kernel > panics due to a NULL (or bogus) pointer dereference that goes wandering > off into the VM system which tries to acquire locks and then kicks off > the spurious LORs. This should probably be ported to all the archs at > some point. > > Tested on: i386 Sample output for a fault with a mutex held: 32 fault with a mutex held # sysctl debug.crash.test=32 debug.crash.testc: r0as -> h: fa0ult with a mutex held Kern# el page fault with the following non-sleepable locks held: exclusive sleep mutex test r = 0 (0xc4c318d4) locked @ crash.c:95 KDB: stack backtrace: kdb_backtrace(c0811c3c,e00dabe4,1,c4774780,c4777678) at kdb_backtrace+0x2e witness_warn(5,0,c0773810,c4774780,0) at witness_warn+0x1d3 trap(c0540008,c4c30028,28,c4c2f910,21) at trap+0x13e calltrap() at calltrap+0x5 --- trap 0xc, eip = 0xc4c2e1db, esp = 0xe00dacb0, ebp = 0xe00dacc4 --- fault_with_lock(c4c304e9,c4c2ffbf,c4c2ffd7,255,0) at fault_with_lock+0x2b crash_thread(0,e00dad38,c074f249,30e,c4774780) at crash_thread+0xdd fork_exit(c4c2f910,0,e00dad38) at fork_exit+0x117 fork_trampoline() at fork_trampoline+0x8 --- trap 0x1, eip = 0, esp = 0xe00dad6c, ebp = 0 --- Fatal trap 12: page fault while in kernel mode cpuid = 3; apic id = 03 fault virtual address = 0x0 fault code = supervisor read, page not present instruction pointer = 0x20:0xc4c2e1db stack pointer = 0x28:0xe00dacb0 frame pointer = 0x28:0xe00dacc4 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, def32 1, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 1325 (crash) [thread pid 1325 tid 100087 ] Stopped at fault_with_lock+0x2b: movsbl 0,%ebx db> -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org