<?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>193026</bug_id>
          
          <creation_ts>2018-12-24 19:57:53 -0800</creation_ts>
          <short_desc>Assert in NetworkHTTPSUpgradeChecker::query()</short_desc>
          <delta_ts>2022-02-12 22:07:52 -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>Page Loading</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=193075</see_also>
          <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>
          <dependson>193075</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Simon Fraser (smfr)">simon.fraser</reporter>
          <assigned_to name="Chris Dumez">cdumez</assigned_to>
          <cc>achristensen</cc>
    
    <cc>ap</cc>
    
    <cc>beidson</cc>
    
    <cc>bfulgham</cc>
    
    <cc>cdumez</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1490750</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2018-12-24 19:57:53 -0800</bug_when>
    <thetext>I just hit this assertion on the first test (imported/w3c/web-platform-tests/css/css-color/border-bottom-color.xht) when running &quot;run-webkit-tests --debug --no-build --no-show-results LayoutTests/imported/w3c/web-platform-tests/css/css-color/&quot;

Crashed Thread:        1  Dispatch queue: HTTPS Upgrade Checker Thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x00000000bbadbeef
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [13618]

VM Regions Near 0xbbadbeef:
--&gt; 
    __TEXT                 000000010d1ce000-000000010d1d0000 [    8K] r-x/rwx SM=COW  /Volumes/VOLUME/*/WebKit.framework/Versions/A/XPCServices/com.apple.WebKit.Networking.xpc/Contents/MacOS/com.apple.WebKit.Networking.Development

Thread 0:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	0x00007fff61117c2a mach_msg_trap + 10
1   libsystem_kernel.dylib        	0x00007fff61118174 mach_msg + 60
2   com.apple.CoreFoundation      	0x00007fff33f3c05e __CFRunLoopServiceMachPort + 337
3   com.apple.CoreFoundation      	0x00007fff33f3b5ad __CFRunLoopRun + 1654
4   com.apple.CoreFoundation      	0x00007fff33f3ace4 CFRunLoopRunSpecific + 463
5   com.apple.Foundation          	0x00007fff3629b5da -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 280
6   com.apple.Foundation          	0x00007fff3629b4af -[NSRunLoop(NSRunLoop) run] + 76
7   libxpc.dylib                  	0x00007fff61215ee6 _xpc_objc_main + 555
8   libxpc.dylib                  	0x00007fff612159e5 xpc_main + 433
9   com.apple.WebKit.Networking   	0x000000010d1cf035 WebKit::XPCServiceMain(int, char const**) + 1333 (XPCServiceMain.mm:157)
10  com.apple.WebKit.Networking   	0x000000010d1cf322 main + 34 (XPCServiceMain.mm:165)
11  libdyld.dylib                 	0x00007fff60fdf085 start + 1

Thread 1 Crashed:: Dispatch queue: HTTPS Upgrade Checker Thread
0   com.apple.JavaScriptCore      	0x00000001252837f0 WTFCrash + 16 (Assertions.cpp:255)
1   com.apple.WebKit              	0x000000010d1ebe5b WTFCrashWithInfo(int, char const*, char const*, int) + 27 (Assertions.h:559)
2   com.apple.WebKit              	0x000000010d44b3cd WebKit::NetworkHTTPSUpgradeChecker::query(WTF::String&amp;&amp;, PAL::SessionID, WTF::CompletionHandler&lt;void (bool)&gt;&amp;&amp;)::$_11::operator()() + 525 (NetworkHTTPSUpgradeChecker.cpp:99)
3   com.apple.WebKit              	0x000000010d44b0f9 WTF::Function&lt;void ()&gt;::CallableWrapper&lt;WebKit::NetworkHTTPSUpgradeChecker::query(WTF::String&amp;&amp;, PAL::SessionID, WTF::CompletionHandler&lt;void (bool)&gt;&amp;&amp;)::$_11&gt;::call() + 25 (Function.h:101)
4   com.apple.JavaScriptCore      	0x00000001252acf7f WTF::Function&lt;void ()&gt;::operator()() const + 175 (Function.h:56)
5   com.apple.JavaScriptCore      	0x000000012538a1a9 WTF::WorkQueue::dispatch(WTF::Function&lt;void ()&gt;&amp;&amp;)::$_0::operator()() const + 25 (WorkQueueCocoa.cpp:38)
6   com.apple.JavaScriptCore      	0x000000012538a3e0 WTF::BlockPtr&lt;void ()&gt; WTF::BlockPtr&lt;void ()&gt;::fromCallable&lt;WTF::WorkQueue::dispatch(WTF::Function&lt;void ()&gt;&amp;&amp;)::$_0&gt;(WTF::WorkQueue::dispatch(WTF::Function&lt;void ()&gt;&amp;&amp;)::$_0)::&apos;lambda&apos;(void*)::operator()(void*) const + 32 (BlockPtr.h:96)
7   com.apple.JavaScriptCore      	0x000000012538a3b8 WTF::BlockPtr&lt;void ()&gt; WTF::BlockPtr&lt;void ()&gt;::fromCallable&lt;WTF::WorkQueue::dispatch(WTF::Function&lt;void ()&gt;&amp;&amp;)::$_0&gt;(WTF::WorkQueue::dispatch(WTF::Function&lt;void ()&gt;&amp;&amp;)::$_0)::&apos;lambda&apos;(void*)::__invoke(void*) + 24 (BlockPtr.h:95)
8   libdispatch.dylib             	0x00007fff60f8fd4f _dispatch_call_block_and_release + 12
9   libdispatch.dylib             	0x00007fff60f90dcb _dispatch_client_callout + 8
10  libdispatch.dylib             	0x00007fff60f97120 _dispatch_lane_serial_drain + 618
11  libdispatch.dylib             	0x00007fff60f97bd8 _dispatch_lane_invoke + 388
12  libdispatch.dylib             	0x00007fff60fa0084 _dispatch_workloop_worker_thread + 603
13  libsystem_pthread.dylib       	0x00007fff611d061c _pthread_wqthread + 409
14  libsystem_pthread.dylib       	0x00007fff611d0415 start_wqthread + 13

It&apos;s ASSERT(stepResult == SQLITE_ROW || stepResult == SQLITE_DONE);.

I&apos;m also confused about how this function calls ASSERT(RunLoop::isMain()); but is running on a dispatch thread.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1490791</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-12-25 21:04:05 -0800</bug_when>
    <thetext>&lt;rdar://problem/46945206&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1491143</commentid>
    <comment_count>2</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2019-01-02 08:24:20 -0800</bug_when>
    <thetext>&gt; I&apos;m also confused about how this function calls ASSERT(RunLoop::isMain()); but is running on a dispatch thread.

It checks that it is on the main thread *then* dispatches on the dispatch queue. The crash is in the lambda that runs on the background queue. That part seems fine / expected.

Note that I am surprised this code is running at all since the feature is supposed to be off by default.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1491146</commentid>
    <comment_count>3</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2019-01-02 08:31:43 -0800</bug_when>
    <thetext>(In reply to Chris Dumez from comment #2)
&gt; &gt; I&apos;m also confused about how this function calls ASSERT(RunLoop::isMain()); but is running on a dispatch thread.
&gt; 
&gt; It checks that it is on the main thread *then* dispatches on the dispatch
&gt; queue. The crash is in the lambda that runs on the background queue. That
&gt; part seems fine / expected.
&gt; 
&gt; Note that I am surprised this code is running at all since the feature is
&gt; supposed to be off by default.

I cannot reproduce the crashes with &apos;run-webkit-tests --debug --no-build --no-show-results LayoutTests/imported/w3c/web-platform-tests/css/css-color/&apos; but I was able to confirm the feature is on when running layout tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1491147</commentid>
    <comment_count>4</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2019-01-02 08:36:46 -0800</bug_when>
    <thetext>(In reply to Chris Dumez from comment #3)
&gt; (In reply to Chris Dumez from comment #2)
&gt; &gt; &gt; I&apos;m also confused about how this function calls ASSERT(RunLoop::isMain()); but is running on a dispatch thread.
&gt; &gt; 
&gt; &gt; It checks that it is on the main thread *then* dispatches on the dispatch
&gt; &gt; queue. The crash is in the lambda that runs on the background queue. That
&gt; &gt; part seems fine / expected.
&gt; &gt; 
&gt; &gt; Note that I am surprised this code is running at all since the feature is
&gt; &gt; supposed to be off by default.
&gt; 
&gt; I cannot reproduce the crashes with &apos;run-webkit-tests --debug --no-build
&gt; --no-show-results
&gt; LayoutTests/imported/w3c/web-platform-tests/css/css-color/&apos; but I was able
&gt; to confirm the feature is on when running layout tests.

All experimental features get enabled when running layout tests based on code inspection so this is expected as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1491823</commentid>
    <comment_count>5</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2019-01-04 13:12:28 -0800</bug_when>
    <thetext>Simon, can you still reproduce this? If so, logging I added via Bug 193075 should help me debug. I personally cannot reproduce.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>