Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 12 and 13 crash upon launch #2

Closed
shadowscott opened this issue Apr 30, 2023 · 4 comments
Closed

iOS 12 and 13 crash upon launch #2

shadowscott opened this issue Apr 30, 2023 · 4 comments
Labels
12.x This issue affects iOS 12 but not some other supported version 13.x This issue affects iOS 13 but not some other supported version E: Future Support Post-installation bug but this iOS doesn't have pre-alpha support yet

Comments

@shadowscott
Copy link

shadowscott commented Apr 30, 2023

Original issue report information

V0.0.6 alpha

Crash log: https://pastebin.com/2nd9weWT

System log errors:

  • Could not load the "gear" image referenced from a nib in the bundle with identifier "org.webkit.MobileMiniBrowserFramework"

  • CGBitmapContextCreateImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

@UInt2048
Copy link
Owner

This issue also applies to v0.0.5 alpha although you will receive a different error.

@shadowscott
Copy link
Author

This issue also applies to v0.0.5 alpha although you will receive a different error.

Yep I got these errors on both alpha 0.0.5q and 0.0.6 but as you said on reddit it was the same build. Saw that you wanted to move things to github so I posted here.

UInt2048 pushed a commit that referenced this issue May 11, 2023
https://bugs.webkit.org/show_bug.cgi?id=254137

Reviewed by Antti Koivisto.

This checks the unexpected state when
1, inline content is damaged by destroyed renderer(s)
2, we fail to mark the containing block dirty (see webkit.org/b/254090)
3, subsequent layout does not reach the damaged inline content (see #2)
4, inline display content becomes stale

* Source/WebCore/layout/formattingContexts/inline/invalidation/InlineDamage.h:
(WebCore::Layout::InlineDamage::hasDetachedContent const):
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.h:
(WebCore::LayoutIntegration::LineLayout::hasDetachedContent const):
* Source/WebCore/page/LocalFrameViewLayoutContext.cpp:
(WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker):
(WebCore::LocalFrameViewLayoutContext::performLayout):

Canonical link: https://commits.webkit.org/261869@main
UInt2048 pushed a commit that referenced this issue May 11, 2023
https://bugs.webkit.org/show_bug.cgi?id=254992
rdar://107202864

Reviewed by Eric Carlson.

Clients of the prefixed WebKit EME APIs using the Fairplay "V2" protocol will use
a CDM implementation that relies upon AVStreamSession. This implementation will
break when "sampleBufferContentKeySessionSupport" is enabled, as it relies upon
platform changes only available through AVContentKeySession.

Remove the AVStreamSession-based CDM implementation and funnel all support through
the existing AVContentKeySession-based legacy CDM. At the same time, modify that
AVContentKeySession-based CDM to query the "sampleBufferContentKeySessionSupport"
setting and opt into the non-legacy AVContentKeySession path when it is enabled.

Drive-by fix: When opting into the non-legacy codepath, the
-contentKeySession:didProvideContentKeyRequest: delegate callbock becomes asynchronous.
To retain the existing synchronous behavior of the CDM, set an explicit work queue
for the delegate callbacks, and make the setting and getting of m_keyRequest thread-safe.
Add a semaphore to be used to detect when the m_keyRequest value changes.

Drive-by fix #2: Fix some unified-build included errors exposed by removing
CDMSessionAVStreamSession.h

Add LayoutTests for basic legacy EME API playback.

* LayoutTests/http/tests/media/fairplay/legacy-eme.js: Added.
(selectKeySystem):
(async startLegacyEME):
(extractContentId):
(concatInitDataIdAndCertificate):
* LayoutTests/http/tests/media/fairplay/legacy-fairplay-error-expected.txt: Added.
* LayoutTests/http/tests/media/fairplay/legacy-fairplay-error.html: Added.
* LayoutTests/http/tests/media/fairplay/legacy-fairplay-hls-expected.txt: Added.
* LayoutTests/http/tests/media/fairplay/legacy-fairplay-hls.html: Added.
* LayoutTests/http/tests/media/fairplay/legacy-fairplay-mse-v2-expected.txt: Added.
* LayoutTests/http/tests/media/fairplay/legacy-fairplay-mse-v2.html: Added.
* LayoutTests/http/tests/media/fairplay/legacy-fairplay-mse-v3-expected.txt: Added.
* LayoutTests/http/tests/media/fairplay/legacy-fairplay-mse-v3.html: Added.
* LayoutTests/http/tests/media/fairplay/support.js:
(uInt16ArrayToString):
(stringToUint16Array):
* Source/WTF/wtf/PlatformHave.h:
* Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDM.cpp:
(WebCore::platformRegisterFactories):
* Source/WebCore/PAL/pal/cocoa/AVFoundationSoftLink.h:
* Source/WebCore/PAL/pal/cocoa/AVFoundationSoftLink.mm:
* Source/WebCore/SourcesCocoa.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/graphics/LegacyCDMSession.h:
* Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
(WebCore::queryDecoderAvailability):
(WebCore::CDMPrivateMediaSourceAVFObjC::createSession):
* Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
* Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(-[WebCDMSessionAVContentKeySessionDelegate contentKeySessionContentProtectionSessionIdentifierDidChange:]):
(WebCore::CDMSessionAVContentKeySession::CDMSessionAVContentKeySession):
(WebCore::CDMSessionAVContentKeySession::update):
(WebCore::CDMSessionAVContentKeySession::hasContentKeyRequest const):
(WebCore::CDMSessionAVContentKeySession::contentKeyRequest):
(WebCore::CDMSessionAVContentKeySession::didProvideContentKeyRequest):
(WebCore::CDMSessionAVContentKeySession::contentKeySession):
* Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h: Removed.
* Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: Removed.
* Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
(WebCore::toCDMSessionMediaSourceAVFObjC):
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::hasStreamSession): Deleted.
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::streamSession): Deleted.
* Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackId):
(WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::destroyStreamDataParser):
(WebCore::copyKeyIDs): Deleted.
* Tools/TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm:
(TestWebKitAPI::TEST):

