<?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>198622</bug_id>
          
          <creation_ts>2019-06-06 13:43:20 -0700</creation_ts>
          <short_desc>Crash using WKHTTPCookieStore when you use WKWebView and UIWebView in the same app</short_desc>
          <delta_ts>2019-06-06 17:29:35 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</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="Geoffrey Garen">ggaren</reporter>
          <assigned_to name="Geoffrey Garen">ggaren</assigned_to>
          <cc>cdumez</cc>
    
    <cc>commit-queue</cc>
    
    <cc>darin</cc>
    
    <cc>ggaren</cc>
    
    <cc>sihui_liu</cc>
    
    <cc>thorton</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1542544</commentid>
    <comment_count>0</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2019-06-06 13:43:20 -0700</bug_when>
    <thetext>Crash using WKHTTPCookieStore when you use WKWebView and UIWebView in the same app</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1542545</commentid>
    <comment_count>1</comment_count>
      <attachid>371524</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2019-06-06 13:48:16 -0700</bug_when>
    <thetext>Created attachment 371524
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1542581</commentid>
    <comment_count>2</comment_count>
      <attachid>371524</attachid>
    <who name="Tim Horton">thorton</who>
    <bug_when>2019-06-06 15:50:57 -0700</bug_when>
    <thetext>Comment on attachment 371524
Patch

Nice!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1542588</commentid>
    <comment_count>3</comment_count>
      <attachid>371524</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-06-06 16:00:12 -0700</bug_when>
    <thetext>Comment on attachment 371524
Patch

Clearing flags on attachment: 371524

Committed r246174: &lt;https://trac.webkit.org/changeset/246174&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1542589</commentid>
    <comment_count>4</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-06-06 16:00:13 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1542590</commentid>
    <comment_count>5</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-06-06 16:01:51 -0700</bug_when>
    <thetext>&lt;rdar://problem/51503523&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1542620</commentid>
    <comment_count>6</comment_count>
      <attachid>371524</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2019-06-06 16:52:18 -0700</bug_when>
    <thetext>Comment on attachment 371524
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=371524&amp;action=review

&gt; Source/WebKit/ChangeLog:20
&gt; +        (API::HTTPCookieStore::deleteCookie): Avoid using callOnMainThread
&gt; +        becuase it is prohibited in the UI process.

