Bug 232857 - ASSERT NOT REACHED under WebKit::Daemon::ConnectionToMachService seen with TestWebKitAPI.WebPushD.BasicCommunication and PermissionManagement
Summary: ASSERT NOT REACHED under WebKit::Daemon::ConnectionToMachService seen with Te...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-11-08 16:14 PST by Ryan Haddad
Modified: 2022-01-04 11:22 PST (History)
6 users (show)

See Also:


Attachments
Patch (9.00 KB, patch)
2021-12-20 09:28 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (11.27 KB, patch)
2021-12-20 14:54 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (12.12 KB, patch)
2021-12-20 22:03 PST, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Haddad 2021-11-08 16:14:52 PST
The following two tests have been asserting on Monterey debug bots since they were brought up

    TestWebKitAPI.WebPushD.BasicCommunication
    TestWebKitAPI.WebPushD.PermissionManagement
        Failed to connect to mach service org.webkit.webpushtestdaemon.service, reason: failed at lookup with error 3 - No such process
        SHOULD NEVER BE REACHED
        /Volumes/Data/worker/monterey-debug/build/Source/WebKit/Platform/IPC/cocoa/DaemonConnectionCocoa.mm(101) : auto WebKit::Daemon::ConnectionToMachService<WebKit::WebPushD::ConnectionTraits>::sendWithReply(typename ConnectionTraits::MessageType, WebKit::Daemon::EncodedMessage &&, CompletionHandler<void (WebKit::Daemon::EncodedMessage &&)> &&)::(anonymous class)::operator()(xpc_object_t) [Traits = WebKit::WebPushD::ConnectionTraits]
        1   0x154feb3e9 WTFCrash
        2   0x13176a6cb WTFCrashWithInfo(int, char const*, char const*, int)
        3   0x132377bb9 WebKit::Daemon::ConnectionToMachService<WebKit::WebPushD::ConnectionTraits>::sendWithReply(WebKit::WebPushD::MessageType, WTF::Vector<unsigned char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&, WTF::CompletionHandler<void (WTF::Vector<unsigned char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)>&&) const::'lambda'(NSObject<OS_xpc_object>*)::operator()(NSObject<OS_xpc_object>*)
        4   0x132377ac1 WTF::Detail::CallableWrapper<WebKit::Daemon::ConnectionToMachService<WebKit::WebPushD::ConnectionTraits>::sendWithReply(WebKit::WebPushD::MessageType, WTF::Vector<unsigned char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&, WTF::CompletionHandler<void (WTF::Vector<unsigned char, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)>&&) const::'lambda'(NSObject<OS_xpc_object>*), void, NSObject<OS_xpc_object>*>::call(NSObject<OS_xpc_object>*)
        5   0x13236ffd7 WTF::Function<void (NSObject<OS_xpc_object>*)>::operator()(NSObject<OS_xpc_object>*) const
        6   0x13236fe37 WTF::CompletionHandler<void (NSObject<OS_xpc_object>*)>::operator()(NSObject<OS_xpc_object>*)
        7   0x13236fa9d WebKit::Daemon::Connection::sendWithReply(NSObject<OS_xpc_object>*, WTF::CompletionHandler<void (NSObject<OS_xpc_object>*)>&&) const::$_7::operator()(NSObject<OS_xpc_object>*)
        8   0x13236fcc5 WTF::BlockPtr<void (NSObject<OS_xpc_object>*)> WTF::BlockPtr<void (NSObject<OS_xpc_object>*)>::fromCallable<WebKit::Daemon::Connection::sendWithReply(NSObject<OS_xpc_object>*, WTF::CompletionHandler<void (NSObject<OS_xpc_object>*)>&&) const::$_7>(WebKit::Daemon::Connection::sendWithReply(NSObject<OS_xpc_object>*, WTF::CompletionHandler<void (NSObject<OS_xpc_object>*)>&&) const::$_7)::'lambda'(void*, NSObject<OS_xpc_object>*)::operator()(void*, NSObject<OS_xpc_object>*) const
        9   0x13236fc7d WTF::BlockPtr<void (NSObject<OS_xpc_object>*)> WTF::BlockPtr<void (NSObject<OS_xpc_object>*)>::fromCallable<WebKit::Daemon::Connection::sendWithReply(NSObject<OS_xpc_object>*, WTF::CompletionHandler<void (NSObject<OS_xpc_object>*)>&&) const::$_7>(WebKit::Daemon::Connection::sendWithReply(NSObject<OS_xpc_object>*, WTF::CompletionHandler<void (NSObject<OS_xpc_object>*)>&&) const::$_7)::'lambda'(void*, NSObject<OS_xpc_object>*)::__invoke(void*, NSObject<OS_xpc_object>*)
        10  0x7ff81398a6d5 _xpc_connection_reply_callout
        11  0x7ff81398a65d _xpc_connection_call_reply_async
        12  0x7ff813a8dd2f _dispatch_client_callout3
        13  0x7ff813aa7e5e _dispatch_mach_msg_async_reply_invoke
        14  0x7ff813a9a518 _dispatch_main_queue_callback_4CF
        15  0x7ff813d495d9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
        16  0x7ff813d0a6ae __CFRunLoopRun
        17  0x7ff813d0952d CFRunLoopRunSpecific
        18  0x7ff814b7175e -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
        19  0x7ff814bfc2c3 -[NSRunLoop(NSRunLoop) run]
        20  0x7ff813992233 _xpc_objc_main
        21  0x7ff813991c22 xpc_main
        22  0x132692b4a WebKit::XPCServiceMain(int, char const**)
        23  0x133f99d2b WKXPCServiceMain
        24  0x103f89ea2 main
        25  0x10c4cc4fe
        26  0x0
        27  0x103f86000 __dso_handle

