<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>194588</bug_id>
          
          <creation_ts>2019-02-13 03:04:12 -0800</creation_ts>
          <short_desc>Crash in WebKit::CacheStorage::Engine::cachesRootPath</short_desc>
          <delta_ts>2019-02-13 11:25:01 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Service Workers</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Antti Koivisto">koivisto</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cdumez</cc>
    
    <cc>cgarcia</cc>
    
    <cc>commit-queue</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>ggaren</cc>
    
    <cc>rniwa</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1505683</commentid>
    <comment_count>0</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2019-02-13 03:04:12 -0800</bug_when>
    <thetext>0   WebKit                        	0x000000019f27d268 WebKit::CacheStorage::Engine::cachesRootPath(WebCore::ClientOrigin const&amp;) + 536 (Optional.h:537)
1   WebKit                        	0x000000019f27d0a0 WebKit::CacheStorage::Engine::cachesRootPath(WebCore::ClientOrigin const&amp;) + 80 (CacheStorageEngine.cpp:61)
2   WebKit                        	0x000000019f28dca0 WTF::Function&lt;void (WTF::Optional&lt;WebCore::DOMCacheEngine::Error&gt;&amp;&amp;)&gt;::CallableWrapper&lt;WebKit::CacheStorage::Engine::readCachesFromDisk(WebCore::ClientOrigin const&amp;, WTF::Function&lt;void (std::experimental::fundamentals_v3::expected&lt;std::__1::reference_wrapper&lt;WebKit::CacheStorage::Caches&gt;, WebCore::DOMCacheEngine::Error&gt;&amp;&amp;)&gt;&amp;&amp;)::$_22&gt;::call(WTF::Optional&lt;WebCore::DOMCacheEngine::Error&gt;&amp;&amp;) + 616 (CacheStorageEngine.cpp:324)
3   WebKit                        	0x000000019f27d34c WebKit::CacheStorage::Engine::~Engine() + 224 (Function.h:56)
4   WebKit                        	0x000000019f288408 WTF::RefCounted&lt;WebKit::CacheStorage::Engine&gt;::deref() const + 32 (CacheStorageEngine.cpp:66)
5   WebKit                        	0x000000019f28c35c WTF::HashTable&lt;PAL::SessionID, WTF::KeyValuePair&lt;PAL::SessionID, WTF::RefPtr&lt;WebKit::CacheStorage::Engine, WTF::DumbPtrTraits&lt;WebKit::CacheStorage::Engine&gt; &gt; &gt;, WTF::KeyValuePairKeyExtractor&lt;WTF::KeyValuePair&lt;PAL::SessionID, WTF::RefPtr&lt;WebKit::CacheStorage::Engine, WTF::DumbPtrTraits&lt;WebKit::CacheStorage::Engine&gt; &gt; &gt; &gt;, WTF::SessionIDHash, WTF::HashMap&lt;PAL::SessionID, WTF::RefPtr&lt;WebKit::CacheStorage::Engine, WTF::DumbPtrTraits&lt;WebKit::CacheStorage::Engine&gt; &gt;, WTF::SessionIDHash, WTF::HashTraits&lt;PAL::SessionID&gt;, WTF::HashTraits&lt;WTF::RefPtr&lt;WebKit::CacheStorage::Engine, WTF::DumbPtrTraits&lt;WebKit::CacheStorage::Engine&gt; &gt; &gt; &gt;::KeyValuePairTraits, WTF::HashTraits&lt;PAL::SessionID&gt; &gt;::remove(WTF::KeyValuePair&lt;PAL::SessionID, WTF::RefPtr&lt;WebKit::CacheStorage::Engine, WTF::DumbPtrTraits&lt;WebKit::CacheStorage::Engine&gt; &gt; &gt;*) + 36 (RefPtr.h:44)
6   WebKit                        	0x000000019f27d804 WTF::HashMap&lt;PAL::SessionID, WTF::RefPtr&lt;WebKit::CacheStorage::Engine, WTF::DumbPtrTraits&lt;WebKit::CacheStorage::Engine&gt; &gt;, WTF::SessionIDHash, WTF::HashTraits&lt;PAL::SessionID&gt;, WTF::HashTraits&lt;WTF::RefPtr&lt;WebKit::CacheStorage::Engine, WTF::DumbPtrTraits&lt;WebKit::CacheStorage::Engine&gt; &gt; &gt; &gt;::remove(PAL::SessionID const&amp;) + 52 (HashTable.h:1060)
7   WebKit                        	0x000000019f27d7a8 WebKit::CacheStorage::Engine::destroyEngine(PAL::SessionID) + 44 (CacheStorageEngine.cpp:105)
8   WebKit                        	0x000000019f24ca94 WebKit::NetworkProcess::destroySession(PAL::SessionID) + 52 (NetworkProcess.cpp:456)
9   WebKit                        	0x000000019f218e28 WebKit::NetworkProcess::didReceiveNetworkProcessMessage(IPC::Connection&amp;, IPC::Decoder&amp;) + 2480 (HandleMessage.h:41)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1505684</commentid>
    <comment_count>1</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2019-02-13 03:08:51 -0800</bug_when>
    <thetext>&lt;rdar://problem/46363997&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1505687</commentid>
    <comment_count>2</comment_count>
      <attachid>361907</attachid>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2019-02-13 03:14:38 -0800</bug_when>
    <thetext>Created attachment 361907
patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1505717</commentid>
    <comment_count>3</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2019-02-13 07:44:39 -0800</bug_when>
    <thetext>cachesRootPath is called from readCachesFromDisk lambda.
Shouldn&apos;t we change the readCachesFromDisk lbamda to early return if the lambda receives an error of value Error::Internal.

Error::Internal is not clear in that case, maybe we could introduce an enum for initialize callback, something like { OK, WriteError, BeingDeleted }.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1505746</commentid>
    <comment_count>4</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2019-02-13 09:47:57 -0800</bug_when>
    <thetext>Possibly, but this seems like the simplest, safest fix for the branch. Not checking the existence of the salt is dangerous in any case,</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1505774</commentid>
    <comment_count>5</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2019-02-13 10:56:30 -0800</bug_when>
    <thetext>(In reply to Antti Koivisto from comment #4)
&gt; Possibly, but this seems like the simplest, safest fix for the branch. Not
&gt; checking the existence of the salt is dangerous in any case,

OK, let&apos;s go with this patch and I&apos;ll improve it with a follow-up.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1505776</commentid>
    <comment_count>6</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2019-02-13 10:59:51 -0800</bug_when>
    <thetext>(In reply to youenn fablet from comment #5)
&gt; (In reply to Antti Koivisto from comment #4)
&gt; &gt; Possibly, but this seems like the simplest, safest fix for the branch. Not
&gt; &gt; checking the existence of the salt is dangerous in any case,
&gt; 
&gt; OK, let&apos;s go with this patch and I&apos;ll improve it with a follow-up.

Hum, the potential risk with the current patch is that we proceed with the current flow, execute some callbacks and end up refine the engine even though we are in its destructor.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1505777</commentid>
    <comment_count>7</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2019-02-13 10:59:57 -0800</bug_when>
    <thetext>s/refine/refing</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1505779</commentid>
    <comment_count>8</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2019-02-13 11:03:50 -0800</bug_when>
    <thetext>(In reply to youenn fablet from comment #6)
&gt; (In reply to youenn fablet from comment #5)
&gt; &gt; (In reply to Antti Koivisto from comment #4)
&gt; &gt; &gt; Possibly, but this seems like the simplest, safest fix for the branch. Not
&gt; &gt; &gt; checking the existence of the salt is dangerous in any case,
&gt; &gt; 
&gt; &gt; OK, let&apos;s go with this patch and I&apos;ll improve it with a follow-up.
&gt; 
&gt; Hum, the potential risk with the current patch is that we proceed with the
&gt; current flow, execute some callbacks and end up refine the engine even
&gt; though we are in its destructor.

Theoretical issue currently.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1505791</commentid>
    <comment_count>9</comment_count>
      <attachid>361907</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-02-13 11:24:59 -0800</bug_when>
    <thetext>Comment on attachment 361907
patch

Clearing flags on attachment: 361907

Committed r241448: &lt;https://trac.webkit.org/changeset/241448&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1505792</commentid>
    <comment_count>10</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-02-13 11:25:01 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>361907</attachid>
            <date>2019-02-13 03:14:38 -0800</date>
            <delta_ts>2019-02-13 11:24:59 -0800</delta_ts>
            <desc>patch</desc>
            <filename>sw-cache-salt.patch</filename>
            <type>text/plain</type>
            <size>1348</size>
            <attacher name="Antti Koivisto">koivisto</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJLaXQvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFNvdXJjZS9XZWJL
aXQvQ2hhbmdlTG9nCShyZXZpc2lvbiAyNDE0MzApCisrKyBTb3VyY2UvV2ViS2l0L0NoYW5nZUxv
Zwkod29ya2luZyB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