Basic question: Does callOnMainThread already assert if it is called in the UI process?
Expert question: Is there a way to catch such problems at compile time instead of runtime?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1542630</commentid>
    <comment_count>7</comment_count>
    <who name="Tim Horton">thorton</who>
    <bug_when>2019-06-06 17:01:00 -0700</bug_when>
    <thetext>(In reply to Darin Adler from comment #6)
&gt; Comment on attachment 371524 [details]
&gt; Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=371524&amp;action=review
&gt; 
&gt; &gt; Source/WebKit/ChangeLog:20
&gt; &gt; +        (API::HTTPCookieStore::deleteCookie): Avoid using callOnMainThread
&gt; &gt; +        becuase it is prohibited in the UI process.
&gt; 
&gt; Basic question: Does callOnMainThread already assert if it is called in the
&gt; UI process?

I don&apos;t think it does. We have the same problem with WebCore::Timer and I think the process to getting an assertion has been ... fraught. Mostly because it&apos;s OK (and necessary) for *legacy* WebKit to use it in the UI process, and telling the difference is hard. Dave Kilzer was working on this a while back.

&gt; Expert question: Is there a way to catch such problems at compile time
&gt; instead of runtime?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1542640</commentid>
    <comment_count>8</comment_count>
      <attachid>371524</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2019-06-06 17:14:09 -0700</bug_when>
    <thetext>Comment on attachment 371524
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=371524&amp;action=review

&gt;&gt;&gt; Source/WebKit/ChangeLog:20
&gt;&gt;&gt; +        becuase it is prohibited in the UI process.
&gt;&gt; 
&gt;&gt; Basic question: Does callOnMainThread already assert if it is called in the UI process?
&gt;&gt; Expert question: Is there a way to catch such problems at compile time instead of runtime?
&gt; 
&gt; I don&apos;t think it does. We have the same problem with WebCore::Timer and I think the process to getting an assertion has been ... fraught. Mostly because it&apos;s OK (and necessary) for *legacy* WebKit to use it in the UI process, and telling the difference is hard. Dave Kilzer was working on this a while back.

Well, maybe some kind of compile time (or I guess style checker time?) checking would be easier for at least obvious cases like these, since WebKit and LegacyWebKit are in different source directories.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1542644</commentid>
    <comment_count>9</comment_count>
      <attachid>371524</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2019-06-06 17:16:03 -0700</bug_when>
    <thetext>Comment on attachment 371524
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=371524&amp;action=review

&gt;&gt;&gt;&gt; Source/WebKit/ChangeLog:20
&gt;&gt;&gt;&gt; +        becuase it is prohibited in the UI process.
&gt;&gt;&gt; 
&gt;&gt;&gt; Basic question: Does callOnMainThread already assert if it is called in the UI process?
&gt;&gt;&gt; Expert question: Is there a way to catch such problems at compile time instead of runtime?
&gt;&gt; 
&gt;&gt; I don&apos;t think it does. We have the same problem with WebCore::Timer and I think the process to getting an assertion has been ... fraught. Mostly because it&apos;s OK (and necessary) for *legacy* WebKit to use it in the UI process, and telling the difference is hard. Dave Kilzer was working on this a while back.
&gt; 
&gt; Well, maybe some kind of compile time (or I guess style checker time?) checking would be easier for at least obvious cases like these, since WebKit and LegacyWebKit are in different source directories.

Another idea: Add a runtime check that only works in processes that haven’t yet invoked Legacy WebKit at all.
Bonus round: Make processes that aren’t apps explicitly using UIWebView not invoke Legacy WebKit at all.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1542658</commentid>
    <comment_count>10</comment_count>
    <who name="Tim Horton">thorton</who>
    <bug_when>2019-06-06 17:29:35 -0700</bug_when>
    <thetext>(In reply to Darin Adler from comment #9)
&gt; Comment on attachment 371524 [details]
&gt; Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=371524&amp;action=review
&gt; 
&gt; &gt;&gt;&gt;&gt; Source/WebKit/ChangeLog:20
&gt; &gt;&gt;&gt;&gt; +        becuase it is prohibited in the UI process.
&gt; &gt;&gt;&gt; 
&gt; &gt;&gt;&gt; Basic question: Does callOnMainThread already assert if it is called in the UI process?
&gt; &gt;&gt;&gt; Expert question: Is there a way to catch such problems at compile time instead of runtime?
&gt; &gt;&gt; 
&gt; &gt;&gt; I don&apos;t think it does. We have the same problem with WebCore::Timer and I think the process to getting an assertion has been ... fraught. Mostly because it&apos;s OK (and necessary) for *legacy* WebKit to use it in the UI process, and telling the difference is hard. Dave Kilzer was working on this a while back.
&gt; &gt; 
&gt; &gt; Well, maybe some kind of compile time (or I guess style checker time?) checking would be easier for at least obvious cases like these, since WebKit and LegacyWebKit are in different source directories.

That is true!

&gt; Another idea: Add a runtime check that only works in processes that haven’t
&gt; yet invoked Legacy WebKit at all.
&gt; Bonus round: Make processes that aren’t apps explicitly using UIWebView not
&gt; invoke Legacy WebKit at all.

See https://bugs.webkit.org/show_bug.cgi?id=185330 for some of the previous fun, but yes, I vaguely think Dave was doing some of these things. Just haven&apos;t gotten there yet.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>371524</attachid>
            <date>2019-06-06 13:48:16 -0700</date>
            <delta_ts>2019-06-06 16:00:12 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-198622-20190606134815.patch</filename>
            <type>text/plain</type>
            <size>2689</size>
            <attacher name="Geoffrey Garen">ggaren</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJLaXQvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFNvdXJjZS9XZWJL
aXQvQ2hhbmdlTG9nCShyZXZpc2lvbiAyNDYxNjkpCisrKyBTb3VyY2UvV2ViS2l0L0NoYW5nZUxv
Zwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDI0IEBACisyMDE5LTA2LTA2ICBHZW9mZnJleSBH
YXJlbiAgPGdnYXJlbkBhcHBsZS5jb20+CisKKyAgICAgICAgQ3Jhc2ggdXNpbmcgV0tIVFRQQ29v
a2llU3RvcmUgd2hlbiB5b3UgdXNlIFdLV2ViVmlldyBhbmQgVUlXZWJWaWV3IGluIHRoZSBzYW1l
IGFwcAorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1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gICAgICAgIHJldHVybjsKQEAgLTg2LDcgKzg2LDcgQEAgdm9pZCBIVFRQ
Q29va2llU3RvcmU6OnNldENvb2tpZXMoY29uc3QgVgogICAgICAgICAgICAgICAgIG1fb3duaW5n
RGF0YVN0b3JlLT5hZGRQZW5kaW5nQ29va2llKGNvb2tpZSk7CiAgICAgICAgIH0KIAotICAgICAg
ICBjYWxsT25NYWluVGhyZWFkKFdURk1vdmUoY29tcGxldGlvbkhhbmRsZXIpKTsKKyAgICAgICAg
UnVuTG9vcDo6bWFpbigpLmRpc3BhdGNoKFdURk1vdmUoY29tcGxldGlvbkhhbmRsZXIpKTsKICAg
ICAgICAgcmV0dXJuOwogICAgIH0KIApAQCAtMTA1LDcgKzEwNSw3IEBAIHZvaWQgSFRUUENvb2tp
ZVN0b3JlOjpkZWxldGVDb29raWUoY29uc3QKICAgICAgICAgZWxzZQogICAgICAgICAgICAgbV9v
d25pbmdEYXRhU3RvcmUtPnJlbW92ZVBlbmRpbmdDb29raWUoY29va2llKTsKIAotICAgICAgICBj
YWxsT25NYWluVGhyZWFkKFtjb21wbGV0aW9uSGFuZGxlciA9IFdURk1vdmUoY29tcGxldGlvbkhh
bmRsZXIpXSAoKSBtdXRhYmxlIHsKKyAgICAgICAgUnVuTG9vcDo6bWFpbigpLmRpc3BhdGNoKFtj
b21wbGV0aW9uSGFuZGxlciA9IFdURk1vdmUoY29tcGxldGlvbkhhbmRsZXIpXSAoKSBtdXRhYmxl
IHsKICAgICAgICAgICAgIGNvbXBsZXRpb25IYW5kbGVyKCk7CiAgICAgICAgIH0pOwogICAgICAg
ICByZXR1cm47Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>