Bug 221989 - [ BigSur Debug Wk 2 ] ASSERT NOT REACHED in WebCore::DisplayList::PaintFrameForMedia::apply
Summary: [ BigSur Debug Wk 2 ] ASSERT NOT REACHED in WebCore::DisplayList::PaintFrameF...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Peng Liu
URL:
Keywords: InRadar
: 222178 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-02-16 12:55 PST by Robert Jenner
Modified: 2021-03-02 17:13 PST (History)
8 users (show)

See Also:


Attachments
Patch (1.77 KB, patch)
2021-02-20 11:10 PST, Peng Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Jenner 2021-02-16 12:55:24 PST
imported/w3c/web-platform-tests/html/editing/editing-0/contenteditable/selection-in-contentEditable-at-turning-designMode-on-off.tentative.html

is flakey crashing in BigSur Debug in Wk 2. 

HISTORY URL:
https://results.webkit.org/?suite=layout-tests&test=imported%2Fw3c%2Fweb-platform-tests%2Fhtml%2Fediting%2Fediting-0%2Fcontenteditable%2Fselection-in-contentEditable-at-turning-designMode-on-off.tentative.html&platform=mac

CRASH LOG TEXT:
No crash log found for GPUProcess:10707.

stdout:

stderr:
SHOULD NEVER BE REACHED
./platform/graphics/displaylists/DisplayListItems.cpp(817) : void WebCore::DisplayList::PaintFrameForMedia::apply(WebCore::GraphicsContext &) const
1   0x13c59ea49 WTFCrash
2   0x11e96af2b WTFCrashWithInfo(int, char const*, char const*, int)
3   0x122f27783 WebCore::DisplayList::PaintFrameForMedia::apply(WebCore::GraphicsContext&) const
4   0x122f1024e WebCore::DisplayList::ItemHandle::apply(WebCore::GraphicsContext&)
5   0x122f3304b WebCore::DisplayList::Replayer::applyItem(WebCore::DisplayList::ItemHandle)
6   0x122f33b34 WebCore::DisplayList::Replayer::replay(WebCore::FloatRect const&, bool)
7   0x10ff01b93 WebKit::RemoteRenderingBackend::submit(WebCore::DisplayList::DisplayList const&, WebCore::ImageBuffer&)
8   0x10ff01eda WebKit::RemoteRenderingBackend::nextDestinationImageBufferAfterApplyingDisplayLists(WebCore::ImageBuffer&, unsigned long, WebKit::DisplayListReaderHandle&, WebKit::GPUProcessWakeupReason)
9   0x10ff01700 WebKit::RemoteRenderingBackend::wakeUpAndApplyDisplayList(WebKit::GPUProcessWakeupMessageArguments const&)
10  0x10fec4760 void IPC::callMemberFunctionImpl<WebKit::RemoteRenderingBackend, void (WebKit::RemoteRenderingBackend::*)(WebKit::GPUProcessWakeupMessageArguments const&), std::__1::tuple<WebKit::GPUProcessWakeupMessageArguments>, 0ul>(WebKit::RemoteRenderingBackend*, void (WebKit::RemoteRenderingBackend::*)(WebKit::GPUProcessWakeupMessageArguments const&), std::__1::tuple<WebKit::GPUProcessWakeupMessageArguments>&&, std::__1::integer_sequence<unsigned long, 0ul>)
11  0x10fec3d30 void IPC::callMemberFunction<WebKit::RemoteRenderingBackend, void (WebKit::RemoteRenderingBackend::*)(WebKit::GPUProcessWakeupMessageArguments const&), std::__1::tuple<WebKit::GPUProcessWakeupMessageArguments>, std::__1::integer_sequence<unsigned long, 0ul> >(std::__1::tuple<WebKit::GPUProcessWakeupMessageArguments>&&, WebKit::RemoteRenderingBackend*, void (WebKit::RemoteRenderingBackend::*)(WebKit::GPUProcessWakeupMessageArguments const&))
12  0x10fea6776 void IPC::handleMessage<Messages::RemoteRenderingBackend::WakeUpAndApplyDisplayList, WebKit::RemoteRenderingBackend, void (WebKit::RemoteRenderingBackend::*)(WebKit::GPUProcessWakeupMessageArguments const&)>(IPC::Decoder&, WebKit::RemoteRenderingBackend*, void (WebKit::RemoteRenderingBackend::*)(WebKit::GPUProcessWakeupMessageArguments const&))
13  0x10fea63aa WebKit::RemoteRenderingBackend::didReceiveMessage(IPC::Connection&, IPC::Decoder&)
14  0x10f4f1135 IPC::Connection::dispatchWorkQueueMessageReceiverMessage(IPC::Connection::WorkQueueMessageReceiver&, IPC::Decoder&)
15  0x10f51a87a IPC::Connection::dispatchMessageToWorkQueueReceiver(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >&)::$_10::operator()()
16  0x10f51a74e WTF::Detail::CallableWrapper<IPC::Connection::dispatchMessageToWorkQueueReceiver(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >&)::$_10, void>::call()
17  0x13c5ca332 WTF::Function<void ()>::operator()() const
18  0x13c6ee8de WTF::WorkQueue::dispatch(WTF::Function<void ()>&&)::$_0::operator()() const
19  0x13c6eeae2 WTF::BlockPtr<void ()> WTF::BlockPtr<void ()>::fromCallable<WTF::WorkQueue::dispatch(WTF::Function<void ()>&&)::$_0>(WTF::WorkQueue::dispatch(WTF::Function<void ()>&&)::$_0)::'lambda'(void*)::operator()(void*) const
20  0x13c6eeab5 WTF::BlockPtr<void ()> WTF::BlockPtr<void ()>::fromCallable<WTF::WorkQueue::dispatch(WTF::Function<void ()>&&)::$_0>(WTF::WorkQueue::dispatch(WTF::Function<void ()>&&)::$_0)::'lambda'(void*)::__invoke(void*)
21  0x7fff201bc5dd _dispatch_call_block_and_release
22  0x7fff201bd7c7 _dispatch_client_callout
23  0x7fff201c35fe _dispatch_lane_serial_drain
24  0x7fff201c40cb _dispatch_lane_invoke
25  0x7fff201cdc5d _dispatch_workloop_worker_thread
26  0x7fff20365499 _pthread_wqthread
27  0x7fff20364467 start_wqthread
LEAK: 1 WebPageProxy
Comment 1 Radar WebKit Bug Importer 2021-02-16 12:55:45 PST
<rdar://problem/74403030>
Comment 2 Robert Jenner 2021-02-16 13:16:38 PST
Was not able to duplicate due to crashing being very flakey. The first reported crash occurred at r272861, but changes appear unrelated to the flakey failing test. 

