cvs commit: src/sys/i386/i386 trap.c src/sys/amd64/amd64 trap.c

John Baldwin jhb at freebsd.org
Fri Jan 27 14:46:36 PST 2006


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 <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org


More information about the cvs-src mailing list