Bug 206904

Summary: Crash under com.apple.WebKit.Networking at WebKit: WebKit::WebIDBServer::suspend
Product: WebKit Reporter: Sihui Liu <sihui_liu>
Component: New BugsAssignee: Sihui Liu <sihui_liu>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ggaren, mjs, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Sihui Liu 2020-01-28 13:07:41 PST
Thread[0] EXC_BAD_ACCESS (SIGSEGV) (KERN_INVALID_ADDRESS at 0x00000000000000a8)
   94  	    m_isSuspended = true;
-> 95  	    m_server->lock().lock();
   96  	    m_server->stopDatabaseActivitiesOnMainThread();

15 WebKit: WebKit::WebIDBServer::suspend(WebKit::WebIDBServer::ShouldForceStop) <==
  15 WebKit: WebKit::WebIDBServer::suspend(WebKit::WebIDBServer::ShouldForceStop)
    15 WebKit: WebKit::NetworkProcess::prepareToSuspend(bool, WTF::CompletionHandler<void ()>&&)
      15 WebKit: void IPC::handleMessageAsync<Messages::NetworkProcess::PrepareToSuspend, WebKit::NetworkProcess, void (WebKit::NetworkProcess::*)(bool, WTF::CompletionHandler<void ()>&&)>(IPC::Connection&, IPC::Decoder&, WebKit::NetworkProcess*, void (WebKit::NetworkProcess::*)(bool, WTF::CompletionHandler<void ()>&&))
          15 WebKit: WebKit::NetworkProcess::didReceiveNetworkProcessMessage(IPC::Connection&, IPC::Decoder&)
Comment 1 Sihui Liu 2020-01-28 13:08:10 PST
<rdar://problem/58791603>
Comment 2 Sihui Liu 2020-01-28 13:13:35 PST
Created attachment 389054 [details]
Patch
Comment 3 Maciej Stachowiak 2020-01-28 17:02:26 PST
Comment on attachment 389054 [details]
Patch

r=me (seems like this could block the main thread of the network process though, unless I misunderstand what happens on which thread.
Comment 4 WebKit Commit Bot 2020-01-29 12:21:48 PST
The commit-queue encountered the following flaky tests while processing attachment 389054 [details]:

editing/spelling/spellcheck-async-remove-frame.html bug 158401 (authors: morrita@google.com, rniwa@webkit.org, and tony@chromium.org)
The commit-queue is continuing to process your patch.
Comment 5 WebKit Commit Bot 2020-01-29 12:22:14 PST
The commit-queue encountered the following flaky tests while processing attachment 389054 [details]:

editing/spelling/spellcheck-attribute.html bug 206178 (authors: g.czajkowski@samsung.com, mark.lam@apple.com, and rniwa@webkit.org)
imported/w3c/web-platform-tests/xhr/send-send.any.worker.html bug 206345 (author: youennf@gmail.com)
The commit-queue is continuing to process your patch.
Comment 6 WebKit Commit Bot 2020-01-29 12:38:47 PST
Comment on attachment 389054 [details]
Patch

Clearing flags on attachment: 389054

Committed r255375: <https://trac.webkit.org/changeset/255375>
Comment 7 WebKit Commit Bot 2020-01-29 12:38:48 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Geoffrey Garen 2020-01-29 12:49:05 PST
Can we just initialize m_server directly in the constructor on the main thread, instead of posting a task? Since no tasks have been queued yet, there's nothing to synchronize with yet.

Specifically, maybe we can initialize m_server directly, and then post a task to upgradeFilesIfNecessary() (and change IDBServer::IDBServer() not to upgradeFilesIfNecessary(), to avoid I/O on the main thread).