[pulseaudio-tickets] [Bug 74624] New: pa_stream_disconnect() is broken

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Feb 6 08:08:46 PST 2014


https://bugs.freedesktop.org/show_bug.cgi?id=74624

          Priority: medium
            Bug ID: 74624
                CC: lennart at poettering.net
          Assignee: pulseaudio-bugs at lists.freedesktop.org
           Summary: pa_stream_disconnect() is broken
        QA Contact: pulseaudio-bugs at lists.freedesktop.org
          Severity: major
    Classification: Unclassified
                OS: All
          Reporter: tanuk at iki.fi
          Hardware: Other
            Status: NEW
           Version: unspecified
         Component: clients
           Product: PulseAudio

pa_stream_disconnect() doesn't work in all situations. In at least two
situations it's clearly broken:

1) When it's called while the stream state is CREATING, s->channel_valid is
false, which causes the function to return with -PA_ERR_BADSTATE. The stream
creation isn't cancelled, contrary to what would be the expected behaviour.

2) Normally, when an application calls pa_stream_disconnect() while the stream
state is FAILED, the function will return with -PA_ERR_BADSTATE because
s->channel_valid is false. However, when the stream state is just changing to
FAILED, and the application calls pa_stream_disconnect() from the stream state
callback, channel_valid has not yet been set to false, and the function
continues as if everything is fine. This can reportedly result in a crash,
although I haven't investigated this enough to explain the exact cause of the
crash.

pa_stream_disconnect() works asynchronously, which I believe is a bad idea. I
think it would be better if pa_stream_disconnect() would immediately cancel all
in-flight operations, reset the stream object to a safe state, and finally
notify the application that the state changed to TERMINATED.
pa_stream_disconnect() could then become a void function that is safe to call
in all situations, like pa_context_disconnect() is.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-bugs/attachments/20140206/0293b790/attachment.html>


More information about the pulseaudio-bugs mailing list