Bug 231246 - [ iOS15 ] TestWebKitAPI.ResourceLoadStatistics.DataTaskIdentifierCollision is a constant crash
Summary: [ iOS15 ] TestWebKitAPI.ResourceLoadStatistics.DataTaskIdentifierCollision is...
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
Keywords: InRadar
: 231245 (view as bug list)
Depends on:
Reported: 2021-10-05 11:55 PDT by Eric Hutchison
Modified: 2021-10-07 09:42 PDT (History)
7 users (show)

See Also:

Patch (8.42 KB, patch)
2021-10-05 17:37 PDT, 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 Eric Hutchison 2021-10-05 11:55:56 PDT

is a constant crash on iOS15 since r282887.

History: https://results.webkit.org/?suite=api-tests&test=TestWebKitAPI.ResourceLoadStatistics.DataTaskIdentifierCollision

Build: https://build.webkit.org/#/builders/28/builds/3324

        2021-10-05 07:41:09.990 TestWebKitAPI[62822:10550457] Writing analzed variants.
        Child process terminated with signal 11: Segmentation fault

Unable to reproduce crash locally. Test timed out on r283552 using run-api-tests --ios-simulator --iterations 25 TestWebKitAPI.ResourceLoadStatistics.DataTaskIdentifierCollision.
Comment 1 Radar WebKit Bug Importer 2021-10-05 11:59:33 PDT
Comment 2 Alexey Proskuryakov 2021-10-05 15:46:57 PDT
*** Bug 231245 has been marked as a duplicate of this bug. ***
Comment 3 Alexey Proskuryakov 2021-10-05 15:47:59 PDT
> is a constant crash on iOS15 since r282887.

That's just the first time the test ran, so definitely unrelated.

We had this test crash (even every time) on other queues earlier than that.
Comment 4 Alex Christensen 2021-10-05 17:37:54 PDT
Created attachment 440316 [details]
Comment 5 Chris Dumez 2021-10-05 17:54:08 PDT
Comment on attachment 440316 [details]

It is a mystery indeed but the new code looks good to me.
Comment 6 David Kilzer (:ddkilzer) 2021-10-05 18:27:54 PDT
Comment on attachment 440316 [details]

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

> Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm:-572
> -    NSArray<NSString *> *messages = [delegate waitForMessages:2];

The other way to fix this is to make this a RetainPtr<NSArray<NSString *>> so that the lifetime of the object is guaranteed for the duration of this method.

Under ARC, `messages` would be +1 retained until the end of the method automatically.

With MRR, you either have to use manual -retain/-release, or you have to use RetainPtr<> to ensure the lifetime of the object.

You could also change -waitForMessages: to return a RetainPtr<>, then you wouldn't need to autorelease the return value.
Comment 7 EWS 2021-10-05 20:47:23 PDT
Committed r283599 (242551@main): <https://commits.webkit.org/242551@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 440316 [details].
Comment 8 Alex Christensen 2021-10-06 08:27:19 PDT
It stopped crashing.
Internal builds seem to be passing.
Open source builds seem to be timing out.
I can't reproduce the time out.
Comment 9 Eric Hutchison 2021-10-06 16:56:36 PDT
Was able to occasionally reproduce locally on r283657 using run-api-tests --ios-simulator --iterations 100 --release --child-processes 1 --no-build --verbose TestWebKitAPI.ResourceLoadStatistics.DataTaskIdentifierCollision.

The test also timed out on a few iterations of the above test with --debug instead of --release.

Test suite failed



Testing completed, Exit status: 3
Comment 10 Alexey Proskuryakov 2021-10-06 17:39:58 PDT
> Open source builds seem to be timing out.

Is there a bug tracking that?
Comment 11 Eric Hutchison 2021-10-07 09:42:00 PDT
(In reply to Alexey Proskuryakov from comment #10)
> > Open source builds seem to be timing out.
> Is there a bug tracking that?

Created new bug for timeout: https://bugs.webkit.org/show_bug.cgi?id=231366