kern/62862: pcm vchans related crash

Pierre-Luc Lespérance oksala at videotron.ca
Sat Feb 14 19:20:03 PST 2004


>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 at 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:


More information about the freebsd-bugs mailing list