Bug 169019

Summary: [GTK] fast/canvas/canvas-createPattern-video-loading.html makes its subsequent test timeout
Product: WebKit Reporter: Fujii Hironori <Hironori.Fujii>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: alex, bugs-noreply, calvaris, cgarcia, clopez, commit-queue, mcatanzaro
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
backtrace of web process
none
test gardening patch
none
Patch calvaris: review+, calvaris: commit-queue-

Description Fujii Hironori 2017-03-01 00:31:15 PST
[GTK] fast/canvas/canvas-createPattern-video-loading.html makes a following test timeout

trunk@213127

> ./Tools/Scripts/run-webkit-tests --gtk --release --no-new-test-results -v fast/canvas/canvas-createPattern-video-loading.html fast/canvas/canvas-createPattern-video-modify.html

> [1/2] fast/canvas/canvas-createPattern-video-loading.html passed
> [2/2] fast/canvas/canvas-createPattern-video-modify.html failed unexpectedly (test timed out)
Comment 1 Fujii Hironori 2017-03-01 00:32:19 PST
Created attachment 303047 [details]
backtrace of web process

Sometimes, fast/canvas/canvas-createPattern-video-loading.html timed out itself.
Comment 2 Fujii Hironori 2017-03-01 00:46:26 PST
Created attachment 303049 [details]
test gardening patch
Comment 3 WebKit Commit Bot 2017-03-01 01:59:01 PST
Comment on attachment 303049 [details]
test gardening patch

Clearing flags on attachment: 303049

Committed r213216: <http://trac.webkit.org/changeset/213216>
Comment 4 WebKit Commit Bot 2017-03-01 01:59:05 PST
All reviewed patches have been landed.  Closing bug.
Comment 5 Fujii Hironori 2017-03-01 02:00:03 PST
Reopen.
Comment 6 Carlos Garcia Campos 2017-03-01 02:03:55 PST
(In reply to comment #1)
> Created attachment 303047 [details]
> backtrace of web process
> 
> Sometimes, fast/canvas/canvas-createPattern-video-loading.html timed out
> itself.

Is this bt from trunk? I think we had fixed this deadlock in r211815
Comment 7 Fujii Hironori 2017-03-01 02:08:51 PST
(In reply to comment #6)
> Is this bt from trunk? I think we had fixed this deadlock in r211815

Yes. I'm using trunk@213127
Comment 8 Carlos Garcia Campos 2017-03-01 02:09:16 PST
(In reply to comment #6)
> (In reply to comment #1)
> > Created attachment 303047 [details]
> > backtrace of web process
> > 
> > Sometimes, fast/canvas/canvas-createPattern-video-loading.html timed out
> > itself.
> 
> Is this bt from trunk? I think we had fixed this deadlock in r211815

I can reproduce it.
Comment 9 Carlos Garcia Campos 2017-03-01 02:44:07 PST
I think this is a GST bug, I remember I debugged similar issues in the past. The problem is that we need to set the pipeline state to NULL before all other elements are released. So, when the media player is destroyed we call gst_element_set_state(m_pipeline.get(), GST_STATE_NULL); and very often that blocks in internal GST mutexes. With our main thread blocked on this, any other thread waiting for a mutex held by the main thread will lock as well causing this deadlock.
Comment 10 Carlos Garcia Campos 2017-03-01 03:28:46 PST
Created attachment 303057 [details]
Patch

This patch fixes the timeout for me
Comment 11 Xabier Rodríguez Calvar 2017-03-01 07:40:01 PST
Comment on attachment 303057 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=303057&action=review

As you're writing the code, it should be affecting other private players such as the WebRTC and the MSE ones. Please ensure that no tests are broken

> Source/WebCore/ChangeLog:8
> +        The timeout happens normally when the media player is and the pipeline state is set to NULL. The call to

This first sentence does not make too much sense to me.

> Source/WebCore/ChangeLog:10
> +        happens with the smaple mutex used by VideoRenderRequestScheduler. VideoRenderRequestScheduler::requestRender()

smaple -> sample.

> Source/WebCore/ChangeLog:21
> +        ~MediaPlayerPrivateGStreamerBase and ensure the draw timer and mutex is proplery cleaned up before.

is proplery -> are properly
Comment 12 Carlos Garcia Campos 2017-03-01 08:52:55 PST
*** Bug 163850 has been marked as a duplicate of this bug. ***
Comment 13 Carlos Garcia Campos 2017-03-01 08:56:08 PST
*** Bug 169025 has been marked as a duplicate of this bug. ***
Comment 14 Carlos Garcia Campos 2017-03-01 09:03:14 PST
(In reply to comment #11)
> Comment on attachment 303057 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=303057&action=review
> 
> As you're writing the code, it should be affecting other private players
> such as the WebRTC and the MSE ones. Please ensure that no tests are broken
> 
> > Source/WebCore/ChangeLog:8
> > +        The timeout happens normally when the media player is and the pipeline state is set to NULL. The call to
> 
> This first sentence does not make too much sense to me.

It doesn't make any sense :-)

> > Source/WebCore/ChangeLog:10
> > +        happens with the smaple mutex used by VideoRenderRequestScheduler. VideoRenderRequestScheduler::requestRender()
> 
> smaple -> sample.
> 
> > Source/WebCore/ChangeLog:21
> > +        ~MediaPlayerPrivateGStreamerBase and ensure the draw timer and mutex is proplery cleaned up before.
> 
> is proplery -> are properly
Comment 15 Carlos Garcia Campos 2017-03-01 09:06:54 PST
Committed r213224: <http://trac.webkit.org/changeset/213224>