Bug 231256

Summary: ASSERTION FAILED: This HTTPServer does not know how to respond to a request for /popup-after-redirection.html
Product: WebKit Reporter: Robert Jenner <jenner>
Component: New BugsAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, cdumez, webkit-bot-watchers-bugzilla, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Robert Jenner 2021-10-05 14:47:04 PDT
The following api-tests are constantly crashing starting on iOS 15 Debug:

TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPAndCOEPSameOriginToCOOPSameOrigin
TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOrigin
TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOrigin2
TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOrigin3
TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOriginAllowPopup
TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOriginAllowPopup2
TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOriginAllowPopup3
TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOriginAllowPopup4
TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOriginToCOOPAndCOEPSameOrigin
TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOriginToCOOPSameOrigin
TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOriginToCOOPSameOrigin2
TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOriginToCOOPSameOrigin3
TestWebKitAPI.ProcessSwap.NavigatingSameOriginToCOOPAndCOEPSameOrigin
TestWebKitAPI.ProcessSwap.NavigatingSameOriginToCOOPSameOrigin
TestWebKitAPI.ProcessSwap.NavigatingSameOriginToCOOPSameOrigin2
TestWebKitAPI.ProcessSwap.NavigatingSameOriginToCOOPSameOrigin3
TestWebKitAPI.ProcessSwap.NavigatingSameOriginToCOOPSameOrigin4

HISTORY:
https://results.webkit.org/?suite=api-tests&suite=api-tests&suite=api-tests&suite=api-tests&suite=api-tests&suite=api-tests&suite=api-tests&suite=api-tests&suite=api-tests&suite=api-tests&suite=api-tests&suite=api-tests&suite=api-tests&suite=api-tests&suite=api-tests&suite=api-tests&suite=api-tests&suite=api-tests&test=TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPAndCOEPSameOriginToCOOPSameOrigin&test=TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOrigin&test=TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOrigin2&test=TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOrigin3&test=TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOriginAllowPopup&test=TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOriginAllowPopup2&test=TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOriginAllowPopup3&test=TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOriginAllowPopup4&test=TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOriginToCOOPAndCOEPSameOrigin&test=TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOriginToCOOPSameOrigin&test=TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOriginToCOOPSameOrigin2&test=TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOriginToCOOPSameOrigin3&test=TestWebKitAPI.ProcessSwap.NavigatingSameOriginFromCOOPSameOriginToCOOPSameOriginWithRedirect&test=TestWebKitAPI.ProcessSwap.NavigatingSameOriginToCOOPAndCOEPSameOrigin&test=TestWebKitAPI.ProcessSwap.NavigatingSameOriginToCOOPSameOrigin&test=TestWebKitAPI.ProcessSwap.NavigatingSameOriginToCOOPSameOrigin2&test=TestWebKitAPI.ProcessSwap.NavigatingSameOriginToCOOPSameOrigin3&test=TestWebKitAPI.ProcessSwap.NavigatingSameOriginToCOOPSameOrigin4&platform=iOS

It appears they all started crashing when we updated our queues from iOS 14 to iOS 15. 


