Bug 26188

Summary: Kernel page fault in mpu attach
Product: Base System Reporter: bloom <bloom>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 5.0-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description bloom 2001-03-29 02:10:02 UTC
There is a page fault in the kernel while booting my machine.  This occurs
while trying the attach the mpu on my sound card.  The back trace indicates
that the page fualt is in _mtx_lock_sleep.

This problem has been occuring since around Feb 25 most likely related to
adding the mutex locking.  A later fix initialized the mutex, but still too
late.

A bit of research shows that that mutex is never initialized before attempting
to lock the mutex.  Looking at the code, the mutex is initialized after it is
first used.  In addition, I added a mutex_destroy call when cleaning up after
errors.

How-To-Repeat: I just boot the machine.
Comment 1 bloom 2001-03-29 02:26:40 UTC
Here are the error messages:

Fatal trap 12: page fault while in kernel mode
fault virtual address   = 0x1a0
fault code              = supervisor read, page not present
instruction pointer     = 0x8:0xc01c8006
stack pointer           = 0x10:0xc04e66dc
frame pointer           = 0x10:0xc04e66db>

trace
_mtx_lock_sleep(c0ecda08,0,c036d471,268) at _mtx_lock_sleep+0x29a
mpu_uartmode(c0ecda00) at mpu_uartmode+0x63
mpu_attach(c0ebd100,c0ebd100,c0ebd100,c0e67080,c04e675c) at
mpu_attach+0x25
mpusbc_attach(c0ebd100,c0ebd100,c0ea5ac0,c036e926,1) at
mpusbc_attach+0x19
device_probe_and_attach(c0ebd100) at device_probe_and_attach+0x9a
bus_generic_attach(c0ea2000,c0ebd080,c0ea5ac0,c0ea2000,c036e935) at
bus_generic_attach+0x16
sbc_attach(c0ea2000,c0eadb00,c0ea2000,7,0) at sbc_attach+0x3cc
device_probe_and_attach(c0ea2000,c0404c4c,c03f9030,4eb000,c0eadb00) at
device_probe_and_attach+0x9a
isa_probe_children(c0ea2980,c04e6ff8,c01b1f74,0,4e4c00) at
isa_probe_children+0x143
configure(0,4e4c00,4e4000,0,c01277d2) at configure+0x39
mi_startup() at mi_startup+0x68
begin() at begin+0x29
Comment 2 tanimura freebsd_committer freebsd_triage 2001-04-03 06:16:13 UTC
State Changed
From-To: open->closed

Fixed in src/sys/dev/sound/isa/mpu.c rev 1.7, thanks!