Bug 231897 - GPU process occasionally crashes under `StreamConnectionWorkQueue::processStreams()` in layout tests
Summary: GPU process occasionally crashes under `StreamConnectionWorkQueue::processStr...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-10-18 08:58 PDT by Wenson Hsieh
Modified: 2021-10-19 16:03 PDT (History)
6 users (show)

See Also:


Attachments
Crash log (7.57 KB, text/plain)
2021-10-18 09:00 PDT, Wenson Hsieh
no flags Details
Fixes the tests (7.96 KB, patch)
2021-10-18 15:51 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2021-10-18 08:58:48 PDT
Seems to happen somewhat randomly on EWS.
Comment 1 Wenson Hsieh 2021-10-18 09:00:36 PDT
Created attachment 441611 [details]
Crash log
Comment 2 Wenson Hsieh 2021-10-18 11:15:48 PDT
I can intermittently reproduce by running the tests in `compositing` on 4 iOS 15 simulators in parallel for ~3-4 iterations.
Comment 3 Wenson Hsieh 2021-10-18 15:51:42 PDT
Created attachment 441650 [details]
Fixes the tests
Comment 4 Wenson Hsieh 2021-10-18 19:40:49 PDT
Comment on attachment 441650 [details]
Fixes the tests

Thanks for the review!
Comment 5 EWS 2021-10-18 19:44:55 PDT
Committed r284427 (243191@main): <https://commits.webkit.org/243191@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 441650 [details].
Comment 6 Radar WebKit Bug Importer 2021-10-18 19:45:20 PDT
<rdar://problem/84398678>
Comment 7 Kimmo Kinnunen 2021-10-19 00:22:24 PDT
Comment on attachment 441650 [details]
Fixes the tests

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

> Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp:102
> +    m_workQueue->stop();

Is there a reason to do the ref-related changes?
Wasn't the stop the only thing that was missing?
I don't think the ref made above lives longer than the stop.
Comment 8 Wenson Hsieh 2021-10-19 16:03:01 PDT
(In reply to Kimmo Kinnunen from comment #7)
> Comment on attachment 441650 [details]
> Fixes the tests
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=441650&action=review
> 
> > Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp:102
> > +    m_workQueue->stop();
> 
> Is there a reason to do the ref-related changes?
> Wasn't the stop the only thing that was missing?
> I don't think the ref made above lives longer than the stop.

It's true that this call to `stop()` was technically the only change required to avoid the crash.

However, given that StreamConnectionWorkQueue is ref-counted, it was also wrong to be storing `m_workQueue` directly as a member on RemoteRenderingBackend, rather than through some kind of Ref-counted template class (i.e. Ref or RefPtr).

This would be important if (for example) we were to make `stop()` non-blocking in the future.