<?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>160337</bug_id>
          
          <creation_ts>2016-07-29 04:46:23 -0700</creation_ts>
          <short_desc>Crash in JavaScriptCore GC when using JSC on dispatch queues (thread_get_state returns NULL stack pointer)</short_desc>
          <delta_ts>2017-05-10 16:44:29 -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>JavaScriptCore</component>
          <version>Other</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 9.3</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="Ben Nham">nham</reporter>
          <assigned_to name="Mark Lam">mark.lam</assigned_to>
          <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>hszhsh</cc>
    
    <cc>jfbastien</cc>
    
    <cc>keith_miller</cc>
    
    <cc>mark.lam</cc>
    
    <cc>msaboff</cc>
    
    <cc>saam</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1215537</commentid>
    <comment_count>0</comment_count>
    <who name="Ben Nham">nham</who>
    <bug_when>2016-07-29 04:46:23 -0700</bug_when>
    <thetext>We recently enabled the use of JSC APIs in our app from dispatch queues. This lead to a number of crashes in the JSC GC timer so we had to remove this feature from our app. This implies that it&apos;s not safe to use JSC on a dispatch queue.

The crashing stack looks like this on iOS 8 (EXC_BAD_ADDRESS at 0x0):

  Thread #15 Crashed:
  0 JavaScriptCore JSC::ConservativeRoots::add(void*, void*, JSC::JITStubRoutineSet&amp;, JSC::CodeBlockSet&amp;) + 88
  1 JavaScriptCore JSC::MachineThreads::gatherFromOtherThread(JSC::ConservativeRoots&amp;, JSC::MachineThreads::Thread*, JSC::JITStubRoutineSet&amp;, JSC::CodeBlockSet&amp;) + 132
  2 JavaScriptCore JSC::MachineThreads::gatherFromOtherThread(JSC::ConservativeRoots&amp;, JSC::MachineThreads::Thread*, JSC::JITStubRoutineSet&amp;, JSC::CodeBlockSet&amp;) + 132
  3 JavaScriptCore JSC::MachineThreads::gatherConservativeRoots(JSC::ConservativeRoots&amp;, JSC::JITStubRoutineSet&amp;, JSC::CodeBlockSet&amp;, void*, int (&amp;) [48]) + 384
  4 JavaScriptCore JSC::Heap::markRoots(double) + 432
  5 JavaScriptCore JSC::Heap::collect(JSC::HeapOperation) + 376
  6 JavaScriptCore JSC::GCActivityCallback::doWork() + 144
  7 JavaScriptCore JSC::HeapTimer::timerDidFire(__CFRunLoopTimer*, void*) + 196
  8 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 24
  9 CoreFoundation __CFRunLoopDoTimer + 884
  10 CoreFoundation __CFRunLoopRun + 1368
  11 CoreFoundation CFRunLoopRunSpecific + 392
  12 Facebook +[RCTJSCExecutor runRunLoopThread] (RCTJSCExecutor.mm:280)
  13 Foundation __NSThread__main__ + 1068
  14 libsystem_pthread.dylib _pthread_body + 160
  15 libsystem_pthread.dylib _pthread_start + 156
  16 libsystem_pthread.dylib thread_start + 0

Basically, this is the marker segfaulting on trying to dereference a stack pointer of 0x0 for the target thread. (For this crash, we actually have a dump of the entire state of the stack in this crash, and were able to walk up the stack and find the Thread::Registers instance right on the stack clearly showing a SP of 0x0.)

