At Sun, 18 Aug 2002 07:17:07 -0700 (PDT), Orion Hodson wrote: > Modified files: > sys/dev/sound/pcm dsp.c > Log: > Apply reference counting patch. Fixes problem of two applications > opening the device, eg one read only and one write only, and the > reference count being non-zero when both exit rendering device > permanently busy.
After this, I got a panic around sound. With r1.54 of dsp.c, it looks fine. panic: mutex pcm0:play:0 not owned at ../../../kern/kern_mutex.c:339 panic: from debugger panic messages: --- dmesg: kernel message buffer has different magic number --- #0 doadump () at ../../../kern/kern_shutdown.c:213 213 dumping++; (kgdb) where #0 doadump () at ../../../kern/kern_shutdown.c:213 #1 0xc01ffcc9 in boot (howto=260) at ../../../kern/kern_shutdown.c:345 #2 0xc01ffef8 in panic () at ../../../kern/kern_shutdown.c:493 #3 0xc0142152 in db_panic () at ../../../ddb/db_command.c:449 #4 0xc01420d2 in db_command (last_cmdp=0xc03d5f20, cmd_table=0xc0380688, aux_cmd_tablep=0x104, aux_cmd_tablep_end=0xc1fbf6c0) at ../../../ddb/db_command.c:345 #5 0xc01421e6 in db_command_loop () at ../../../ddb/db_command.c:471 #6 0xc014473e in db_trap (type=3, code=0) at ../../../ddb/db_trap.c:72 #7 0xc0352d0f in kdb_trap (type=3, code=0, regs=0xcb5a0a64) at ../../../i386/i386/db_interface.c:161 #8 0xc0362487 in trap (frame= {tf_fs = -883294184, tf_es = -883294192, tf_ds = -1071841264, tf_edi = 256, tf_esi = -1040451904, tf_ebp = -883291472, tf_isp = -883291504, tf_ebx = 0, tf_edx = 0, tf_ecx = 32, tf_eax = 18, tf_trapno = 3, tf_err = 0, tf_eip = -1070256204, tf_cs = 8, tf_eflags = 662, tf_esp = -1069786017, tf_ss = -1069952868}) at ../../../i386/i386/trap.c:605 #9 0xc03543d8 in calltrap () at {standard input}:98 #10 0xc01ffee0 in panic (fmt=0x0) at ../../../kern/kern_shutdown.c:479 #11 0xc01f696c in _mtx_assert (m=0x0, what=0, file=0xc1fbf6c0 "", line=256) at ../../../kern/kern_mutex.c:800 #12 0xc01f6200 in _mtx_unlock_flags (m=0x0, opts=0, file=0x0, line=0) at ../../../kern/kern_mutex.c:339 #13 0xc01a63aa in pcm_chnrelease (c=0x0) at ../../../dev/sound/pcm/sound.c:229 #14 0xc01a144b in dsp_close (i_dev=0x100, flags=6, mode=8192, td=0xc1fbf6c0) at ../../../dev/sound/pcm/dsp.c:382 #15 0xc01d5af7 in spec_close (ap=0xcb5a0ba4) at ../../../fs/specfs/spec_vnops.c:631 #16 0xc01d4fd8 in spec_vnoperate (ap=0x0) at ../../../fs/specfs/spec_vnops.c:124 #17 0xc0255a56 in vn_close (vp=0xc210cde0, flags=0, file_cred=0x0, td=0x0) at vnode_if.h:224 #18 0xc02568c0 in vn_closefile (fp=0x0, td=0x0) at ../../../kern/vfs_vnops.c:877 #19 0xc01e4253 in fdrop_locked (fp=0xc210cde0, td=0x0) at file.h:256 #20 0xc01e3cfe in fdrop (fp=0xc200eb40, td=0x0) at ../../../kern/kern_descrip.c:1625 #21 0xc01e3cac in closef (fp=0xc210cde0, td=0xc200eb40) at ../../../kern/kern_descrip.c:1611 #22 0xc01e2328 in close (td=0xc1fbf6c0, uap=0x0) at ../../../kern/kern_descrip.c:803 #23 0xc0362da1 in syscall (frame= {tf_fs = 47, tf_es = 47, tf_ds = 47, tf_edi = 1, tf_esi = -1077936672, tf_ebp = -1077936884, tf_isp = -883290764, tf_ebx = 672599680, tf_edx = 0, tf_ecx = 191, tf_eax = 6, tf_trapno = 22, tf_err = 2, tf_eip = 672156459, tf_cs = 31, tf_eflags = 643, tf_esp = -1077936912, tf_ss = 47}) at ../../../i386/i386/trap.c:1050 #24 0xc035442d in Xint0x80_syscall () at {standard input}:140 ---Can't read userspace from dump, or kernel process--- (kgdb) up 14 #14 0xc01a144b in dsp_close (i_dev=0x100, flags=6, mode=8192, td=0xc1fbf6c0) at ../../../dev/sound/pcm/dsp.c:382 382 pcm_chnrelease(wrch); (kgdb) list 377 } 378 if (wrch) { 379 chn_flush(wrch); /* may sleep */ 380 wrch->flags &= ~(CHN_F_RUNNING | CHN_F_MAPPED | CHN_F_DEAD); 381 chn_reset(wrch, 0); 382 pcm_chnrelease(wrch); 383 } 384 i_dev->si_drv1 = NULL; 385 i_dev->si_drv2 = NULL; 386 -- Jun Kuriyama <[EMAIL PROTECTED]> // IMG SRC, Inc. <[EMAIL PROTECTED]> // FreeBSD Project To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message