<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Crash when WebCore::SQLiteFileSystem::openDatabase is called from multiple threads"
   href="https://bugs.webkit.org/show_bug.cgi?id=143245#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Crash when WebCore::SQLiteFileSystem::openDatabase is called from multiple threads"
   href="https://bugs.webkit.org/show_bug.cgi?id=143245">bug 143245</a>
              from <span class="vcard"><a class="email" href="mailto:mcatanzaro&#64;igalia.com" title="Michael Catanzaro &lt;mcatanzaro&#64;igalia.com&gt;"> <span class="fn">Michael Catanzaro</span></a>
</span></b>
        <pre>Different but very related issue: I notice that one WebProcessPool is always leaked (using a debug build) when starting any application that uses WebKit, sometimes two. I never bothered to track it down, but surely it is that inspector &quot;context.&quot; I don't think it's OK for WebInspectorProxy::inspectorProcessPool to intentionally leak the inspector context because WebProcessPool is fast-allocated. Also, WebInspectorProxy::inspectorProcessPool is not thread-safe; I presume the double leak occurs when multiple web processes are started at once. In platform-specific code I would fix that using GOnce and a RefPtr, like we do for the default web context, but I'm not sure what the appropriate idiom would be in WebInspectorProxy.cpp.

Maybe I should file another bug for this, but I guess it may be obsoleted by a fix for this bug.

(In reply to <a href="show_bug.cgi?id=143245#c2">comment #2</a>)
<span class="quote">&gt; I also wonder if we should avoid creating the local storage database when
&gt; localStorage is disabled in settings, but that would be a different issue.</span >

Yes....

Regarding thread safety: <a href="https://sqlite.org/threadsafe.html">https://sqlite.org/threadsafe.html</a>

In particular, &quot;In serialized mode, SQLite can be safely used by multiple threads with no restriction&quot; and &quot;The default mode is serialized.&quot; Hm. I did a few git greps and am pretty sure we never change the default mode, which suggests this may be a bug in SQLite. It would probably be good to explicitly select the threading mode we need, because the default can be changed when compiling sqlite3, so we don't actually know for sure which mode we're using. I presume all sane Linux distros will default to serialized mode, though.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>