The crashing stack looks like this on iOS 9 (EXC_BAD_ACCESS at 0xbbadbeef):

  Thread #11 Crashed:
  0 JavaScriptCore bmalloc::Heap::allocateXLarge(std::__1::lock_guard&lt;bmalloc::StaticMutex&gt;&amp;, unsigned long) + 36
  1 JavaScriptCore bmalloc::Heap::allocateXLarge(std::__1::lock_guard&lt;bmalloc::StaticMutex&gt;&amp;, unsigned long) + 20
  2 JavaScriptCore bmalloc::Allocator::allocateXLarge(unsigned long) + 92
  3 JavaScriptCore JSC::MachineThreads::gatherConservativeRoots(JSC::ConservativeRoots&amp;, JSC::JITStubRoutineSet&amp;, JSC::CodeBlockSet&amp;, void*, void*, int (&amp;) [48]) + 176
  4 JavaScriptCore JSC::Heap::markRoots(double, void*, void*, int (&amp;) [48]) + 384
  5 JavaScriptCore JSC::Heap::collectImpl(JSC::HeapOperation, void*, void*, int (&amp;) [48]) + 612
  6 JavaScriptCore JSC::Heap::collect(JSC::HeapOperation) + 92
  7 JavaScriptCore JSC::GCActivityCallback::doWork() + 88
  8 JavaScriptCore JSC::HeapTimer::timerDidFire(__CFRunLoopTimer*, void*) + 216
  9 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 24
  10 CoreFoundation __CFRunLoopDoTimer + 880
  11 CoreFoundation __CFRunLoopRun + 1516
  12 CoreFoundation CFRunLoopRunSpecific + 380
  13 Facebook +[RCTJSCExecutor runRunLoopThread] (RCTJSCExecutor.mm:280)
  14 Foundation __NSThread__start__ + 996
  15 libsystem_pthread.dylib _pthread_body + 152
  16 libsystem_pthread.dylib _pthread_start + 152
  17 libsystem_pthread.dylib thread_start + 0

Basically, this is bmalloc crashing on purpose because vm_allocate can&apos;t allocate a large enough contiguous region to hold the target thread&apos;s stack, presumably because JSC thinks the stack is ginormous due to it having a SP of 0x0.

It looks like the basic issue here is that JSC uses thread_get_state to the the stack pointer of the target thread. Unfortunately, thread_get_state sometimes returns a SP of 0x0 for a thread. See &lt;rdar://27607384&gt; and https://openradar.appspot.com/27607384 for more details. Basically, when the target thread is a dispatch queue thread that&apos;s just about to run with this call stack:

  Thread #32:
  0 libsystem_pthread.dylib start_wqthread + 0

then thread_get_state may return 0x0 for the SP, causing the crashes in JSC GC outlined above.

It&apos;s unclear to me whether this is actually a kernel bug or a JSC bug, but it seems like it might be a good idea for JSC to be defensive against a SP of 0x0 and have it abort marking if a thread is in this state. Additionally, it seems like MachineStackMarker.cpp should do some sort of sanity check on the size of the stack and not try to allocate a ginormous buffer to hold a thread&apos;s stack. For instance, on iOS I believe the maximum size of a stack is 1 MB, so JSC should never be allocating more than that amount of space to hold a single thread&apos;s stack.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1215591</commentid>
    <comment_count>1</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2016-07-29 10:48:25 -0700</bug_when>
    <thetext>I don&apos;t think we want to set a stack size maximum because stack size is configurable.

But it sounds like we do need a specific workaround for the case where thread_get_state returns a bogus value.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1215592</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2016-07-29 10:48:44 -0700</bug_when>
    <thetext>&lt;rdar://problem/27611733&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1219285</commentid>
    <comment_count>3</comment_count>
    <who name="Ben Nham">nham</who>
    <bug_when>2016-08-11 02:12:58 -0700</bug_when>
    <thetext>Core OS  wrote back in &lt;rdar://27607384&gt;:

  Can you guys use thread_get_register_pointer_values() as an alternative?

This seems like it would fix the issue because thread_get_register_pointer_values appears to be a wrapper function around thread_get_state that a) filters out any pointers pointing to the null page and b) properly takes into account the red zone beneath the stack pointer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1219288</commentid>
    <comment_count>4</comment_count>
    <who name="Ben Nham">nham</who>
    <bug_when>2016-08-11 02:19:55 -0700</bug_when>
    <thetext>Actually looking at this a bit more, I still don&apos;t think thread_get_register_pointer_values will do the right thing. For instance, on x86_64, it returns SP - 128 (taking in to account the red zone underneath the stack pointer):

#elif defined(__x86_64__)
    if (sp) *sp = state.__rsp - 128 /* redzone */;