Everyone appears to have the same Assertion:
 ASSERTION FAILED: This HTTPServer does not know how to respond to a request for /popup-after-redirection.html
        requestData->requestMap.contains(path)
        /Volumes/Data/worker/ios-simulator-15-debug/build/Tools/TestWebKitAPI/cocoa/HTTPServer.mm(283) : auto TestWebKitAPI::HTTPServer::respondToRequests(TestWebKitAPI::Connection, Ref<TestWebKitAPI::HTTPServer::RequestData>)::(anonymous class)::operator()(Vector<char> &&)
        1   0x11dc98e99 WTFCrash
        2   0x10e3ea491 TestWebKitAPI::HTTPServer::respondToRequests(TestWebKitAPI::Connection, WTF::Ref<TestWebKitAPI::HTTPServer::RequestData, WTF::RawPtrTraits<TestWebKitAPI::HTTPServer::RequestData> >)::$_8::operator()(WTF::Vector<char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)
        3   0x10e3ea2c1 WTF::Detail::CallableWrapper<TestWebKitAPI::HTTPServer::respondToRequests(TestWebKitAPI::Connection, WTF::Ref<TestWebKitAPI::HTTPServer::RequestData, WTF::RawPtrTraits<TestWebKitAPI::HTTPServer::RequestData> >)::$_8, void, WTF::Vector<char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&>::call(WTF::Vector<char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)
        4   0x10e3ecc47 WTF::Function<void (WTF::Vector<char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)>::operator()(WTF::Vector<char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&) const
        5   0x10e3ec654 WTF::CompletionHandler<void (WTF::Vector<char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)>::operator()(WTF::Vector<char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)
        6   0x10e3ec446 TestWebKitAPI::Connection::receiveHTTPRequest(WTF::CompletionHandler<void (WTF::Vector<char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)>&&, WTF::Vector<char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&) const::$_9::operator()(WTF::Vector<unsigned char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)
        7   0x10e3ec1e1 WTF::Detail::CallableWrapper<TestWebKitAPI::Connection::receiveHTTPRequest(WTF::CompletionHandler<void (WTF::Vector<char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)>&&, WTF::Vector<char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&) const::$_9, void, WTF::Vector<unsigned char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&>::call(WTF::Vector<unsigned char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)
        8   0x10e3e4337 WTF::Function<void (WTF::Vector<unsigned char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)>::operator()(WTF::Vector<unsigned char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&) const
        9   0x10e3e4004 WTF::CompletionHandler<void (WTF::Vector<unsigned char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)>::operator()(WTF::Vector<unsigned char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)
        10  0x10e3e3b9d TestWebKitAPI::Connection::receiveBytes(WTF::CompletionHandler<void (WTF::Vector<unsigned char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)>&&, unsigned long) const::$_3::operator()(NSObject<OS_dispatch_data>*, NSObject<OS_nw_content_context>*, bool, NSObject<OS_nw_error>*)
        11  0x10e3e3e66 WTF::BlockPtr<void (NSObject<OS_dispatch_data>*, NSObject<OS_nw_content_context>*, bool, NSObject<OS_nw_error>*)> WTF::BlockPtr<void (NSObject<OS_dispatch_data>*, NSObject<OS_nw_content_context>*, bool, NSObject<OS_nw_error>*)>::fromCallable<TestWebKitAPI::Connection::receiveBytes(WTF::CompletionHandler<void (WTF::Vector<unsigned char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)>&&, unsigned long) const::$_3>(TestWebKitAPI::Connection::receiveBytes(WTF::CompletionHandler<void (WTF::Vector<unsigned char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)>&&, unsigned long) const::$_3)::'lambda'(void*, NSObject<OS_dispatch_data>*, NSObject<OS_nw_content_context>*, bool, NSObject<OS_nw_error>*)::operator()(void*, NSObject<OS_dispatch_data>*, NSObject<OS_nw_content_context>*, bool, NSObject<OS_nw_error>*) const
        12  0x10e3e3dcd WTF::BlockPtr<void (NSObject<OS_dispatch_data>*, NSObject<OS_nw_content_context>*, bool, NSObject<OS_nw_error>*)> WTF::BlockPtr<void (NSObject<OS_dispatch_data>*, NSObject<OS_nw_content_context>*, bool, NSObject<OS_nw_error>*)>::fromCallable<TestWebKitAPI::Connection::receiveBytes(WTF::CompletionHandler<void (WTF::Vector<unsigned char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)>&&, unsigned long) const::$_3>(TestWebKitAPI::Connection::receiveBytes(WTF::CompletionHandler<void (WTF::Vector<unsigned char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)>&&, unsigned long) const::$_3)::'lambda'(void*, NSObject<OS_dispatch_data>*, NSObject<OS_nw_content_context>*, bool, NSObject<OS_nw_error>*)::__invoke(void*, NSObject<OS_dispatch_data>*, NSObject<OS_nw_content_context>*, bool, NSObject<OS_nw_error>*)
        13  0x11394f5cc _dispatch_block_async_invoke2
        14  0x113941a56 _dispatch_client_callout
        15  0x11394ee20 _dispatch_main_queue_callback_4CF
        16  0x11679085d __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
        17  0x11678b0ba __CFRunLoopRun
        18  0x11678a103 CFRunLoopRunSpecific
        19  0x114d3041c -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
        20  0x10e9918a3 TestWebKitAPI::Util::run(bool*)
        21  0x10e65a68b runCOOPProcessSwapTest(char const*, char const*, char const*, char const*, IsSameOrigin, DoServerSideRedirect, ExpectSwap)
        22  0x10e65c556 ProcessSwap_NavigatingSameOriginFromCOOPAndCOEPSameOriginToCOOPSameOrigin_Test::TestBody()
        23  0x10eb8080b void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*)
        24  0x10eb57fba void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*)
        25  0x10eb57f03 testing::Test::Run()
        26  0x10eb58f91 testing::TestInfo::Run()
        27  0x10eb5a014 testing::TestSuite::Run()
        28  0x10eb68c0f testing::internal::UnitTestImpl::RunAllTests()
        29  0x10eb84beb bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*)
        30  0x10eb685ea bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*)
        31  0x10eb684cb testing::UnitTest::Run()
        Child process terminated with signal 11: Segmentation fault
Comment 1 Radar WebKit Bug Importer 2021-10-05 14:47:42 PDT
<rdar://problem/83904937>
Comment 2 Robert Jenner 2021-10-05 15:57:47 PDT
I was able to reproduce these assertions on iOS 15-simulator 19A402 Debug ToT, using the following test:

run-api-tests --ios-simulator --debug --verbose TestWebKitAPI.ProcessSwap
Comment 3 Chris Dumez 2021-10-06 12:13:24 PDT
Created attachment 440409 [details]
Patch
Comment 4 Chris Dumez 2021-10-06 12:14:05 PDT
Created attachment 440411 [details]
Patch
Comment 5 Alex Christensen 2021-10-06 12:30:27 PDT
Comment on attachment 440411 [details]
Patch

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

> Tools/TestWebKitAPI/cocoa/HTTPServer.h:55
> +    void addResponse(String&& url, HTTPResponse&&);

This isn't a URL, it's a path.

> Tools/TestWebKitAPI/cocoa/HTTPServer.mm:177
> +    m_requestData->requestMap.add(WTFMove(url), WTFMove(response));

It might be worth asserting that we don't already have this path.  If someone hits that assertion, it's probably a bug in their test.
Comment 6 Chris Dumez 2021-10-06 12:35:27 PDT
Created attachment 440416 [details]
Patch
Comment 7 EWS 2021-10-07 07:55:51 PDT
Committed r283710 (242636@main): <https://commits.webkit.org/242636@main>

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