Crash under MIMETypeRegistry::isSupportedJavaScriptMIMEType(): Thread 6 Crashed:: WebCore: Worker 0 com.apple.WebCore 0x00007fff565cbfc0 unsigned int WTF::StringHasher::computeHashAndMaskTop8Bits<unsigned short, WTF::ASCIICaseInsensitiveHash::FoldCase<unsigned short> >(unsigned short const*, unsigned int) + 32 1 com.apple.WebCore 0x00007fff5662929e WTF::String* WTF::HashTable<WTF::String, WTF::String, WTF::IdentityExtractor, WTF::ASCIICaseInsensitiveHash, WTF::HashTraits<WTF::String>, WTF::HashTraits<WTF::String> >::lookup<WTF::IdentityHashTranslator<WTF::HashTraits<WTF::String>, WTF::ASCIICaseInsensitiveHash>, WTF::String>(WTF::String const&) + 46 2 com.apple.WebCore 0x00007fff564409cd WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType(WTF::String const&) + 61 3 com.apple.WebCore 0x00007fff577f6bc6 WebCore::ServiceWorkerJob::didReceiveResponse(unsigned long, WebCore::ResourceResponse const&) + 134 4 com.apple.WebCore 0x00007fff577e508b WebCore::WorkerScriptLoader::didReceiveResponse(unsigned long, WebCore::ResourceResponse const&) + 539 5 com.apple.WebCore 0x00007fff57302480 WTF::Function<void (WebCore::ScriptExecutionContext&)>::CallableWrapper<WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveResponse(unsigned long, WebCore::ResourceResponse const&)::$_9>::call(WebCore::ScriptExecutionContext&) + 80 6 com.apple.WebCore 0x00007fff577e3cf0 WebCore::WorkerRunLoop::runInMode(WebCore::WorkerGlobalScope*, WebCore::ModePredicate const&, WebCore::WorkerRunLoop::WaitMode) + 416 7 com.apple.WebCore 0x00007fff577e3af0 WebCore::WorkerRunLoop::run(WebCore::WorkerGlobalScope*) + 96 8 com.apple.WebCore 0x00007fff577e6096 WebCore::WorkerThread::workerThread() + 1030 9 com.apple.JavaScriptCore 0x00007fff4c99eeb4 WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 228 10 com.apple.JavaScriptCore 0x00007fff4bdb49c9 WTF::wtfThreadEntryPoint(void*) + 9 11 libsystem_pthread.dylib 0x00007fff714f36c1 _pthread_body + 340 12 libsystem_pthread.dylib 0x00007fff714f356d _pthread_start + 377 13 libsystem_pthread.dylib 0x00007fff714f2c5d thread_start + 13
<rdar://problem/37675748>
Created attachment 334185 [details] Patch
Comment on attachment 334185 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=334185&action=review > Source/WebCore/platform/MIMETypeRegistry.cpp:502 > + if (!isMainThread()) { > + bool isSupported = false; > + callOnMainThreadAndWait([&isSupported, mimeType = mimeType.isolatedCopy()] { > + isSupported = isSupportedJavaScriptMIMEType(mimeType); > + }); > + return isSupported; > + } It would be nice to make MIMETypeRegistry thread safe in a way that does not involve blocking on main thread.
Comment on attachment 334185 [details] Patch Clearing flags on attachment: 334185 Committed r228716: <https://trac.webkit.org/changeset/228716>
All reviewed patches have been landed. Closing bug.