Bug 30353

Summary: [GStreamer] Race condition causing deadlocks
Product: WebKit Reporter: Sebastian Dröge (slomo) <slomo>
Component: MediaAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, pnormand
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
0001-Fix-race-condition-in-unlock-render-that-would-lead-.patch
gustavo: review-
Stacktrace showing the deadlock
none
0001-Fix-race-condition-in-unlock-render-that-would-lead-.patch none

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.