Bug 198434

Summary: REGRESSION (r245913) [ Debug ] ASSERTION FAILED: m_swConnectionsByIdentifier.contains(connection.serverConnectionIdentifier()) Layout Test http/wpt/service-workers/update-service-worker.https.html is a flaky crash
Product: WebKit Reporter: Shawn Roberts <sroberts>
Component: Tools / TestsAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, cdumez, 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=198379
https://bugs.webkit.org/show_bug.cgi?id=198435
Attachments:
Description Flags
Patch
none
Patch for landing none

Description Shawn Roberts 2019-05-31 13:54:09 PDT
The following layout test is flaky on Mac WK2 iOS Simulator Debug

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

Probable cause:

Test originally started crashing after r245873 and affected all testers Release and Debug. After r245913 (which fixed release builds) it is crashing with a different Assertion just on Debug builds. I cannot reproduce it on Release builds. The way to reproduce the failure remains the same.

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 50 --exit-after-n-crashes=1 --ios-simulator --debug

Usually crashes within 5 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

https://build.webkit.org/results/Apple%20iOS%2012%20Simulator%20Debug%20WK2%20(Tests)/r245973%20(3961)/http/wpt/service-workers/update-service-worker.https-stderr.txt

ASSERTION FAILED: m_swConnectionsByIdentifier.contains(connection.serverConnectionIdentifier())
/Volumes/Data/worker/trunk-peacee-ios-sim-debug-archive/build/OpenSource/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp(270) : void WebKit::NetworkProcessConnection::removeSWClientConnection(WebKit::WebSWClientConnection &)
1   0x5a321c659 WTFCrash
2   0x101d9783b WTFCrashWithInfo(int, char const*, char const*, int)
3   0x102cc5165 WebKit::NetworkProcessConnection::removeSWClientConnection(WebKit::WebSWClientConnection&)
4   0x102d2eab3 WebKit::WebSWClientConnection::~WebSWClientConnection()
5   0x102d2ec05 WebKit::WebSWClientConnection::~WebSWClientConnection()
6   0x102d2ec69 WebKit::WebSWClientConnection::~WebSWClientConnection()
Comment 1 Radar WebKit Bug Importer 2019-05-31 13:54:48 PDT
<rdar://problem/51313917>
Comment 2 youenn fablet 2019-05-31 16:15:29 PDT
Created attachment 371094 [details]
Patch
Comment 3 Alex Christensen 2019-06-03 15:10:27 PDT
Comment on attachment 371094 [details]
Patch

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

> Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp:198
> +    auto connections = WTFMove(m_swConnectionsByIdentifier);

This feels like more of a std::exchange kind of use.
Comment 4 Shawn Roberts 2019-06-03 15:14:06 PDT
The bots are hitting this Assertion, and I think it might be related.

ietestcenter/css3/grid/grid-column-002.htm is crashing on the testers now. Running the test by itself I cannot reproduce, running with a test list now to see what test is triggering it. 

https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=%20ietestcenter%2Fcss3%2Fgrid%2Fgrid-column-002.htm

https://build.webkit.org/results/Apple%20Mojave%20Debug%20WK2%20(Tests)/r246043%20(2865)/ietestcenter/css3/grid/grid-column-002-crash-log.txt

ASSERTION FAILED: m_swConnectionsByIdentifier.contains(connection.serverConnectionIdentifier())
/Volumes/Data/slave/mojave-debug/build/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp(270) : void WebKit::NetworkProcessConnection::removeSWClientConnection(WebKit::WebSWClientConnection &)
1   0x531230759 WTFCrash
2   0x10d9159bb WTFCrashWithInfo(int, char const*, char const*, int)
3   0x10e9e6785 WebKit::NetworkProcessConnection::removeSWClientConnection(WebKit::WebSWClientConnection&)
4   0x10ea6a913 WebKit::WebSWClientConnection::~WebSWClientConnection()
5   0x10ea6aa65 WebKit::WebSWClientConnection::~WebSWClientConnection()
6   0x10ea6aac9 WebKit::WebSWClientConnection::~WebSWClientConnection()
Comment 5 youenn fablet 2019-06-03 21:42:18 PDT
Comment on attachment 371094 [details]
Patch

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

>> Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp:198
>> +    auto connections = WTFMove(m_swConnectionsByIdentifier);
> 
> This feels like more of a std::exchange kind of use.

The containers are implemented with this ability in mind, so std::exchange does not bring any benefit.
I see a slight benefit in WTFMove in terms of readability, less character and this pattern is used in many places, more than std::exchange.
Comment 6 youenn fablet 2019-06-03 21:45:56 PDT
Created attachment 371244 [details]
Patch for landing
Comment 7 WebKit Commit Bot 2019-06-04 09:11:44 PDT
Comment on attachment 371244 [details]
Patch for landing

Clearing flags on attachment: 371244

Committed r246068: <https://trac.webkit.org/changeset/246068>
Comment 8 WebKit Commit Bot 2019-06-04 09:11:46 PDT
All reviewed patches have been landed.  Closing bug.