Bug 224395 - [iOS WK2] CADisplayLink in the web process is used unintentionally
Summary: [iOS WK2] CADisplayLink in the web process is used unintentionally
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-04-09 15:45 PDT by Simon Fraser (smfr)
Modified: 2022-03-21 12:09 PDT (History)
8 users (show)

See Also:


Attachments
Patch (4.15 KB, patch)
2021-04-09 16:37 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2021-04-09 15:45:11 PDT
When we try to make the first DisplayLink in iOS WK2, we intend to get one via the factory from the DrawingArea, but at this point m_page.drawingArea() is null (we're inside the RemoteLayerTreeDrawingArea ctor) so we end up falling back to DisplayRefreshMonitorIOS which is supposed to only be used for WebKit1.

  * frame #0: 0x0000000289db17b0 WebKit`WebKit::WebChromeClient::displayRefreshMonitorFactory(this=0x00007fa097632e50) const at WebChromeClient.cpp:918:12
    frame #1: 0x00000002ad29c4e3 WebCore`WebCore::Page::windowScreenDidChange(this=0x00007fa08780fa00, displayID=4294967273, nominalFramesPerSecond=Optional<unsigned int> @ 0x00007ffee03807f8) at Page.cpp:1188:153
    frame #2: 0x00000002ad1a91f0 WebCore`WebCore::Chrome::windowScreenDidChange(this=0x00007fa0976320c0, displayID=4294967273, nominalFrameInterval=<unavailable>) at Chrome.cpp:551:12
    frame #3: 0x000000028a03ef8e WebKit`WebKit::WebPage::windowScreenDidChange(this=0x00007fa0b780f208, displayID=4294967273, nominalFramesPerSecond=Optional<unsigned int> @ 0x00007ffee0380930) at WebPage.cpp:2138:22
    frame #4: 0x0000000288792135 WebKit`WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea(this=0x00007fa0a7518900, webPage=0x00007fa0b780f208, parameters=0x00007ffee0381420) at RemoteLayerTreeDrawingArea.mm:75:13
    frame #5: 0x00000002887935f5 WebKit`WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea(this=0x00007fa0a7518900, webPage=0x00007fa0b780f208, parameters=0x00007ffee0381420) at RemoteLayerTreeDrawingArea.mm:64:1
    frame #6: 0x0000000289e33699 WebKit`std::__1::__unique_if<WebKit::RemoteLayerTreeDrawingArea>::__unique_single std::__1::make_unique<WebKit::RemoteLayerTreeDrawingArea, WebKit::WebPage&, WebKit::WebPageCreationParameters const&>(__args=0x00007fa0b780f208, __args=0x00007ffee0381420) at memory:2755:32
    frame #7: 0x0000000289e30e6b WebKit`decltype(args=0x00007fa0b780f208, args=0x00007ffee0381420) WTF::makeUnique<WebKit::RemoteLayerTreeDrawingArea, WebKit::WebPage&, WebKit::WebPageCreationParameters const&>(WebKit::WebPage&, WebKit::WebPageCreationParameters const&) at StdLibExtras.h:507:12
    frame #8: 0x0000000289e30de6 WebKit`WebKit::DrawingArea::create(webPage=0x00007fa0b780f208, parameters=0x00007ffee0381420) at DrawingArea.cpp:56:16
    frame #9: 0x000000028a03090b WebKit`WebKit::WebPage::WebPage(this=0x00007fa0b780f208, pageID=(m_identifier = 22), parameters=0x00007ffee0381420) at WebPage.cpp:652:21
    frame #10: 0x000000028a02edd5 WebKit`WebKit::WebPage::WebPage(this=0x00007fa0b780f208, pageID=(m_identifier = 22), parameters=0x00007ffee0381420) at WebPage.cpp:529:1
    frame #11: 0x000000028a02ecc8 WebKit`WebKit::WebPage::create(pageID=(m_identifier = 22), parameters=0x00007ffee0381420) at WebPage.cpp:427:39
    frame #12: 0x0000000289a25764 WebKit`WebKit::WebProcess::createWebPage(this=0x00007fa0b75042d0, pageID=(m_identifier = 22), parameters=0x00007ffee0381420) at WebProcess.cpp:758:34
    frame #13: 0x000000028a2fc3fc WebKit`void IPC::callMemberFunctionImpl<WebKit::WebProcess, void (WebKit::WebProcess::*)(WTF::ObjectIdentifier<WebCore::PageIdentifierType>, WebKit::WebPageCreationParameters&&), std::__1::tuple<WTF::ObjectIdentifier<WebCore::PageIdentifierType>, WebKit::WebPageCreationParameters>, 0ul, 1ul>(object=0x00007fa0b75042d0, function=80 56 a2 89 02 00 00 00 00 00 00 00 00 00 00 00, args=size=2, (null)=std::__1::index_sequence<0UL, 1UL> @ 0x00007ffee0381358)(WTF::ObjectIdentifier<WebCore::PageIdentifierType>, WebKit::WebPageCreationParameters&&), std::__1::tuple<WTF::ObjectIdentifier<WebCore::PageIdentifierType>, WebKit::WebPageCreationParameters>&&, std::__1::integer_sequence<unsigned long, 0ul, 1ul>) at HandleMessage.h:43:5
    frame #14: 0x000000028a2faef0 WebKit`void IPC::callMemberFunction<WebKit::WebProcess, void (WebKit::WebProcess::*)(WTF::ObjectIdentifier<WebCore::PageIdentifierType>, WebKit::WebPageCreationParameters&&), std::__1::tuple<WTF::ObjectIdentifier<WebCore::PageIdentifierType>, WebKit::WebPageCreationParameters>, std::__1::integer_sequence<unsigned long, 0ul, 1ul> >(args=size=2, object=0x00007fa0b75042d0, function=80 56 a2 89 02 00 00 00 00 00 00 00 00 00 00 00)(WTF::ObjectIdentifier<WebCore::PageIdentifierType>, WebKit::WebPageCreationParameters&&)) at HandleMessage.h:49:5
    frame #15: 0x000000028a2f531e WebKit`void IPC::handleMessage<Messages::WebProcess::CreateWebPage, WebKit::WebProcess, void (WebKit::WebProcess::*)(WTF::ObjectIdentifier<WebCore::PageIdentifierType>, WebKit::WebPageCreationParameters&&)>(decoder=0x00007fa097504310, object=0x00007fa0b75042d0, function=80 56 a2 89 02 00 00 00 00 00 00 00 00 00 00 00)(WTF::ObjectIdentifier<WebCore::PageIdentifierType>, WebKit::WebPageCreationParameters&&)) at HandleMessage.h:121:5
    frame #16: 0x000000028a2f322c WebKit`WebKit::WebProcess::didReceiveWebProcessMessage(this=0x00007fa0b75042d0, connection=0x00007fa097404150, decoder=0x00007fa097504310) at WebProcessMessageReceiver.cpp:341:16
    frame #17: 0x0000000289a26166 WebKit`WebKit::WebProcess::didReceiveMessage(this=0x00007fa0b75042d0, connection=0x00007fa097404150, decoder=0x00007fa097504310) at WebProcess.cpp:824:9
    frame #18: 0x000000028812b784 WebKit`IPC::Connection::dispatchMessage(this=0x00007fa097404150, decoder=0x00007fa097504310) at Connection.cpp:1020:14
Comment 1 Simon Fraser (smfr) 2021-04-09 16:37:16 PDT
Created attachment 425662 [details]
Patch
Comment 2 Tim Horton 2021-04-09 17:23:28 PDT
Comment on attachment 425662 [details]
Patch

Have you hosed macOS RemoteLayerTreeDrawingArea even more than it already is? I think you need something ... somewhere else, too, maybe?
Comment 3 EWS 2021-04-09 21:09:12 PDT
Committed r275792 (236363@main): <https://commits.webkit.org/236363@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 425662 [details].
Comment 4 Radar WebKit Bug Importer 2021-04-09 21:10:16 PDT
<rdar://problem/76483765>
Comment 5 Aakash Jain 2021-04-12 05:31:14 PDT
(In reply to EWS from comment #3)
> Committed r275792 (236363@main): <https://commits.webkit.org/236363@main>
Following API test seems to be failing after this commit: TestWebKitAPI.IndexedDB.DatabaseProcessKill. EWS also indicated this failure in https://ews-build.webkit.org/#/builders/9/builds/44625 

History: https://results.webkit.org/?suite=api-tests&test=TestWebKitAPI.IndexedDB.DatabaseProcessKill
Comment 6 Antoine Quint 2022-03-21 12:09:50 PDT
This caused bug 234923.