Bug 198379

Summary: REGRESSION (r245873) [Mac WK2] Layout Test http/wpt/service-workers/update-service-worker.https.html is a flaky crash after running new test
Product: WebKit Reporter: Shawn Roberts <sroberts>
Component: Tools / TestsAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, commit-queue, jlewis3, ryanhaddad, tsavell, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=198434
Attachments:
Description Flags
Patch none

Description Shawn Roberts 2019-05-30 09:49:09 PDT
The following layout test is failing on Mac WK2

http/wpt/service-workers/update-service-worker.https.html

Probable cause:

Due to an unrelated issue we do not have results on the dashboard yet, but I was able to verify locally this crash happens after r245873 . 

New test added http/wpt/service-workers/service-worker-networkprocess-crash.html when run before http/wpt/service-workers/update-service-worker.https.html will flakily cause a crash on Mac WK2

reproduces like this:

run-webkit-tests http/wpt/service-workers/service-worker-networkprocess-crash.html http/wpt/service-workers/update-service-worker.https.html --child-process 1 --iter 10 --exit-after-n-crashes=1

Usually crashes in 3 runs.

Flakiness Dashboard:

https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=http%2Fwpt%2Fservice-workers%2Fupdate-service-worker.https.html

Will post full crash log in radar:

0   com.apple.WebKit              	0x000000010976889d WebKit::SharedStringHashTableReadOnly::setSharedMemory(WTF::RefPtr<WebKit::SharedMemory, WTF::DumbPtrTraits<WebKit::SharedMemory> >&&) + 19
1   com.apple.WebKit              	0x00000001099ccc59 WebKit::WebSWOriginTable::setSharedMemory(WebKit::SharedMemory::Handle const&) + 63
2   com.apple.WebKit              	0x0000000109ad7208 WebKit::WebSWClientConnection::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 6580
3   com.apple.WebKit              	0x00000001095fdd67 IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >) + 165
4   com.apple.WebKit              	0x000000010960476e WTF::Detail::CallableWrapper<IPC::Connection::enqueueIncomingMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >)::$_14, void>::call() + 202
Comment 1 Radar WebKit Bug Importer 2019-05-30 09:49:54 PDT
<rdar://problem/51264361>
Comment 2 Shawn Roberts 2019-05-30 09:50:13 PDT
Occurring in iOS Simulator as well.
Comment 3 youenn fablet 2019-05-30 09:52:35 PDT
Will fix it today
Comment 4 Shawn Roberts 2019-05-30 11:54:37 PDT
Thank you.

Layout test : http/tests/websocket/tests/hybi/no-subprotocol.html is hitting the same crash as well. It's not triggering off your new test however. I can bisect and find out which test is triggering it, if it's helpful?

Crash Log:

https://build.webkit.org/results/Apple%20Mojave%20Release%20WK2%20(Tests)/r245891%20(4385)/http/wpt/service-workers/update-service-worker.https-crash-log.txt
Comment 5 youenn fablet 2019-05-30 11:55:50 PDT
I think I know the route cause of this.
We probably need to remove the WebSWClientConnection from NetworkProcessConnection map at destruction time.
Comment 6 youenn fablet 2019-05-30 14:25:40 PDT
Created attachment 370979 [details]
Patch
Comment 7 WebKit Commit Bot 2019-05-30 17:08:10 PDT
Comment on attachment 370979 [details]
Patch

Clearing flags on attachment: 370979

Committed r245913: <https://trac.webkit.org/changeset/245913>
Comment 8 WebKit Commit Bot 2019-05-30 17:08:11 PDT
All reviewed patches have been landed.  Closing bug.