https://results.webkit.org/?suite=api-tests&suite=api-tests&test=TestWebKitAPI.WebPushD.BasicCommunication&test=TestWebKitAPI.WebPushD.PermissionManagement
Comment 1 Radar WebKit Bug Importer 2021-11-08 16:15:37 PST
<rdar://problem/85177990>
Comment 2 Ryan Haddad 2021-11-09 09:59:10 PST
These tests are also crashing on Monterey release bots
Comment 3 Ryan Haddad 2021-11-17 15:36:03 PST
Disabled the tests in r285960
Comment 4 Alex Christensen 2021-12-20 09:28:25 PST
Created attachment 447609 [details]
Patch
Comment 5 Alex Christensen 2021-12-20 14:54:48 PST
Created attachment 447647 [details]
Patch
Comment 6 Darin Adler 2021-12-20 18:03:47 PST
Comment on attachment 447647 [details]
Patch

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

> Tools/TestWebKitAPI/Tests/WebKitCocoa/WKInspectorExtensionDelegate.mm:-175
> -// FIXME: Re-enable this test for debug once webkit.org/b/231847 is fixed.
> -#if !defined(NDEBUG)
>  TEST(WKInspectorExtensionDelegate, DISABLED_InspectedPageNavigatedCallbacks)
> -#else
> -TEST(WKInspectorExtensionDelegate, InspectedPageNavigatedCallbacks)
> -#endif

Just noticed this is disabled. Doesn’t mention that above in the change log.
Comment 7 Alex Christensen 2021-12-20 21:50:13 PST
(In reply to Darin Adler from comment #6)
> > -TEST(WKInspectorExtensionDelegate, InspectedPageNavigatedCallbacks)
> > -#endif
> 
> Just noticed this is disabled. Doesn’t mention that above in the change log.
Oops, and it still times out in debug.  Will leave alone in this patch.
Comment 8 Alex Christensen 2021-12-20 22:03:48 PST
Created attachment 447689 [details]
Patch
Comment 9 Alex Christensen 2021-12-21 08:28:49 PST
r287316
Comment 10 Alex Christensen 2021-12-21 20:03:54 PST
Comment on attachment 447689 [details]
Patch

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

> Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:240
> +#if PLATFORM(MAC) && !USE(APPLE_INTERNAL_SDK) && __MAC_OS_X_VERSION_MIN_REQUIRED < 120000

https://results.webkit.org/?suite=api-tests&suite=api-tests&suite=api-tests&test=TestWebKitAPI.WebPushD.BasicCommunication&test=TestWebKitAPI.WebPushD.HandleInjectedPush&test=TestWebKitAPI.WebPushD.PermissionManagement
This was incorrect.  It wasn't passing for me because I was on Monterey, it was passing for me because I had an apple silicon Mac.
Comment 11 Alex Christensen 2021-12-21 20:09:47 PST
r287341
Comment 12 Alex Christensen 2021-12-21 22:28:27 PST
r287347
Comment 13 Alex Christensen 2022-01-04 11:22:25 PST
r287580