Bug 180867 - imported/w3c/web-platform-tests/service-workers/service-worker/update.https.html is sometimes crashing in Debug builds
Summary: imported/w3c/web-platform-tests/service-workers/service-worker/update.https.h...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Service Workers (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-12-15 10:03 PST by youenn fablet
Modified: 2017-12-15 11:58 PST (History)
6 users (show)

See Also:


Attachments
Patch (1.57 KB, patch)
2017-12-15 10:22 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2017-12-15 10:03:55 PST
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.JavaScriptCore      	0x000000011a2dce04 WTFCrash + 36 (Assertions.cpp:272)
1   com.apple.WebCore             	0x000000010ddc4fa5 WebCore::SWServer::runServiceWorker(WTF::ObjectIdentifier<WebCore::ServiceWorkerIdentifierType>) + 213 (SWServer.cpp:521)
2   com.apple.WebCore             	0x000000010ddc5365 WebCore::SWServer::runServiceWorkerIfNecessary(WTF::ObjectIdentifier<WebCore::ServiceWorkerIdentifierType>, WTF::Function<void (bool, WebCore::SWServerToContextConnection&)>&&) + 309 (SWServer.cpp:506)
3   com.apple.WebKit              	0x00000001070cff84 WebKit::WebSWServerConnection::startFetch(unsigned long long, WTF::ObjectIdentifier<WebCore::ServiceWorkerIdentifierType>, WebCore::ResourceRequest&&, WebCore::FetchOptions&&, IPC::FormDataReference&&) + 308 (WebSWServerConnection.cpp:127)
4   com.apple.WebKit              	0x00000001070e6618 void IPC::callMemberFunctionImpl<WebKit::WebSWServerConnection, void (WebKit::WebSWServerConnection::*)(unsigned long long, WTF::ObjectIdentifier<WebCore::ServiceWorkerIdentifierType>, WebCore::ResourceRequest&&, WebCore::FetchOptions&&, IPC::FormDataReference&&), std::__1::tuple<unsigned long long, WTF::ObjectIdentifier<WebCore::ServiceWorkerIdentifierType>, WebCore::ResourceRequest, WebCore::FetchOptions, IPC::FormDataReference>, 0ul, 1ul, 2ul, 3ul, 4ul>(WebKit::WebSWServerConnection*, void (WebKit::WebSWServerConnection::*)(unsigned long long, WTF::ObjectIdentifier<WebCore::ServiceWorkerIdentifierType>, WebCore::ResourceRequest&&, WebCore::FetchOptions&&, IPC::FormDataReference&&), std::__1::tuple<unsigned long long, WTF::ObjectIdentifier<WebCore::ServiceWorkerIdentifierType>, WebCore::ResourceRequest, WebCore::FetchOptions, IPC::FormDataReference>&&, std::__1::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul, 4ul>) + 376 (HandleMessage.h:41)
5   com.apple.WebKit              	0x00000001070e6108 void IPC::callMemberFunction<WebKit::WebSWServerConnection, void (WebKit::WebSWServerConnection::*)(unsigned long long, WTF::ObjectIdentifier<WebCore::ServiceWorkerIdentifierType>, WebCore::ResourceRequest&&, WebCore::FetchOptions&&, IPC::FormDataReference&&), std::__1::tuple<unsigned long long, WTF::ObjectIdentifier<WebCore::ServiceWorkerIdentifierType>, WebCore::ResourceRequest, WebCore::FetchOptions, IPC::FormDataReference>, std::__1::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul, 4ul> >(std::__1::tuple<unsigned long long, WTF::ObjectIdentifier<WebCore::ServiceWorkerIdentifierType>, WebCore::ResourceRequest, WebCore::FetchOptions, IPC::FormDataReference>&&, WebKit::WebSWServerConnection*, void (WebKit::WebSWServerConnection::*)(unsigned long long, WTF::ObjectIdentifier<WebCore::ServiceWorkerIdentifierType>, WebCore::ResourceRequest&&, WebCore::FetchOptions&&, IPC::FormDataReference&&)) + 88 (HandleMessage.h:47)
6   com.apple.WebKit              	0x00000001070e3337 void IPC::handleMessage<Messages::WebSWServerConnection::StartFetch, WebKit::WebSWServerConnection, void (WebKit::WebSWServerConnection::*)(unsigned long long, WTF::ObjectIdentifier<WebCore::ServiceWorkerIdentifierType>, WebCore::ResourceRequest&&, WebCore::FetchOptions&&, IPC::FormDataReference&&)>(IPC::Decoder&, WebKit::WebSWServerConnection*, void (WebKit::WebSWServerConnection::*)(unsigned long long, WTF::ObjectIdentifier<WebCore::ServiceWorkerIdentifierType>, WebCore::ResourceRequest&&, WebCore::FetchOptions&&, IPC::FormDataReference&&)) + 471 (HandleMessage.h:127)
7   com.apple.WebKit              	0x00000001070e274c WebKit::WebSWServerConnection::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 636 (WebSWServerConnectionMessageReceiver.cpp:73)
8   com.apple.WebKit              	0x0000000106a116c3 WebKit::StorageToWebProcessConnection::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 851 (StorageToWebProcessConnection.cpp:91)
9   com.apple.WebKit              	0x0000000106552373 IPC::Connection::dispatchMessage(IPC::Decoder&) + 51 (Connection.cpp:902)
10  com.apple.WebKit              	0x0000000106549778 IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >) + 712 (Connection.cpp:930)
11  com.apple.WebKit              	0x0000000106552970 IPC::Connection::dispatchOneMessage() + 1520 (Connection.cpp:959)
Comment 2 Chris Dumez 2017-12-15 10:18:14 PST
Hitting this assertion:
auto addResult = m_runningOrTerminatingWorkers.add(identifier, *worker);
ASSERT_UNUSED(addResult, addResult.isNewEntry);
Comment 3 Chris Dumez 2017-12-15 10:19:53 PST
(In reply to Chris Dumez from comment #2)
> Hitting this assertion:
> auto addResult = m_runningOrTerminatingWorkers.add(identifier, *worker);
> ASSERT_UNUSED(addResult, addResult.isNewEntry);

I believe the assertion is wrong. It is possible for the worker to be already in m_runningOrTerminatingWorkers but its state is Terminating (not Running).
Comment 4 Chris Dumez 2017-12-15 10:22:55 PST
Created attachment 329496 [details]
Patch
Comment 5 WebKit Commit Bot 2017-12-15 11:57:05 PST
Comment on attachment 329496 [details]
Patch

Clearing flags on attachment: 329496

Committed r225976: <https://trac.webkit.org/changeset/225976>
Comment 6 WebKit Commit Bot 2017-12-15 11:57:07 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2017-12-15 11:58:25 PST
<rdar://problem/36078659>