Bug 232048 - [ iOS15 EWS ] RELEASE_ASSERT(isRunningTest(WebCore::applicationBundleIdentifier())) on http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-in-new-window.html (flaky)
Summary: [ iOS15 EWS ] RELEASE_ASSERT(isRunningTest(WebCore::applicationBundleIdentifi...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: John Wilander
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-10-20 14:36 PDT by Eric Hutchison
Modified: 2021-10-25 17:13 PDT (History)
7 users (show)

See Also:


Attachments
Crash Log (136.82 KB, text/plain)
2021-10-20 14:36 PDT, Eric Hutchison
no flags Details
[fast-cq] Patch for landing (5.21 KB, patch)
2021-10-25 16:38 PDT, John Wilander
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Hutchison 2021-10-20 14:36:13 PDT
Created attachment 441939 [details]
Crash Log

http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-in-new-window.html

is crashing on iOS15 Sim EWS.

History: https://results.webkit.org/?suite=layout-tests&test=http%2Ftests%2FprivateClickMeasurement%2Fattribution-conversion-through-image-redirect-in-new-window.html

Build: https://ews-build.webkit.org/#/builders/68/builds/12

Results: https://ews-build.s3-us-west-2.amazonaws.com/iOS-15-Simulator-WK2-Tests-EWS/r441808-12/results.html

Crash Log (attached):


Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.WebKit              	0x000000010a16c8b3 WTFCrashWithInfo(int, char const*, char const*, int) + 19
1   com.apple.WebKit              	0x000000010a3320ae WebKit::NetworkSession::setPrivateClickMeasurementAppBundleIDForTesting(WTF::String&&) + 138
2   com.apple.WebKit              	0x000000010a305ce6 WebKit::NetworkProcess::setPrivateClickMeasurementAppBundleIDForTesting(PAL::SessionID, WTF::String&&, WTF::CompletionHandler<void ()>&&) + 54
3   com.apple.WebKit              	0x000000010a1c6c21 void IPC::handleMessageAsync<Messages::NetworkProcess::SetPrivateClickMeasurementAppBundleIDForTesting, WebKit::NetworkProcess, void (WebKit::NetworkProcess::*)(PAL::SessionID, WTF::String&&, WTF::CompletionHandler<void ()>&&)>(IPC::Connection&, IPC::Decoder&, WebKit::NetworkProcess*, void (WebKit::NetworkProcess::*)(PAL::SessionID, WTF::String&&, WTF::CompletionHandler<void ()>&&)) + 196
4   com.apple.WebKit              	0x000000010a1c1229 WebKit::NetworkProcess::didReceiveNetworkProcessMessage(IPC::Connection&, IPC::Decoder&) + 3999
5   com.apple.WebKit              	0x000000010a187e24 IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >) + 238
6   com.apple.WebKit              	0x000000010a188065 IPC::Connection::dispatchOneIncomingMessage() + 169
7   com.apple.JavaScriptCore      	0x000000010e07c26f WTF::RunLoop::performWork() + 431
8   com.apple.JavaScriptCore      	0x000000010e07cb42 WTF::RunLoop::performWork(void*) + 34
9   com.apple.CoreFoundation      	0x00007fff20369e25 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
10  com.apple.CoreFoundation      	0x00007fff20369d1d __CFRunLoopDoSource0 + 180
11  com.apple.CoreFoundation      	0x00007fff203691f2 __CFRunLoopDoSources0 + 242
12  com.apple.CoreFoundation      	0x00007fff20363951 __CFRunLoopRun + 875
13  com.apple.CoreFoundation      	0x00007fff20363103 CFRunLoopRunSpecific + 567
14  com.apple.Foundation          	0x00007fff2081941c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 213
15  com.apple.Foundation          	0x00007fff20819638 -[NSRunLoop(NSRunLoop) run] + 76
16  libxpc.dylib                  	0x00007fff2006705f _xpc_objc_main + 440
17  libxpc.dylib                  	0x00007fff20069050 xpc_main + 122
18  com.apple.WebKit              	0x000000010a33ffa0 WebKit::XPCServiceMain(int, char const**) + 87
19  dyld_sim                      	0x00000001074d2e1e start_sim + 10
20  ???                           	0x0000000000000001 0 + 1
21  ???                           	0x0000000000000001 0 + 1

Unable to reproduce locally. Will update if I am able to on a different platform.
Comment 1 Radar WebKit Bug Importer 2021-10-20 14:36:56 PDT
<rdar://problem/84479642>
Comment 2 Eric Hutchison 2021-10-20 14:43:04 PDT
Updated test expectations at https://trac.webkit.org/changeset/284572/webkit
Comment 3 Ryan Haddad 2021-10-20 16:51:23 PDT
I think this is hitting the following assert:

RELEASE_ASSERT(isRunningTest(WebCore::applicationBundleIdentifier()))
Comment 4 John Wilander 2021-10-20 16:52:55 PDT
(In reply to Ryan Haddad from comment #3)
> I think this is hitting the following assert:
> 
> RELEASE_ASSERT(isRunningTest(WebCore::applicationBundleIdentifier()))

It is. The weird thing is why the assertion fails. It checks that the app calling the test API is the test runner. I intend to land logging of what the diff/fail is and use that as the basis for a fix.
Comment 5 Ryan Haddad 2021-10-20 17:11:49 PDT
Checking the history link, I don't see any instances of this crashing on trunk. Maybe this issue is test order dependent.
Comment 6 John Wilander 2021-10-21 14:54:56 PDT
Adding logging in https://bugs.webkit.org/show_bug.cgi?id=232108.
Comment 7 John Wilander 2021-10-21 16:47:40 PDT
Reverted test expectation in https://bugs.webkit.org/show_bug.cgi?id=232115.
Comment 8 Ryan Haddad 2021-10-25 14:25:34 PDT
Is is a post-logging crash: https://ews-build.s3-us-west-2.amazonaws.com/iOS-15-Simulator-WK2-Tests-EWS/r442369-393/results.html

`isRunningTest() returned false. appBundleID is inAppBrowserPrivacyTestIdentifier.`
Comment 9 John Wilander 2021-10-25 14:31:34 PDT
(In reply to Ryan Haddad from comment #8)
> Is is a post-logging crash:
> https://ews-build.s3-us-west-2.amazonaws.com/iOS-15-Simulator-WK2-Tests-EWS/
> r442369-393/results.html
> 
> `isRunningTest() returned false. appBundleID is
> inAppBrowserPrivacyTestIdentifier.`

Great! Well, not great but the logging payed off. I'll go check what's running with that app bundle ID and devise a fix. Thanks for the ping.
Comment 10 John Wilander 2021-10-25 14:38:24 PDT
(In reply to John Wilander from comment #9)
> (In reply to Ryan Haddad from comment #8)
> > Is is a post-logging crash:
> > https://ews-build.s3-us-west-2.amazonaws.com/iOS-15-Simulator-WK2-Tests-EWS/
> > r442369-393/results.html
> > 
> > `isRunningTest() returned false. appBundleID is
> > inAppBrowserPrivacyTestIdentifier.`
> 
> Great! Well, not great but the logging payed off. I'll go check what's
> running with that app bundle ID and devise a fix. Thanks for the ping.

It's this code:

static void initializeInAppBrowserPrivacyTestSettings()
{
    WTF::initializeMainThread();
    WebCore::clearApplicationBundleIdentifierTestingOverride();
    WebCore::setApplicationBundleIdentifier("inAppBrowserPrivacyTestIdentifier");
}


I've reached out to Kate to ask about it. Seems like there may be a reset of that identifier missing.
Comment 11 John Wilander 2021-10-25 15:24:44 PDT
(In reply to John Wilander from comment #10)
> I've reached out to Kate to ask about it. Seems like there may be a reset of
> that identifier missing.

Fix coming in https://bugs.webkit.org/show_bug.cgi?id=232278.
Comment 12 John Wilander 2021-10-25 16:38:03 PDT
Created attachment 442438 [details]
[fast-cq] Patch for landing
Comment 13 EWS 2021-10-25 16:39:59 PDT
Committed r284848 (243525@main): <https://commits.webkit.org/243525@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 442438 [details].
Comment 14 John Wilander 2021-10-25 17:13:50 PDT
We may need another test fix for layout test that use <!-- webkit-test-runner [ enableInAppBrowserPrivacy=true applicationBundleIdentifier=inAppBrowserPrivacyTestIdentifier isAppBoundWebView=true ] -->

_clearApplicationBundleIdentifierTestingOverride() needs to reset the ID in the network process. I've asked Kate to have a look.