Bug 206396 - [iOS] ServiceWorker process unexpectedly terminates on many tests, so they are reported as crash failures
Summary: [iOS] ServiceWorker process unexpectedly terminates on many tests, so they ar...
Status: RESOLVED DUPLICATE of bug 206994
Alias: None
Product: WebKit
Classification: Unclassified
Component: Service Workers (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
: 206275 206523 206594 206595 206935 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-01-16 20:48 PST by David Kilzer (:ddkilzer)
Modified: 2020-02-04 08:30 PST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2020-01-16 20:48:40 PST
Layout test http/wpt/service-workers/third-party-cookie.html is a flakey crash on iOS Simulator:

Flakiness Dashboard:
<https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=http%2Fwpt%2Fservice-workers%2Fthird-party-cookie.html>
Comment 1 Radar WebKit Bug Importer 2020-01-16 20:49:01 PST
<rdar://problem/58670130>
Comment 2 David Kilzer (:ddkilzer) 2020-01-16 20:52:43 PST
External test results where this occurred:

<https://build.webkit.org/results/Apple%20iOS%2013%20Simulator%20Debug%20WK2%20(Tests)/r254469%20(1683)/results.html>
Comment 3 Alexey Proskuryakov 2020-01-16 22:56:27 PST
Newer results: https://build.webkit.org/results/Apple%20iPadOS%2013%20Simulator%20Debug%20WK2%20(Tests)/r254728%20(1061)/results.html

This is A LOT of crashes here! But looking at ~/Library/Logs/DiagnosticReports on the bot, I don't see any ServiceWorker crashes. So this it is probably unexpectedly exiting, not crashing.
Comment 4 youenn fablet 2020-01-17 02:17:38 PST
> This is A LOT of crashes here! But looking at
> ~/Library/Logs/DiagnosticReports on the bot, I don't see any ServiceWorker
> crashes. So this it is probably unexpectedly exiting, not crashing.

You might be right.
I wonder whether a service worker process whose last service worker is stopped (for instance it unregisters itself) will probably terminate itself and we might wrongly report it as a crash.
Comment 5 youenn fablet 2020-01-17 02:31:19 PST
(In reply to youenn fablet from comment #4)
> > This is A LOT of crashes here! But looking at
> > ~/Library/Logs/DiagnosticReports on the bot, I don't see any ServiceWorker
> > crashes. So this it is probably unexpectedly exiting, not crashing.
> 
> You might be right.
> I wonder whether a service worker process whose last service worker is
> stopped (for instance it unregisters itself) will probably terminate itself
> and we might wrongly report it as a crash.

Nope, as long as we do not close a WebSWContextManagerConnection, which is ordered by UIProcess, the process should not be terminating itself through AuxiliaryProcess::terminate.
Comment 6 youenn fablet 2020-01-17 07:23:15 PST
Since this is mostly Simulator Debug, it might be that SWContextManager::serviceWorkerFailedToTerminate is called after a timeout of either 10s or 100ms.
I'll add an ASSERT so that we can further debug that.
Comment 7 David Kilzer (:ddkilzer) 2020-01-17 08:04:39 PST
Is the binary that’s launched actually called “ServiceWorkerProcess” on disk, or is my memory correct that it’s actually a com.apple.WebKit.WebContent process binary that’s launched/configured in a special way and changes its name in `ps` and Activity Monitor?

If it’s the latter (a com.apple.WebKit.WebContent binary), then maybe we are looking for the wrong file name for crashes.  Have we tried matching up PIDs from stderr logging in test results to com.apple.WebKit.WebContent crash logs on disk (manually) to see if there is any correlation?
Comment 8 Chris Dumez 2020-01-17 08:05:56 PST
(In reply to David Kilzer (:ddkilzer) from comment #7)
> Is the binary that’s launched actually called “ServiceWorkerProcess” on
> disk, or is my memory correct that it’s actually a
> com.apple.WebKit.WebContent process binary that’s launched/configured in a
> special way and changes its name in `ps` and Activity Monitor?
> 
> If it’s the latter (a com.apple.WebKit.WebContent binary), then maybe we are
> looking for the wrong file name for crashes.  Have we tried matching up PIDs
> from stderr logging in test results to com.apple.WebKit.WebContent crash
> logs on disk (manually) to see if there is any correlation?

There is no ServiceWorkerProcess binary. A Service Worker process is a regular WebContent process (same binary as WebContent processes).
Comment 9 Alexey Proskuryakov 2020-01-17 08:43:45 PST
> If it’s the latter (a com.apple.WebKit.WebContent binary), then maybe we are looking for the wrong file name for crashes.

I was looking for the right file name for crashes on the bot. Automation may or may not be correct (not sure if I've seen a ServiceWorker crash log in test results yet), but that's irrelevant in the context of this bug.
Comment 10 David Kilzer (:ddkilzer) 2020-01-17 10:35:27 PST
(In reply to Alexey Proskuryakov from comment #9)
> > If it’s the latter (a com.apple.WebKit.WebContent binary), then maybe we are looking for the wrong file name for crashes.
> 
> I was looking for the right file name for crashes on the bot. Automation may
> or may not be correct (not sure if I've seen a ServiceWorker crash log in
> test results yet), but that's irrelevant in the context of this bug.

IDK, it seems relevant to me if run-webkit-tests isn't picking up existing crash logs and associating them with failing tests in the results.

I also wanted to make sure I understood the reason that there isn't a "ServiceWorkerProcess" binary on disk, nor will there be a crash log containing the name "ServiceWorkerProcess".  And now I do.
Comment 11 youenn fablet 2020-01-23 04:53:59 PST
*** Bug 206523 has been marked as a duplicate of this bug. ***
Comment 12 Alexey Proskuryakov 2020-01-23 09:19:36 PST
*** Bug 206275 has been marked as a duplicate of this bug. ***
Comment 13 Alexey Proskuryakov 2020-01-23 09:19:51 PST
*** Bug 206594 has been marked as a duplicate of this bug. ***
Comment 14 Alexey Proskuryakov 2020-01-23 09:19:56 PST
*** Bug 206595 has been marked as a duplicate of this bug. ***
Comment 15 Jason Lawrence 2020-01-29 09:45:54 PST
*** Bug 206935 has been marked as a duplicate of this bug. ***
Comment 16 youenn fablet 2020-02-04 08:30:29 PST

*** This bug has been marked as a duplicate of bug 206994 ***