Date: Sat, 14 Feb 2004 19:12:47 -0800 (PST) From: Pierre-Luc Lespérance <oksala@videotron.ca> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/62862: pcm vchans related crash Message-ID: <200402150312.i1F3Cl1j081815@www.freebsd.org> Resent-Message-ID: <200402150320.i1F3K3U8060443@freefall.freebsd.org>
index | next in thread | raw e-mail
>Number: 62862
>Category: kern
>Synopsis: pcm vchans related crash
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sat Feb 14 19:20:02 PST 2004
>Closed-Date:
>Last-Modified:
>Originator: Pierre-Luc Lespérance
>Release: 4.9-p2
>Organization:
N/A
>Environment:
FreeBSD silence 4.9-RELEASE-p2 FreeBSD 4.9-RELEASE-p2 #57: Sat Feb 14 21:32:13 EST 2004 silence@silence:/usr/src/sys/compile/oksala i386
>Description:
The system hangs if a pcm vchan is closed while it is in use. My fix simply check if some vchans are in use.
>How-To-Repeat:
- Play a sound on a vchan
- set vchan to 0 with sysctl sysctl hw.snd.pcm0.vchans=0
>Fix:
--- sound.c.orig Sat Feb 14 22:09:31 2004
+++ sound.c Sat Feb 14 22:08:00 2004
@@ -810,11 +810,17 @@
d = oidp->oid_arg1;
pcm_lock(d);
+
cnt = 0;
SLIST_FOREACH(sce, &d->channels, link) {
c = sce->channel;
if ((c->direction == PCMDIR_PLAY) && (c->flags & CHN_F_VIRTUAL))
cnt++;
+ if (c->refcount > 0) {
+ pcm_unlock(d);
+ return EBUSY;
+ }
+
}
oldcnt = cnt;
newcnt = cnt;
>Release-Note:
>Audit-Trail:
>Unformatted:
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200402150312.i1F3Cl1j081815>
