<?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>192882</bug_id>
          
          <creation_ts>2018-12-19 14:24:48 -0800</creation_ts>
          <short_desc>Crash in JSC::speculationFromCell</short_desc>
          <delta_ts>2018-12-20 19:49:32 -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>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>192050</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1489481</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2018-12-19 14:24:48 -0800</bug_when>
    <thetext>I hit this crash viewing:

https://stackoverflow.com/questions/736513/how-do-i-parse-a-url-into-hostname-and-path-in-javascript

It was seemingly random. I don&apos;t know how to reproduce it. This is using 2.23.1 (r239394).

(gdb) bt full
#0  JSC::speculationFromCell (cell=0xe960) at ../Source/JavaScriptCore/runtime/JSCellInlines.h:203
        string = &lt;optimized out&gt;
        impl = &lt;optimized out&gt;
#1  0x00007f71130e2f96 in JSC::ValueProfileBase&lt;1u&gt;::computeUpdatedPrediction (this=&lt;optimized out&gt;)
    at ../Source/JavaScriptCore/runtime/JSCJSValueInlines.h:392
        value = &lt;optimized out&gt;
        i = 0
#2  JSC::CodeBlock::&lt;lambda(JSC::ValueProfile&amp;)&gt;::operator() (__closure=&lt;optimized out&gt;, 
    __closure=&lt;optimized out&gt;, profile=...) at ../Source/JavaScriptCore/bytecode/CodeBlock.cpp:2587
        numSamples = &lt;optimized out&gt;
        numberOfSamplesInProfiles = &lt;optimized out&gt;
        locker = &lt;optimized out&gt;
        numberOfLiveNonArgumentValueProfiles = &lt;optimized out&gt;
        __closure = &lt;optimized out&gt;
        __closure = &lt;optimized out&gt;
        profile = &lt;optimized out&gt;
        locker = &lt;optimized out&gt;
        numberOfSamplesInProfiles = &lt;optimized out&gt;
        numberOfLiveNonArgumentValueProfiles = &lt;optimized out&gt;
        numSamples = &lt;optimized out&gt;
        numberOfSamplesInProfiles = &lt;optimized out&gt;
        locker = &lt;optimized out&gt;
        numberOfLiveNonArgumentValueProfiles = &lt;optimized out&gt;
        numberOfSamplesInProfiles = &lt;optimized out&gt;
        locker = &lt;optimized out&gt;
        numberOfLiveNonArgumentValueProfiles = &lt;optimized out&gt;
        numSamples = &lt;optimized out&gt;
#3  JSC::CodeBlock::&lt;lambda(auto:25&amp;)&gt;::operator()&lt;JSC::OpGetFromScope::Metadata&gt; (
    this=&lt;optimized out&gt;, metadata=...) at ../Source/JavaScriptCore/bytecode/CodeBlockInlines.h:44
        func = &lt;optimized out&gt;
        func = &lt;optimized out&gt;
#4  JSC::MetadataTable::forEach&lt;JSC::OpGetFromScope, JSC::CodeBlock::forEachValueProfile(const Functor&amp;) [with Functor = JSC::CodeBlock::updateAllPredictionsAndCountLiveness(unsigned int&amp;, unsigned int&amp;)::&lt;lambda(JSC::ValueProfile&amp;)&gt;]::&lt;lambda(auto:25&amp;)&gt; &gt; (func=..., this=&lt;optimized out&gt;)
    at ../Source/JavaScriptCore/bytecode/MetadataTable.h:61
        metadata = &lt;optimized out&gt;
        end = 0x7f57c3022726
        metadata = &lt;optimized out&gt;
        end = &lt;optimized out&gt;
#5  JSC::CodeBlock::forEachValueProfile&lt;JSC::CodeBlock::updateAllPredictionsAndCountLiveness(unsigned int&amp;, unsigned int&amp;)::&lt;lambda(JSC::ValueProfile&amp;)&gt; &gt; (func=..., this=0x7f709c62f300)
    at ../Source/JavaScriptCore/bytecode/CodeBlockInlines.h:44
No locals.
#6  JSC::CodeBlock::updateAllPredictionsAndCountLiveness (this=this@entry=0x7f709c62f300, 
    numberOfLiveNonArgumentValueProfiles=@0x7ffe91191860: 17, 
    numberOfSamplesInProfiles=@0x7ffe91191864: 23)
    at ../Source/JavaScriptCore/bytecode/CodeBlock.cpp:2576
        locker = {&lt;JSC::ConcurrentJSLockerBase&gt; = {&lt;WTF::AbstractLocker&gt; = {&lt;No data fields&gt;}, 
            m_locker = {&lt;WTF::AbstractLocker&gt; = {&lt;No data fields&gt;}, 
              m_lockable = 0x7f709c62f310}}, &lt;No data fields&gt;}
#7  0x00007f71130e3675 in JSC::CodeBlock::updateAllValueProfilePredictions (this=this@entry=0x7f709c62f300) at ../Source/JavaScriptCore/bytecode/CodeBlock.cpp:2604
        ignoredValue1 = 17
        ignoredValue2 = 23
#8  0x00007f71130e3c2d in JSC::CodeBlock::updateAllPredictions (this=this@entry=0x7f709c62f300)
    at ../Source/JavaScriptCore/bytecode/CodeBlock.cpp:2622
