kern/71189: Kernel panic (trace included) "recursed on non-recursive mutex" with SoundBlaster 32 (ISA port)

Stephane Legrand stephane at FreeBSD.org
Tue Aug 31 04:50:29 PDT 2004


>Number:         71189
>Category:       kern
>Synopsis:       Kernel panic (trace included) "recursed on non-recursive mutex" with SoundBlaster 32 (ISA port)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 31 11:50:28 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Stephane Legrand
>Release:        FreeBSD 5.3-BETA2 i386
>Organization:
>Environment:

FreeBSD 5.3-BETA2 on i386 with a Creative SoundBlaster 32 Pnp
sound card in one ISA port.

sequoia% uname -a
  FreeBSD sequoia.mondomaineamoi.megalo 5.3-BETA2 FreeBSD 5.3-BETA2 #3: 
  Tue Aug 31 08:23:48 CEST 2004 
  root@:/usr/obj/usr/src/sys/SEQUOIA i386

sequoia% kldstat 
  Id Refs Address    Size     Name
   1   12 0xc0400000 3b3490   kernel
   2    1 0xc07b4000 46a4     snd_sb16.ko
   3    2 0xc07b9000 4d20     snd_sbc.ko
   4   14 0xc07be000 5e6fc    acpi.ko
   5    4 0xc1809000 14000    netgraph.ko
   6    2 0xc181d000 4000     ng_ether.ko
   7    1 0xc1821000 7000     ng_pppoe.ko
   8    1 0xc1828000 5000     ng_socket.ko
   9    1 0xc188a000 b000     ipfw.ko

sequoia% more /boot/loader.conf 
  snd_sb16_load="YES"

>From dmesg:
  sbc0: <Creative SB16/SB32> at port 0x388-0x38b,0x330-0x331,0x220-0x22f irq 5 drq 5,1 on isa0
  sbc0: [GIANT-LOCKED]
  pcm0: <SB16 DSP 4.16> on sbc0
  pcm0: [GIANT-LOCKED]

sequoia% cat /dev/sndstat 
  FreeBSD Audio Driver (newpcm)
  Installed devices:
  pcm0: <SB16 DSP 4.16> at io 0x220 irq 5 drq 1:5 bufsz 4096d 
        kld snd_sb16 (1p/1r/0v channels duplex default)
    [pcm0:record:0]: spd 0, fmt 0x00000000/0x00000008, flags 0x00000000, 0x00000000
     interrupts 0, overruns 0, hfree 4096, sfree 0
     {hardware} -> feeder_root(0x00000000) -> {userland}
    [pcm0:play:0]: spd 0, fmt 0x00000000/0x00000008, flags 0x00000000, 0x00000000
     interrupts 0, underruns 0, ready 0
     {userland} -> feeder_root(0x00000000) -> {hardware}

  File Versions:
  $FreeBSD: src/sys/dev/sound/pcm/vchan.c,v 1.16 2004/01/28 08:02:15 truckman Exp $
  $FreeBSD: src/sys/dev/sound/pcm/sound.c,v 1.92 2004/07/16 03:59:09 tanimura Exp $
  $FreeBSD: src/sys/dev/sound/pcm/sndstat.c,v 1.17 2004/06/16 09:46:57 phk Exp $
  $FreeBSD: src/sys/dev/sound/pcm/mixer.c,v 1.40 2004/06/25 16:34:33 josef Exp $
  $FreeBSD: src/sys/dev/sound/pcm/feeder_rate.c,v 1.10 2003/04/20 17:08:56 orion Exp $
  $FreeBSD: src/sys/dev/sound/isa/sb16.c,v 1.87 2004/07/16 03:59:54 tanimura Exp $
  $FreeBSD: src/sys/dev/sound/isa/sbc.c,v 1.42 2004/07/16 03:59:54 tanimura Exp $
  $FreeBSD: src/sys/dev/sound/pcm/feeder_fmt.c,v 1.13 2003/09/07 16:28:03 cg Exp $
  $FreeBSD: src/sys/dev/sound/pcm/feeder.c,v 1.32 2003/09/07 16:28:03 cg Exp $
  $FreeBSD: src/sys/dev/sound/pcm/fake.c,v 1.13 2003/09/07 16:28:03 cg Exp $
  $FreeBSD: src/sys/dev/sound/pcm/dsp.c,v 1.77 2004/07/02 15:31:44 netchild Exp $
  $FreeBSD: src/sys/dev/sound/pcm/channel.c,v 1.97 2004/02/28 19:47:02 truckman Exp $
  $FreeBSD: src/sys/dev/sound/pcm/buffer.c,v 1.23 2004/04/29 02:51:59 green Exp $
  $FreeBSD: src/sys/dev/sound/pcm/ac97_patch.c,v 1.2 2003/08/21 15:44:55 orion Exp $
  $FreeBSD: src/sys/dev/sound/pcm/ac97.c,v 1.51 2004/05/08 03:41:40 sanpei Exp $
  $FreeBSD: src/sys/dev/sound/isa/sndbuf_dma.c,v 1.2 2003/09/07 16:28:02 cg Exp $

