<?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>148380</bug_id>
          
          <creation_ts>2015-08-24 10:22:41 -0700</creation_ts>
          <short_desc>Web Inspector: REGRESSION: JSC crashes when pausing at console.assert statement</short_desc>
          <delta_ts>2016-01-26 18:01:44 -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>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.10</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>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Blaze Burg">bburg</reporter>
          <assigned_to name="Saam Barati">saam</assigned_to>
          <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>joepeck</cc>
    
    <cc>mark.lam</cc>
    
    <cc>saam</cc>
    
    <cc>timothy</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1120286</commentid>
    <comment_count>0</comment_count>
      <attachid>259756</attachid>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2015-08-24 10:22:41 -0700</bug_when>
    <thetext>Created attachment 259756
test case

STEPS TO REPRODUCE:

1. Open the attached test case.
2. Open Web Inspector
3. Open Inspector^2 (Right-click and &quot;Inspecto Element&quot; in the Web Inspector, if the option doesn&apos;t exist follow steps here: http://trac.webkit.org/wiki/WebInspectorDebugging)
4. In Debugger tab, enable &quot;Break on [All] Exceptions&quot;.
5. Set a breakpoint in Inspector^1 at the line with `console.assert(...)`.
6. Reload the inspected page.

EXPECTED:

 * Should pause at console.assert line but not at the breakpoint, because of Step (4).

ACTUAL:

 * Crashes with this callstack (100% reproducible on my machine)

--


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

VM Regions Near 0xbbadbeef:
--&gt; 
    __TEXT                 0000000106d1c000-0000000106d1e000 [    8K] r-x/rwx SM=COW  /Users/USER/*/WebKit.framework/Versions/A/XPCServices/com.apple.WebKit.WebContent.Development.xpc/Contents/MacOS/com.apple.WebKit.WebContent.Development

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.JavaScriptCore      	0x000000010d326fbe WTFCrash + 62
1   com.apple.JavaScriptCore      	0x000000010cd2b348 JSC::CodeBlock::setOptimizationThresholdBasedOnCompilationResult(JSC::CompilationResult) + 776
2   com.apple.JavaScriptCore      	0x000000010d09af9c JSC::JITToDFGDeferredCompilationCallback::compilationDidComplete(JSC::CodeBlock*, JSC::CompilationResult) + 140
3   com.apple.JavaScriptCore      	0x000000010cf31691 JSC::DFG::Worklist::completeAllReadyPlansForVM(JSC::VM&amp;, JSC::DFG::CompilationKey) + 257
4   com.apple.JavaScriptCore      	0x000000010cf318ce JSC::DFG::Worklist::completeAllPlansForVM(JSC::VM&amp;) + 62
5   com.apple.JavaScriptCore      	0x000000010cf32ca8 JSC::DFG::completeAllPlansForVM(JSC::VM&amp;) + 56
6   com.apple.JavaScriptCore      	0x000000010cd6852c JSC::Debugger::exception(JSC::ExecState*, JSC::JSValue, bool) + 108
7   com.apple.JavaScriptCore      	0x000000010d043475 JSC::Interpreter::unwind(void*&amp;, JSC::ExecState*&amp;, JSC::Exception*) + 325
8   com.apple.JavaScriptCore      	0x000000010d06149a JSC::genericUnwind(JSC::VM*, JSC::ExecState*) + 90
9   com.apple.JavaScriptCore      	0x000000010d19c41d llint_slow_path_handle_exception + 45
10  com.apple.JavaScriptCore      	0x000000010d1a420a llint_entry + 15423
11  com.apple.JavaScriptCore      	0x000000010d1a5efd llint_entry + 22834
12  com.apple.JavaScriptCore      	0x000000010d1a03bb vmEntryToJavaScript + 326
13  com.apple.JavaScriptCore      	0x000000010d05fbe9 JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) + 169
14  com.apple.JavaScriptCore      	0x000000010d0464da JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&amp;, JSC::JSValue, JSC::ArgList const&amp;) + 474
15  com.apple.JavaScriptCore      	0x000000010cd12a0e JSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&amp;, JSC::JSValue, JSC::ArgList const&amp;) + 62
16  com.apple.JavaScriptCore      	0x000000010d2d31ce JSC::JSJobMicrotask::run(JSC::ExecState*) + 734
17  com.apple.WebCore             	0x000000010de24add WebCore::JSGlobalObjectCallback::call() + 189 (JSMainThreadExecState.h:93)
18  com.apple.WebCore             	0x000000010d9eaf31 std::__1::__function::__func&lt;WebCore::Document::postTask(WebCore::ScriptExecutionContext::Task)::$_0, std::__1::allocator&lt;WebCore::Document::postTask(WebCore::ScriptExecutionContext::Task)::$_0&gt;, void ()&gt;::operator()() + 113 (memory:2624)
19  com.apple.JavaScriptCore      	0x000000010d33f97d WTF::dispatchFunctionsFromMainThread() + 525
20  com.apple.Foundation          	0x00007fff8941cdd0 __NSThreadPerformPerform + 293
21  com.apple.CoreFoundation      	0x00007fff8ed5da01 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
22  com.apple.CoreFoundation      	0x00007fff8ed4fb8d __CFRunLoopDoSources0 + 269
23  com.apple.CoreFoundation      	0x00007fff8ed4f1bf __CFRunLoopRun + 927
24  com.apple.CoreFoundation      	0x00007fff8ed4ebd8 CFRunLoopRunSpecific + 296
25  com.apple.HIToolbox           	0x00007fff890b656f RunCurrentEventLoopInMode + 235
26  com.apple.HIToolbox           	0x00007fff890b62ea ReceiveNextEventCommon + 431
27  com.apple.HIToolbox           	0x00007fff890b612b _BlockUntilNextEventMatchingListInModeWithFilter + 71
28  com.apple.AppKit              	0x00007fff852938ab _DPSNextEvent + 978
29  com.apple.AppKit              	0x00007fff85292e58 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 346
30  com.apple.AppKit              	0x00007fff85288af3 -[NSApplication run] + 594
31  com.apple.AppKit              	0x00007fff85205244 NSApplicationMain + 1832
32  libxpc.dylib                  	0x00007fff9295f928 _xpc_objc_main + 793
33  libxpc.dylib                  	0x00007fff92961030 xpc_main + 490
34  com.apple.WebKit.WebContent.Development	0x0000000106d1d675 main + 21 (XPCServiceMain.Development.mm:90)
35  libdyld.dylib                 	0x00007fff8cff55c9 start + 1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1120302</commentid>
    <comment_count>1</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2015-08-24 10:55:49 -0700</bug_when>
    <thetext>I can&apos;t seem to reproduce this using Spade-188767-74819.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1120309</commentid>
    <comment_count>2</comment_count>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2015-08-24 11:07:26 -0700</bug_when>
    <thetext>Possibly useful message that got dumped to console:

toLength#CIvpti:[0x121ad8250-&gt;0x113499800, BaselineFunctionCall, 66 (StrictMode) (FTLFail)]: we have result = CompilationSuccessful but we are our own replacement.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1120327</commentid>
    <comment_count>3</comment_count>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2015-08-24 11:51:08 -0700</bug_when>
    <thetext>I was able to reproduce this with a build from Sunday, prior to ggaren&apos;s two patches being rolled back in. So this might be unrelated to those patches after all.

Another one:

readToken#AvwLUZ:[0x12822a250-&gt;0x119dc5f00, BaselineFunctionCall, 388 (StrictMode) (FTLFail)]: we have result = CompilationSuccessful but we are our own replacement.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1122176</commentid>
    <comment_count>4</comment_count>
      <attachid>260288</attachid>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2015-08-31 09:15:29 -0700</bug_when>
    <thetext>Created attachment 260288
better test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1122178</commentid>
    <comment_count>5</comment_count>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2015-08-31 09:18:11 -0700</bug_when>
    <thetext>Simpler steps to reproduce:

STEPS TO REPRODUCE:

1. Open the attached test case.
2. Open Web Inspector
3. In Debugger tab, enable &quot;Break on [All] Exceptions&quot; (at the top of the left sidebar).
4. Set a breakpoint at the line with `console.assert(...)`.
5. Reload the inspected page.

EXPECTED:

 * Should pause at at the breakpoint. Breakpoint should be hit before evaluating console.assert, which also pauses the debugger.

ACTUAL:

 * Crashes with this callstack in Debugger::pause underneath evaluating console.assert.

--</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1122206</commentid>
    <comment_count>6</comment_count>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2015-08-31 10:40:51 -0700</bug_when>
    <thetext>I have bisected the regression to this commit:

http://trac.webkit.org/changeset/188714

Please advise whether this can be fixed quickly or it should be rolled out for further analysis.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1122302</commentid>
    <comment_count>7</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2015-08-31 14:39:30 -0700</bug_when>
    <thetext>I still can&apos;t seem to reproduce this crash, using a debug or release build. Is there anything special to how you toggle breakpoints or reload the page?

I can&apos;t promise a quick fix if I can&apos;t reproduce the crash -- but I also don&apos;t think the original patch will roll out cleanly :(.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1122338</commentid>
    <comment_count>8</comment_count>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2015-08-31 16:16:01 -0700</bug_when>
    <thetext>After a full rebuild on ToT, no longer able to reproduce. Closing for now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1122653</commentid>
    <comment_count>9</comment_count>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2015-09-01 14:46:35 -0700</bug_when>
    <thetext>Saam was able to reproduce this last night on TOT.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1122654</commentid>
    <comment_count>10</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-09-01 14:48:46 -0700</bug_when>
    <thetext>&lt;rdar://problem/22527158&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1159157</commentid>
    <comment_count>11</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2016-01-26 18:01:44 -0800</bug_when>
    <thetext>This no longer crashes for me</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>259756</attachid>
            <date>2015-08-24 10:22:41 -0700</date>
            <delta_ts>2015-08-31 09:15:29 -0700</delta_ts>
            <desc>test case</desc>
            <filename>interleaved-native-call-frame.html</filename>
            <type>text/html</type>
            <size>458</size>
            <attacher name="Blaze Burg">bburg</attacher>
            
              <data encoding="base64">PCFkb2N0eXBlIGh0bWw+CjxodG1sPgo8Ym9keSBvbmxvYWQ9InJ1blRlc3QoKSI+CjxzY3JpcHQ+
CgpmdW5jdGlvbiBydW5UZXN0KCkKewogICAgbGV0IGEgPSAoKSA9PiB7IGIoKTsgfTsKICAgIGxl
dCBiID0gKCkgPT4geyBjKCk7IH07CiAgICBsZXQgZCA9IChldmVudCkgPT4gewogICAgICAgIGNv
bnNvbGUuYXNzZXJ0KGV2ZW50KTsKICAgIH07CiAgICBsZXQgYyA9ICgpID0+IHsKICAgICAgICB3
aW5kb3cuYWRkRXZlbnRMaXN0ZW5lcigiY2xpY2siLCBkKTsKICAgICAgICBsZXQgZSA9IG5ldyBN
b3VzZUV2ZW50KCJjbGljayIpOwogICAgICAgIHdpbmRvdy5kaXNwYXRjaEV2ZW50KGUpOwogICAg
fTsKCiAgICBhKCk7Cn0KCjwvc2NyaXB0PgoKPHA+VG8gcmVwcm9kdWNlIHRoZSBidWcsIG9wZW4g
dGhlIFdlYiBJbnNwZWN0b3IgYW5kIHJlbG9hZCB0aGUgcGFnZS48L3A+Cgo8L2JvZHk+CjwvaHRt
bD4=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>260288</attachid>
            <date>2015-08-31 09:15:29 -0700</date>
            <delta_ts>2015-08-31 09:15:29 -0700</delta_ts>
            <desc>better test case</desc>
            <filename>plain-console-assert.html</filename>
            <type>text/html</type>
            <size>210</size>
            <attacher name="Blaze Burg">bburg</attacher>
            
              <data encoding="base64">PCFkb2N0eXBlIGh0bWw+CjxodG1sPgo8Ym9keSBvbmxvYWQ9InJ1blRlc3QoKSI+CjxzY3JpcHQ+
CgpmdW5jdGlvbiBydW5UZXN0KCkKewogICAgY29uc29sZS5hc3NlcnQoZXZlbnQpOwp9Cgo8L3Nj
cmlwdD4KCjxwPlRvIHJlcHJvZHVjZSB0aGUgYnVnLCBvcGVuIHRoZSBXZWIgSW5zcGVjdG9yIGFu
ZCByZWxvYWQgdGhlIHBhZ2UuPC9wPgoKPC9ib2R5Pgo8L2h0bWw+
</data>

          </attachment>
      

    </bug>

</bugzilla>