Canonical link: https://commits.webkit.org/262647@main
@UInt2048 UInt2048 added the E: Future Support Post-installation bug but this iOS doesn't have pre-alpha support yet label May 22, 2023
@UInt2048 UInt2048 changed the title iOS 13 crashes upon launch iOS 12 and 13 crash upon launch Jun 25, 2023
@UInt2048
Copy link
Owner

The release of 0.0.7 alpha is because of #5. iOS 12 and 13 are still unfortunately not supported yet.

@UInt2048
Copy link
Owner

If you expected "officially working" by the time you read this message, I unfortunately cannot say that is the case. However, for a while now, this issue has been more broadly interpreted than its original meaning of a crash on iOS 13 within a few seconds of launch.

I presume you will observe at minimum that tonight's 0.0.7 nightly release demonstrates this no longer occurs, which means this issue is now closed.

@shadowscott Please feel free to test different sites and report new issues based on the conditions you observe.

UInt2048 pushed a commit that referenced this issue Oct 2, 2023
https://bugs.webkit.org/show_bug.cgi?id=261741
<rdar://112494003>

Reviewed by Antti Koivisto.

1. we do _not_ construct renderers for “display: none” iframes
2. we do construct render tree for the “display: none” iframe’s content

we do #2 because JS may ask for geometry information on content inside a “display: none” iframe.

e.g.
<div><iframe srcdoc=“text” style="display: none;" id=iframe></iframe></div>

where:
iframe.contentDocument.body.offsetHeight should return the value of “18px”

the markup above triggers the following 2 render trees:

Main document:
  RenderView
    HTML RenderBlock
      BODY RenderBody
        DIV RenderBlock

(^^ no renderer here for the “display: none” iframe)

iframe document:
  RenderView
    HTML RenderBlock
      BODY RenderBody
        #text RenderText

(^^ this is the content _inside_ the "display: none" iframe)

We not only construct a render tree for the invisible iframe content, but also (as part of the tree construction) we schedule an async layout on them
This patch drops such async layout requests on the floor and keep the renderers dirty until after either
1. sync layout is triggered (JS -> DOM API)
2. iframe becomes visible (display != none)

* LayoutTests/fast/dynamic/display-none-iframe-async-layout-expected.html: Added.
* LayoutTests/fast/dynamic/display-none-iframe-async-layout.html: Added.
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::shouldScheduleLayout const):

Canonical link: https://commits.webkit.org/268148@main
@UInt2048 UInt2048 added this to the CyberKit v0.0.8 alpha milestone Oct 15, 2023
@UInt2048 UInt2048 added 12.x This issue affects iOS 12 but not some other supported version 13.x This issue affects iOS 13 but not some other supported version labels Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
12.x This issue affects iOS 12 but not some other supported version 13.x This issue affects iOS 13 but not some other supported version E: Future Support Post-installation bug but this iOS doesn't have pre-alpha support yet
Projects
None yet
Development

No branches or pull requests

2 participants