Bug 30353 - [GStreamer] Race condition causing deadlocks
Summary: [GStreamer] Race condition causing deadlocks
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-14 04:19 PDT by Sebastian Dröge (slomo)
Modified: 2009-10-15 07:16 PDT (History)
2 users (show)

See Also:


Attachments
0001-Fix-race-condition-in-unlock-render-that-would-lead-.patch (5.11 KB, patch)
2009-10-14 04:24 PDT, Sebastian Dröge (slomo)
gns: review-
Details | Formatted Diff | Diff
Stacktrace showing the deadlock (6.31 KB, text/plain)
2009-10-14 04:27 PDT, Benjamin Otte
no flags Details
0001-Fix-race-condition-in-unlock-render-that-would-lead-.patch (5.53 KB, patch)
2009-10-15 06:57 PDT, Sebastian Dröge (slomo)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Dröge (slomo) 2009-10-14 04:19:21 PDT
Hi,
currently there's a race condition in the GStreamer video sink. Problem is, if unlock() is called and then render(). It would wait forever on the cond.

Attached patch fixes this.
Comment 1 Sebastian Dröge (slomo) 2009-10-14 04:24:53 PDT
Created attachment 41156 [details]
0001-Fix-race-condition-in-unlock-render-that-would-lead-.patch
Comment 2 Benjamin Otte 2009-10-14 04:27:34 PDT
Created attachment 41157 [details]
Stacktrace showing the deadlock
Comment 3 Gustavo Noronha (kov) 2009-10-15 06:46:19 PDT
Comment on attachment 41156 [details]
0001-Fix-race-condition-in-unlock-render-that-would-lead-.patch

Man, threading is hairy =). So, what's causing the deadlock, exactly, again? The cond_wait in render and the mutex_lock in timeout_func racing when gstreamer fires ::unlock? Then you fix it by avoiding creating the timeout and doing the cond_wait in the first place if ::unlock() has fired on the element, is that it? Can you add a comment block somewhere explaining this?
Comment 4 Sebastian Dröge (slomo) 2009-10-15 06:57:43 PDT
Created attachment 41223 [details]
0001-Fix-race-condition-in-unlock-render-that-would-lead-.patch
Comment 5 Gustavo Noronha (kov) 2009-10-15 07:01:05 PDT
Comment on attachment 41223 [details]
0001-Fix-race-condition-in-unlock-render-that-would-lead-.patch

Thanks!
Comment 6 WebKit Commit Bot 2009-10-15 07:16:33 PDT
Comment on attachment 41223 [details]
0001-Fix-race-condition-in-unlock-render-that-would-lead-.patch

Clearing flags on attachment: 41223

Committed r49623: <http://trac.webkit.org/changeset/49623>
Comment 7 WebKit Commit Bot 2009-10-15 07:16:36 PDT
All reviewed patches have been landed.  Closing bug.