No locals.
#9  0x00007f7113648814 in JSC::operationOptimize (exec=0x7ffe91191b90, bytecodeIndex=&lt;optimized out&gt;)
    at ../Source/JavaScriptCore/jit/JITOperations.cpp:1421
        vm = &lt;error reading variable&gt;
        tracer = &lt;optimized out&gt;
        deferGC = {m_heap = @0x7f70fc100010}
        codeBlock = 0x7f709c62f300
        debugger = &lt;optimized out&gt;
        worklist = &lt;optimized out&gt;
        worklistState = &lt;optimized out&gt;
        optimizedCodeBlock = &lt;optimized out&gt;
#10 0x00007f70b82aa24f in ?? ()
No symbol table info available.

(Plus 55 more frames of &quot;No symbol table info available.&quot;)

(gdb) info registers
rax            0xffff000000000002  -281474976710654
rbx            0x7f57c30224be      140014910579902
rcx            0x179               377
rdx            0x0                 0
rsi            0x7ffe91191860      140731332761696
rdi            0xe960              59744
rbp            0x7f57c3022726      0x7f57c3022726
rsp            0x7ffe911917d8      0x7ffe911917d8
r8             0x3f6               1014
r9             0xffffffff          4294967295
r10            0x6                 6
r11            0xf895892f          4170549551
r12            0x1                 1
r13            0x7f709c62f300      140121636795136
r14            0x34d               845
r15            0xffff000000000002  -281474976710654
rip            0x7f711311f144      0x7f711311f144 &lt;JSC::speculationFromCell(JSC::JSCell*)+4&gt;
eflags         0x10246             [ PF ZF IF RF ]
cs             0x33                51
ss             0x2b                43
ds             0x0                 0
es             0x0                 0
fs             0x0                 0
gs             0x0                 0

(gdb) disassemble
Dump of assembler code for function JSC::speculationFromCell(JSC::JSCell*):
   0x00007f711311f140 &lt;+0&gt;:	endbr64 
=&gt; 0x00007f711311f144 &lt;+4&gt;:	cmpb   $0x1,0x5(%rdi)
   0x00007f711311f148 &lt;+8&gt;:	je     0x7f711311f190 &lt;JSC::speculationFromCell(JSC::JSCell*)+80&gt;
   0x00007f711311f14a &lt;+10&gt;:	test   $0x8,%dil
   0x00007f711311f14e &lt;+14&gt;:	jne    0x7f711311f180 &lt;JSC::speculationFromCell(JSC::JSCell*)+64&gt;
   0x00007f711311f150 &lt;+16&gt;:	mov    %rdi,%rax
   0x00007f711311f153 &lt;+19&gt;:	and    $0xffffffffffffc000,%rax
   0x00007f711311f159 &lt;+25&gt;:	mov    0x3ed8(%rax),%rdx
   0x00007f711311f160 &lt;+32&gt;:	mov    (%rdi),%eax
   0x00007f711311f162 &lt;+34&gt;:	mov    0xe0(%rdx),%rdx
   0x00007f711311f169 &lt;+41&gt;:	and    $0x7fffffff,%eax
   0x00007f711311f16e &lt;+46&gt;:	mov    (%rdx,%rax,8),%rdi
   0x00007f711311f172 &lt;+50&gt;:	jmpq   0x7f7112ee1790 &lt;_ZN3JSC24speculationFromStructureEPNS_9StructureE@plt&gt;
   0x00007f711311f177 &lt;+55&gt;:	nopw   0x0(%rax,%rax,1)
   0x00007f711311f180 &lt;+64&gt;:	mov    -0x10(%rdi),%rdx
   0x00007f711311f184 &lt;+68&gt;:	jmp    0x7f711311f160 &lt;JSC::speculationFromCell(JSC::JSCell*)+32&gt;
   0x00007f711311f186 &lt;+70&gt;:	nopw   %cs:0x0(%rax,%rax,1)
   0x00007f711311f190 &lt;+80&gt;:	mov    0x10(%rdi),%rax
   0x00007f711311f194 &lt;+84&gt;:	test   %rax,%rax
   0x00007f711311f197 &lt;+87&gt;:	je     0x7f711311f1b8 &lt;JSC::speculationFromCell(JSC::JSCell*)+120&gt;
   0x00007f711311f199 &lt;+89&gt;:	mov    0x10(%rax),%eax
   0x00007f711311f19c &lt;+92&gt;:	and    $0x10,%eax
   0x00007f711311f19f &lt;+95&gt;:	cmp    $0x1,%eax
   0x00007f711311f1a2 &lt;+98&gt;:	sbb    %rax,%rax
   0x00007f711311f1a5 &lt;+101&gt;:	and    $0x1000000,%eax
   0x00007f711311f1aa &lt;+106&gt;:	add    $0x1000000,%rax
   0x00007f711311f1b0 &lt;+112&gt;:	retq   
   0x00007f711311f1b1 &lt;+113&gt;:	nopl   0x0(%rax)
   0x00007f711311f1b8 &lt;+120&gt;:	mov    $0x2000000,%eax
   0x00007f711311f1bd &lt;+125&gt;:	retq   
End of assembler dump.

Similar crashes: bug #131506, bug #160027.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1489483</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2018-12-19 14:26:35 -0800</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #0)
&gt; It was seemingly random. I don&apos;t know how to reproduce it. This is using
&gt; 2.23.1 (r239394).

Sorry, wrong revision. It&apos;s r238442.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1490153</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2018-12-20 16:19:52 -0800</bug_when>
    <thetext>Seems likely to be a duplicate of bug 192050, can you check with a newer version?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1490265</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2018-12-20 19:49:32 -0800</bug_when>
    <thetext>No, because it&apos;s not reproducible, but the timeline matches up so let&apos;s assume it&apos;s a duplicate unless proven otherwise.

*** This bug has been marked as a duplicate of bug 192050 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>