Bug 240024 - REGRESSION (r293427): [ iOS ] http/tests/quicklook/same-origin-xmlhttprequest-allowed.html is a constant crash and failure
Summary: REGRESSION (r293427): [ iOS ] http/tests/quicklook/same-origin-xmlhttprequest...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Karl Rackler
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-05-03 10:40 PDT by Karl Rackler
Modified: 2022-05-11 09:49 PDT (History)
12 users (show)

See Also:


Attachments
Patch (5.02 KB, patch)
2022-05-03 15:24 PDT, Kate Cheney
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (5.02 KB, patch)
2022-05-03 15:41 PDT, Kate Cheney
no flags Details | Formatted Diff | Diff
Patch for landing (5.09 KB, patch)
2022-05-04 12:20 PDT, Kate Cheney
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Rackler 2022-05-03 10:40:12 PDT
Description:
http/tests/quicklook/same-origin-xmlhttprequest-allowed.html

This test is constant failing one [ iOS Release ] and constant crashing on [ iOS Debug ].  The first failure that I saw on the dashboard was 4/26/2022 r293432, but does not seem relevant. 

Commit r293427 at Canonical link: https://commits.webkit.org/249987@main | git-svn-id: https://svn.webkit.org/repository/webkit/trunk@293427 268f45cc-cd09-0410-ab3c-d52691b4dbfc modified some files that seem to have introduced the constant failures and crashes. 

REPRODUCTION STEPS
I can reproduce this constant failure and constant crash on r293427, but am unable to reproduce it on r293426 or earlier.

[ iOS Release ]
Command: 
run-webkit-tests --root 293427 --ios-simulator --exit-after-n-failures 1 --exit-after-n-crashes-or-timeouts 1 --iterations 50 --no-retry http/tests/quicklook/same-origin-xmlhttprequest-allowed.html

Result: 
Regressions: Unexpected text-only failures (1)
  http/tests/quicklook/same-origin-xmlhttprequest-allowed.html [ Failure ]

[ iOS Debug ]
Command: 
run-webkit-tests --root 293427-debug  --ios-simulator --debug --exit-after-n-failures 1 --exit-after-n-crashes-or-timeouts 1 --iterations 50 --no-retry http/tests/quicklook/same-origin-xmlhttprequest-allowed.html

Result: 
Regressions: Unexpected crashes (1)
  http/tests/quicklook/same-origin-xmlhttprequest-allowed.html [ Crash ]

History:
https://results.webkit.org/?suite=layout-tests&test=http%2Ftests%2Fquicklook%2Fsame-origin-xmlhttprequest-allowed.html&platform=ios&limit=50000

[ iOS Release ]
Diff:
--- /Volumes/Data/worker/Apple-iOS-15-Simulator-Release-WK2-Tests/build/layout-test-results/http/tests/quicklook/same-origin-xmlhttprequest-allowed-expected.txt
+++ /Volumes/Data/worker/Apple-iOS-15-Simulator-Release-WK2-Tests/build/layout-test-results/http/tests/quicklook/same-origin-xmlhttprequest-allowed-actual.txt
@@ -1,6 +1,4 @@
-CONSOLE MESSAGE: Refused to connect to about: because it appears in neither the connect-src directive nor the default-src directive of the Content Security Policy.
-CONSOLE MESSAGE: Blocked by Content Security Policy.
-CONSOLE MESSAGE: XMLHttpRequest cannot load about: due to access control checks.
+CONSOLE MESSAGE: Refused to connect to http://127.0.0.1:8000/x-apple-ql-magic/same-origin-xmlhttprequest-allowed.rtf because it appears in neither the connect-src directive nor the default-src directive of the Content Security Policy.
 CONSOLE MESSAGE: PASS: XMLHttpRequest allowed

[ iOS Debug ]
Crash Log: 
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0  com.apple.JavaScriptCore   	       0x7acc2553e    WTFCrash
1  com.apple.WebCore          	       0x7d57edec8    WTFCrashWithInfo(int, char const*, char const*, int)
2  com.apple.WebCore          	       0x7d9fa5c08    WebCore::ContentSecurityPolicy::copyStateFrom(WebCore::ContentSecurityPolicy const*)
3  com.apple.WebCore          	       0x7d8e9620c    WebCore::Document::initSecurityContext()
4  com.apple.WebCore          	       0x7d8e938f0    WebCore::Document::Document(WebCore::Frame*, WebCore::Settings const&, WTF::URL const&, WTF::OptionSet<WebCore::Document::DocumentClass>, unsigned int, WebCore::ProcessQualified<WTF::UUID>)
5  com.apple.WebCore          	       0x7d93c7abc    WebCore::HTMLDocument::HTMLDocument(WebCore::Frame*, WebCore::Settings const&, WTF::URL const&, WebCore::ProcessQualified<WTF::UUID>, WTF::OptionSet<WebCore::Document::DocumentClass>, unsigned int)
Comment 1 Radar WebKit Bug Importer 2022-05-03 10:40:34 PDT
<rdar://problem/92678727>
Comment 2 Karl Rackler 2022-05-03 13:23:28 PDT
I have marked this test as a consistent failure and crash while this issue is investigated.
Comment 3 Karl Rackler 2022-05-03 13:58:49 PDT
Pull request: https://github.com/WebKit/WebKit/pull/479
Comment 4 EWS 2022-05-03 14:02:16 PDT
Test gardening commit r293738 (250226@main): <https://commits.webkit.org/250226@main>

Reviewed commits have been landed. Closing PR #479 and removing active labels.
Comment 5 Kate Cheney 2022-05-03 15:24:30 PDT
Created attachment 458760 [details]
Patch
Comment 6 Kate Cheney 2022-05-03 15:41:12 PDT
Created attachment 458761 [details]
Patch
Comment 7 Wenson Hsieh 2022-05-04 08:12:48 PDT
Comment on attachment 458761 [details]
Patch

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

Looks reasonable to me!

(It would be nice if Alex, Brady, and/or Chris could take a look too)

> Source/WebCore/loader/DocumentLoader.cpp:1217
> +bool DocumentLoader::isLoadingRemoteArchive()

Nit - mark this const?

> Source/WebCore/loader/DocumentLoader.h:507
> +    bool isLoadingRemoteArchive();

(const here too)
Comment 8 Kate Cheney 2022-05-04 12:20:55 PDT
Created attachment 458820 [details]
Patch for landing
Comment 9 EWS 2022-05-04 14:19:55 PDT
Committed r293790 (250267@main): <https://commits.webkit.org/250267@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 458820 [details].
Comment 10 Karl Rackler 2022-05-11 09:49:11 PDT
Verified http/tests/quicklook/same-origin-xmlhttprequest-allowed.html is no longer crashing and failing.

History:
https://results.webkit.org/?suite=layout-tests&test=http%2Ftests%2Fquicklook%2Fsame-origin-xmlhttprequest-allowed.html&platform=ios&limit=50000