This means that thread_get_register_pointer_values would actually return -128 when state.__rsp is 0x0, which is also an invalid stack pointer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1219291</commentid>
    <comment_count>5</comment_count>
    <who name="Ben Nham">nham</who>
    <bug_when>2016-08-11 02:23:18 -0700</bug_when>
    <thetext>Ugh, I&apos;m commenting too fast. thread_get_register_pointer_values just leaves the sp output parameter untouched when state.__rsp (or the equivalent register on another arch) is 0x0 and also returns KERN_SUCCESS. I don&apos;t see how this behavior would fix this crash. Seems like the simplest workaround is to ignore threads with null stack pointers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1269078</commentid>
    <comment_count>6</comment_count>
    <who name="Shuan Zhao">hszhsh</who>
    <bug_when>2017-01-23 09:45:58 -0800</bug_when>
    <thetext>Is anyone working on this? I have similar issue with iOS 9.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1306930</commentid>
    <comment_count>7</comment_count>
      <attachid>309621</attachid>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2017-05-10 11:24:24 -0700</bug_when>
    <thetext>Created attachment 309621
proposed patch.

Let&apos;s try this on the EWS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1306944</commentid>
    <comment_count>8</comment_count>
      <attachid>309621</attachid>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2017-05-10 12:21:09 -0700</bug_when>
    <thetext>Comment on attachment 309621
proposed patch.

