<?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>140879</bug_id>
          
          <creation_ts>2015-01-26 01:02:27 -0800</creation_ts>
          <short_desc>Crash in JSC::DFG::prepareOSREntry</short_desc>
          <delta_ts>2015-01-28 19:40:46 -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>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <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="Han Choongwoo">cwhan.tunz</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ggaren</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1064101</commentid>
    <comment_count>0</comment_count>
    <who name="Han Choongwoo">cwhan.tunz</who>
    <bug_when>2015-01-26 01:02:27 -0800</bug_when>
    <thetext>--------------------------
function g() {
function f() {
g.apply(null, [&apos;&apos;]);
}
f().watch(a)
}
(function () {
g.apply(null, null);
})();
--------------------------

If I run this code, It crashes.

Program received signal SIGSEGV, Segmentation fault.
tJSC::DFG::prepareOSREntry (exec=exec@entry=0x7ffeb2308f68, codeBlock=codeBlock@entry=0x7ffff7f52000,
    bytecodeIndex=bytecodeIndex@entry=0) at /development/tunz/javascript/webkit/Source/JavaScriptCore/dfg/DFGOSREntry.cpp:121
121             if (!entry-&gt;m_expectedValues.local(local).validate(exec-&gt;registers()[local].jsValue())) {
(gdb) bt
#0  JSC::DFG::prepareOSREntry (exec=exec@entry=0x7ffeb2308f68, codeBlock=codeBlock@entry=0x7ffff7f52000,
    bytecodeIndex=bytecodeIndex@entry=0) at /development/tunz/javascript/webkit/Source/JavaScriptCore/dfg/DFGOSREntry.cpp:121
#1  0x00000000006082bf in JSC::cti_optimize (args=0x7fffffffd730)
    at /development/tunz/javascript/webkit/Source/JavaScriptCore/jit/JITStubs.cpp:1991
#2  0x00007fffb2cbb3d6 in ?? ()
#3  0x00007ffe00000000 in ?? ()
#4  0x00007ffe00000000 in ?? ()
#5  0x00007ffff7ed1108 in ?? ()
#6  0x0000000000000000 in ?? ()
(gdb) list
116     #endif
117                     return 0;
118                 }
119                 continue;
120             }
121             if (!entry-&gt;m_expectedValues.local(local).validate(exec-&gt;registers()[local].jsValue())) {
122     #if ENABLE(JIT_VERBOSE_OSR)
123                 dataLog(&quot;    OSR failed because variable &quot;, local, &quot; is &quot;, exec-&gt;registers()[local].jsValue(), &quot;, expected &quot;, entry-&gt;m_expectedValues.local(local), &quot;.\n&quot;);
124     #endif
125                 return 0;

I think it is stack overflow of JIT (DFG).

tested it on QtWebKit Ubuntu 14.04 64bit.

I found this crash with afl-fuzz.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1065137</commentid>
    <comment_count>1</comment_count>
    <who name="Han Choongwoo">cwhan.tunz</who>
    <bug_when>2015-01-28 19:40:46 -0800</bug_when>
    <thetext>Oh, I think this crash is already fixed.
I used old version.

Now, after rebuilding webkit gtk, there is no crash.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>