>Description:

For instance, if i try to play a MP3 file with mplayer, i immediately
get a kernel panic. This also happens with xmms. Note that this
card worked without any problem on FreeBSD 4.x including 4.10.

The kernel configuration file has the "device sound" line. The panic
happens with or without the WITNESS option.

The kernel panic trace: 
...
Video: no video
Starting playback...
panic: _mtx_lock_sleep: recursed on non-recursive mutex sbc0 
  @ /usr/src/sys/modules/sound/driver/sbc/../../../../dev/sound/isa/sbc.c: 131
KDB: enter: panic
[thread 100081]
Stopped at kbd_enter + 0x30: leave
db> trace
  kbd_enter(c06927e9,c06e9e00,c0691bf4,d23c8a30,100) at kbd_enter + 0x30
  panic(c0691bf4,c1662530,c07bb6a8,83,c1667100) at panic + 0xd5
  _mtx_lock_sleep(c1667100,c1aa4580,0,c07bb6a8,83) at _mtx_lock_sleep + 0x47
  _mtx_lock_flags(c1667100,0,c07bb6a8,83,d23c8a94) at _mtx_lock_flags + 0xbf
  sbc_lock(c1644d00,d23c8ab0,c07b56ee,c1644b00,d23c8ab0) at sbc_lock + 0x2c
  sb_lock(c1644d00,d23c8ab0,c1644b2c,c1644b00,3ff) at sb_lock + 0x1c
  sb_cmd2(c1644d00,30,3ff,c1644b00,0) at sb_cmd2 + 0x1e
  sb_setup(c1644d00,c1674410,1,d23c8b08,c048897a) at sb_setup + 0x2fa
  sb16chan_trigger(c1674410,c1644b2c,1,465,c1644980) at sb16chan_trigger + 0x35
  chn_trigger(c1644980,1,c068ae8b,207,0) at chn_trigger + 0xaa
  chn_start(c1644980,0,10000,14f,c1676800) at chn_start + 0x107
  chn_write(c1644980,d23c8c80,d23c8b74,20000000,0) at chn_write + 0x26e
  dsp_write(c1645400,d23c8c80,50001,d23c8bc0,10000) at dsp_write + 0xa5
  spec_write(d23c8c0c,d23c8c58,c0558352,d23c8c0c,20002) at spec_write + 0x1f0
  spec_vnoperate(d23c8c0c,20002,c1aa4580,246,d23c8c80) at spec_vnoperate + 0x18
  vn_write(c1766550,d23c8c80,c1ad6280,0,c1aa4580) at vn_write + 0x242
  dofilewrite(c1aa4580,c1766550,6,8795000,10000) at dofilewrite + 0xcb
  write(c1aa4580,d23c8d14,c,437,3) at write + 0x69
  syscall(2f,bfbf002f,d23c002f,85a8000,e84a5b61) at syscall + 0x2a0
  Xint0x80_syscall() at Xint0x80_syscall + 0x1f
  --- syscall (4,FreeBSD ELF32,write), eip = 0x28bc1dbb, esp = 0xbfbfd55c, ebp = 0xbfbfd578 ---

>How-To-Repeat:
Plug a Creative SoundBlaster 32 Pnp in one ISA port and try to use
it with mplayer or xmms.
  
>Fix:
The only one i was able to find: never use the sound card :)
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list