r=me.  Did you mean to set r??</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1306946</commentid>
    <comment_count>9</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2017-05-10 12:27:51 -0700</bug_when>
    <thetext>(In reply to Filip Pizlo from comment #8)
&gt; Comment on attachment 309621 [details]
&gt; proposed patch.
&gt; 
&gt; r=me.  Did you mean to set r??

Oops.  Yes, I forgot to set the r? after the EWS results were satisfactory.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1306947</commentid>
    <comment_count>10</comment_count>
      <attachid>309621</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2017-05-10 12:30:47 -0700</bug_when>
    <thetext>Comment on attachment 309621
proposed patch.

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1306963</commentid>
    <comment_count>11</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2017-05-10 13:07:40 -0700</bug_when>
    <thetext>Thanks for the reviews.  Landed in r216608: &lt;http://trac.webkit.org/r216608&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1306975</commentid>
    <comment_count>12</comment_count>
      <attachid>309621</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2017-05-10 13:25:07 -0700</bug_when>
    <thetext>Comment on attachment 309621
proposed patch.

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

&gt; Source/JavaScriptCore/heap/MachineStackMarker.cpp:316
&gt; +    // This is a workaround for &lt;rdar://problem/27607384&gt;. During thread initialization,
&gt; +    // for some target platforms, thread state is momentarily set to 0 before being

Thinking about this again, I don&apos;t think this explanation can be correct.

JSC only scans threads after they register themselves by invoking a JSC API. So, it&apos;s impossible that JSC would try to scan a thread that had not yet initialized. Given that, I don&apos;t think you&apos;ve fixed this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1306990</commentid>
    <comment_count>13</comment_count>
      <attachid>309621</attachid>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2017-05-10 13:50:28 -0700</bug_when>
    <thetext>Comment on attachment 309621
proposed patch.

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

&gt;&gt; Source/JavaScriptCore/heap/MachineStackMarker.cpp:316
&gt;&gt; +    // for some target platforms, thread state is momentarily set to 0 before being
&gt; 
&gt; Thinking about this again, I don&apos;t think this explanation can be correct.
&gt; 
&gt; JSC only scans threads after they register themselves by invoking a JSC API. So, it&apos;s impossible that JSC would try to scan a thread that had not yet initialized. Given that, I don&apos;t think you&apos;ve fixed this bug.

Read on below: &quot;This issue may manifest with workqueue threads where the OS may choose to recycle a thread for an expired task.&quot;

A more conclusive fix is to ensure that workqueue threads will properly invoke the thread destructor code, but short of that, this is a workaround that should work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1307041</commentid>
    <comment_count>14</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2017-05-10 15:17:19 -0700</bug_when>
    <thetext>&gt; Read on below: &quot;This issue may manifest with workqueue threads where the OS
&gt; may choose to recycle a thread for an expired task.&quot;
&gt; 
&gt; A more conclusive fix is to ensure that workqueue threads will properly
&gt; invoke the thread destructor code, but short of that, this is a workaround
&gt; that should work.

If we believe that we have workqueue threads that terminate without invoking their destructors, then we may still have a bug where we scan those threads after they deallocate their stacks. Seems like we need closer investigation of the conditions that produce this null.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1307064</commentid>
    <comment_count>15</comment_count>
      <attachid>309621</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2017-05-10 16:08:03 -0700</bug_when>
    <thetext>Comment on attachment 309621
proposed patch.

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

&gt; Source/JavaScriptCore/heap/MachineStackMarker.cpp:325
&gt; +    // This is a workaround for &lt;rdar://problem/27607384&gt;. During thread initialization,
&gt; +    // for some target platforms, thread state is momentarily set to 0 before being
&gt; +    // filled in with the target thread&apos;s real register values. As a result, there&apos;s
&gt; +    // a race condition that may result in us getting a null stackPointer.
&gt; +    // This issue may manifest with workqueue threads where the OS may choose to recycle
&gt; +    // a thread for an expired task.
&gt; +    //
&gt; +    // The workaround is simply to indicate that there&apos;s nothing to copy and return.
&gt; +    // This is correct because we will only ever observe a null pointer during thread
&gt; +    // initialization. Hence, by definition, there&apos;s nothing there that we need to scan
&gt; +    // yet, and therefore, nothing that needs to be copied.

I would just say this:

// This is a workaround for &lt;rdar://problem/27607384&gt;. libdispatch recycles work queue threads without running pthread exit destructors. This can cause us to scan a thread during work queue initialization, when the stack pointer is null.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1307079</commentid>
    <comment_count>16</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2017-05-10 16:44:29 -0700</bug_when>
    <thetext>(In reply to Geoffrey Garen from comment #15)
&gt; I would just say this:
&gt; 
&gt; // This is a workaround for &lt;rdar://problem/27607384&gt;. libdispatch recycles
&gt; work queue threads without running pthread exit destructors. This can cause
&gt; us to scan a thread during work queue initialization, when the stack pointer
&gt; is null.

Landed this comment change in r216637: &lt;http://trac.webkit.org/r216637&gt;.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>309621</attachid>
            <date>2017-05-10 11:24:24 -0700</date>
            <delta_ts>2017-05-10 12:30:47 -0700</delta_ts>
            <desc>proposed patch.</desc>
            <filename>bug-160337.patch</filename>
            <type>text/plain</type>
            <size>3084</size>
            <attacher name="Mark Lam">mark.lam</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMjE2NTk2KQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDI2IEBA
CisyMDE3LTA1LTEwICBNYXJrIExhbSAgPG1hcmsubGFtQGFwcGxlLmNvbT4KKworICAgICAgICBD
cmFzaCBpbiBKYXZhU2NyaXB0Q29yZSBHQyB3aGVuIHVzaW5nIEpTQyBvbiBkaXNwYXRjaCBxdWV1
ZXMgKHRocmVhZF9nZXRfc3RhdGUgc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gc2NhbgorICAgIC8vIHlldCwgYW5kIHRoZXJl
Zm9yZSwgbm90aGluZyB0aGF0IG5lZWRzIHRvIGJlIGNvcGllZC4KKyAgICBpZiAoVU5MSUtFTFko
IXJlZ2lzdGVycy5zdGFja1BvaW50ZXIoKSkpIHsKKyAgICAgICAgKnNpemUgPSAwOworICAgICAg
ICByZXR1cm47CisgICAgfQorCiAgICAgc3RkOjpwYWlyPHZvaWQqLCBzaXplX3Q+IHN0YWNrID0g
dGhyZWFkLT5jYXB0dXJlU3RhY2socmVnaXN0ZXJzLnN0YWNrUG9pbnRlcigpKTsKIAogICAgIGJv
b2wgY2FuQ29weSA9ICpzaXplICsgcmVnaXN0ZXJzU2l6ZSArIHN0YWNrLnNlY29uZCA8PSBjYXBh
Y2l0eTsK
</data>
<flag name="review"
          id="330801"
          type_id="1"
          status="+"
          setter="ggaren"
    />
          </attachment>
      

    </bug>

</bugzilla>