Starting on Chris who added the test at r264038.
CHANGESET URL:
https://trac.webkit.org/changeset/264038/webkit
Comment 3 Wenson Hsieh 2021-02-16 16:44:22 PST
This might imply that we're unable to map to a MediaPlayer here:

bool RemoteRenderingBackend::applyMediaItem(DisplayList::ItemHandle item, GraphicsContext& context)

    ...

    auto& mediaItem = item.get<DisplayList::PaintFrameForMedia>();
    auto player = m_gpuConnectionToWebProcess->remoteMediaPlayerManagerProxy().mediaPlayer(mediaItem.identifier());
    if (!player)
        return false;
Comment 4 Ryan Haddad 2021-02-19 18:30:12 PST
*** Bug 222178 has been marked as a duplicate of this bug. ***
Comment 5 Peng Liu 2021-02-20 11:06:41 PST
(In reply to Wenson Hsieh from comment #3)
> This might imply that we're unable to map to a MediaPlayer here:
> 
> bool RemoteRenderingBackend::applyMediaItem(DisplayList::ItemHandle item,
> GraphicsContext& context)
> 
>     ...
> 
>     auto& mediaItem = item.get<DisplayList::PaintFrameForMedia>();
>     auto player =
> m_gpuConnectionToWebProcess->remoteMediaPlayerManagerProxy().
> mediaPlayer(mediaItem.identifier());
>     if (!player)
>         return false;

I think we can just return true here.
Comment 6 Peng Liu 2021-02-20 11:10:13 PST
Created attachment 421093 [details]
Patch
Comment 7 Ryan Haddad 2021-03-01 12:10:40 PST
Can we get this reviewed/landed?
Comment 8 Jer Noble 2021-03-02 16:08:45 PST
Comment on attachment 421093 [details]
Patch

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

> Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp:126
> -        return false;
> +        return true;

Nit: Can we add a WTFLogAlways() (or equivalent) with the mediaItem.identifier() to track this exceptional case?
Comment 9 Peng Liu 2021-03-02 16:22:40 PST
Comment on attachment 421093 [details]
Patch

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

>> Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp:126
>> +        return true;
> 
> Nit: Can we add a WTFLogAlways() (or equivalent) with the mediaItem.identifier() to track this exceptional case?

Filed bug 222633 to fix that.
Comment 10 Said Abou-Hallawa 2021-03-02 16:39:13 PST
Comment on attachment 421093 [details]
Patch

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

>>> Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp:126
>>> +        return true;
>> 
>> Nit: Can we add a WTFLogAlways() (or equivalent) with the mediaItem.identifier() to track this exceptional case?
> 
> Filed bug 222633 to fix that.

I think this will look better if we write it like this:

    if (auto player = m_gpuConnectionToWebProcess->remoteMediaPlayerManagerProxy().mediaPlayer(mediaItem.identifier()))
        context.paintFrameForMedia(*player, mediaItem.destination());
    return true;
Comment 11 EWS 2021-03-02 17:12:58 PST
Committed r273775: <https://commits.webkit.org/r273775>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 421093 [details].