After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 676048 - fix deadlock in gst app src
fix deadlock in gst app src
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.11.x
Other Linux
: Normal major
: 0.11.x
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 673178 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-05-14 21:16 UTC by Alban Browaeys
Modified: 2012-05-18 08:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix deadlock in gst app src (2.09 KB, patch)
2012-05-14 21:16 UTC, Alban Browaeys
none Details | Review

Description Alban Browaeys 2012-05-14 21:16:37 UTC
Created attachment 214033 [details] [review]
fix deadlock in gst app src

Perform seek start the loop which holds the live lock.
This leads to deadlock half the time when the caller
of perform seek, gst_base_src_start_complete, attempt to lock
it too.
Move the code protected by the live lock in gst_base_src_start_complete
beofre the perform seek call.
Comment 1 Wim Taymans 2012-05-16 07:26:30 UTC
The fix is not correct because it would set the result of the start operation before the last step of the operation is completed (doing the seek). Fortunately the solution is very easy: we use the stream lock to make the streaming thread wait as done in this patch:


commit d6e909994c9316c69187a1e9729f45eeace62137
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Wed May 16 09:16:26 2012 +0200

    basesrc: avoid potential deadlock
    
    In gst_base_src_start_complete() we do a perform_seek() that will eventually
    start the streaming thread which acquires the live lock and then goes to sleep
    in the case of appsrc. Right after we perform seek we also try to acquire the
    live lock which might then deadlock.
    
    fix this by taking the stream lock before performing the seek. This makes sure
    that the streaming thread cannot start and grab the live lock until we are done
    and release the stream lock again.
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=676048
Comment 2 Wim Taymans 2012-05-18 08:10:41 UTC
*** Bug 673178 has been marked as a duplicate of this bug. ***