Bug 241653

Summary: New test: [macOS/iOS arm64] TestWebKitAPI.WKContentRuleListStoreTest.CrossOriginCookieBlocking is crashing
Product: WebKit Reporter: Ryan Haddad <ryanhaddad>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, cdumez, darin, rackler, webkit-bot-watchers-bugzilla, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: Safari 13   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=241527
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Ryan Haddad 2022-06-15 16:14:38 PDT
This test appears to have been crashing on release bots since it was added with https://commits.webkit.org/251478@main

    TestWebKitAPI.WKContentRuleListStoreTest.CrossOriginCookieBlocking
        2022-06-15 13:06:59.429 com.apple.WebKit.Networking.Development[18874:37711573] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///Users/buildbot/Library/Developer/CoreSimulator/Devices/98B5DF45-8DBE-439A-A3A4-E96932F8FE06/data/Library/Cookies/Cookies.binarycookies
        Child process terminated with signal 5: Trace/BPT trap
        [18873] pas panic: deallocation did fail at 0x2: Large heap did not find object

https://results.webkit.org/?suite=api-tests&test=TestWebKitAPI.WKContentRuleListStoreTest.CrossOriginCookieBlocking
Comment 1 Radar WebKit Bug Importer 2022-06-15 16:14:48 PDT
<rdar://problem/95247117>
Comment 2 Ryan Haddad 2022-06-15 16:16:31 PDT
Actually, this is arm64 specific.
Comment 3 Alex Christensen 2022-06-16 12:08:04 PDT
Strange.  This has something to do with this line:

return HTTPResponse({ { "Set-Cookie"_s, "testCookie=42; Path=/; SameSite=None; Secure"_s } }, "<script>alert('hi')</script>"_s);

If I write it out by making a HashMap<String, String>, add to it, then move it to the HTTPResponse constructor it works fine.  So this isn't a big deal.  I'd like to understand a bit more about this then fix it.
Comment 4 Alex Christensen 2022-06-17 09:25:59 PDT
Created attachment 460300 [details]
Patch
Comment 5 Yusuke Suzuki 2022-06-17 11:06:04 PDT
Comment on attachment 460300 [details]
Patch

r=me
Comment 6 EWS 2022-06-17 12:06:44 PDT
Committed r295642 (251647@main): <https://commits.webkit.org/251647@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 460300 [details].
Comment 7 Karl Rackler 2022-06-27 14:18:46 PDT
I have disabled this test while this issue is investigated.
Comment 9 Karl Rackler 2022-06-27 14:36:20 PDT
Reopen while under investigation.
Comment 10 EWS 2022-06-27 15:08:43 PDT
Test gardening commit 251889@main (469551ebd9f7): <https://commits.webkit.org/251889@main>

Reviewed commits have been landed. Closing PR #1833 and removing active labels.
Comment 11 Alex Christensen 2022-07-06 15:03:23 PDT
Created attachment 460724 [details]
Patch
Comment 12 Chris Dumez 2022-07-06 15:07:39 PDT
Comment on attachment 460724 [details]
Patch

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

> Tools/TestWebKitAPI/Tests/WebKitCocoa/WKContentExtensionStore.mm:217
> +    // FIXME: This is exactly equivalent code, but the code below crashes on release builds on arm64e.

Should the comment say arm64 now?
Comment 13 Yusuke Suzuki 2022-07-06 15:10:08 PDT
r=me too
Comment 14 Alex Christensen 2022-07-06 15:12:58 PDT
Comment on attachment 460724 [details]
Patch

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

>> Tools/TestWebKitAPI/Tests/WebKitCocoa/WKContentExtensionStore.mm:217
>> +    // FIXME: This is exactly equivalent code, but the code below crashes on release builds on arm64e.
> 
> Should the comment say arm64 now?

I think this is an arm64e bug, but to be conservative I'm enabling the workaround on all arm64 CPUs.
Comment 15 EWS 2022-07-06 17:41:04 PDT
Committed 252199@main (0d69815a681d): <https://commits.webkit.org/252199@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 460724 [details].
Comment 16 Alex Christensen 2022-07-07 08:36:37 PDT
Reopening to attach new patch.
Comment 17 Alex Christensen 2022-07-07 08:36:39 PDT
Created attachment 460735 [details]
Patch
Comment 18 EWS 2022-07-07 13:29:05 PDT
Committed 252239@main (051738d08e49): <https://commits.webkit.org/252239@main>

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