<?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>23225</bug_id>
          
          <creation_ts>2009-01-10 00:52:08 -0800</creation_ts>
          <short_desc>REGRESSION (r38592-r38645): Assertion failure in reparseInPlace() (m_sourceElements) at sfgate.com</short_desc>
          <delta_ts>2009-01-15 13:15:51 -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>Mac</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://events.sfgate.com/san-francisco-ca/events/show/85733715-qadim-ensemble</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction, InRadar, Regression</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>mitz</reporter>
          <assigned_to name="Oliver Hunt">oliver</assigned_to>
          <cc>ap</cc>
    
    <cc>ddkilzer</cc>
    
    <cc>koivisto</cc>
    
    <cc>oliver</cc>
    
    <cc>pknight</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>105106</commentid>
    <comment_count>0</comment_count>
    <who name="">mitz</who>
    <bug_when>2009-01-10 00:52:08 -0800</bug_when>
    <thetext>Visiting the URL with TOT causes
ASSERTION FAILED: m_sourceElements
(JavaScriptCore/parser/Parser.cpp:76 void JSC::Parser::reparseInPlace(JSC::JSGlobalData*, JSC::FunctionBodyNode*))

Backtrace:
#0  0x00b56987 in JSC::Parser::reparseInPlace (this=0x1d1b2d70, globalData=0x6ed3000, functionBodyNode=0x1caefb50) at Parser.cpp:76
#1  0x00b56bb3 in JSC::FunctionBodyNode::generateBytecode (this=0x1caefb50, scopeChainNode=0x1d0de450) at Nodes.cpp:2597
#2  0x00bec93e in JSC::FunctionBodyNode::bytecode (this=0x1caefb50, scopeChain=0x1d0de450) at Nodes.h:2188
#3  0x00bd16a9 in JSC::Interpreter::cti_op_call_JSFunction (args=0x0) at JavaScriptCore/interpreter/Interpreter.cpp:4812
#4  0x00bcad60 in JSC::Interpreter::retrieveCaller () at JavaScriptCore/interpreter/Interpreter.cpp:4019
#5  0x00bece66 in JSC::JIT::execute (code=0x2194ba94, registerFile=0x68e0e34, callFrame=0x1f110048, globalData=0x6ed3000, exception=0xbfffddd0) at JIT.h:351
#6  0x00bd35ee in JSC::Interpreter::execute (this=0x68e0e00, programNode=0x2135a120, callFrame=0x1ea23264, scopeChain=0x1d0de450, thisObj=0x1cfefdc0, exception=0xbfffddd0) at JavaScriptCore/interpreter/Interpreter.cpp:908
#7  0x00b56f5c in JSC::evaluate (exec=0x1ea23264, scopeChain=@0x1ea23220, source=@0xbfffe188, thisValue={m_ptr = 0x1cfefdc0}) at Completion.cpp:67</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105109</commentid>
    <comment_count>1</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2009-01-10 03:54:07 -0800</bug_when>
    <thetext>The error appears to occur on line 364 of http://js.zvents.com/javascripts/happy_default.js?43797:

list.push([&apos;&lt;label for=&quot;&apos;,type.label,&apos;&quot;&gt;&apos;,&apos;&lt;input id=&quot;&apos;,type.label,&apos;&quot; &apos;,inputSnippet,&apos; class=&quot;ZventsNearbyRadio&quot; type=&quot;radio&quot; name=&quot;ZventsNearbyRadio&quot; value=&quot;&apos;,type.type,&apos;&quot; &apos;,is.first?&apos;checked=&quot;checked&quot; &apos;:&apos;&apos;,&apos; onclick=&quot;&apos;,onclickSnippet,&apos;&quot; /&gt;&apos;,selectorSnippet,&apos;&lt;/label&gt;&apos;,].join(&apos;&apos;));}});var tab_cols=this.args.columns?this.args.columns:2;return list.length==0?&apos;&apos;:[&apos;&lt;div class=&quot;ZventsNearbySelectWrapper&quot;&gt;&apos;,&apos;&lt;form id=&quot;ZventsNearbySelect&quot; class=&quot;ZventsNearbyForm&quot; name=&quot;ZventsNearbyForm&quot;&gt;&apos;,list.tabulate({down:true,cols:tab_cols}),&apos;&lt;/form&gt;&apos;,&apos;&lt;/div&gt;&apos;].join(&apos;&apos;);}}};&amp;#65279;

If you examine the source provider it looks like a &apos;?&apos; is being inserted into the source which makes no sense but does bust the js</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105119</commentid>
    <comment_count>2</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2009-01-10 13:07:39 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; [...],list.tabulate({down:true,cols:tab_cols}),&apos;&lt;/form&gt;&apos;,&apos;&lt;/div&gt;&apos;].join(&apos;&apos;);}}};&amp;#65279;
&gt; 
&gt; If you examine the source provider it looks like a &apos;?&apos; is being inserted into
&gt; the source which makes no sense but does bust the js

Is it an encoding issue?  That&apos;s probably not a normal question mark based on the encoding of the previous comment.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105120</commentid>
    <comment_count>3</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2009-01-10 13:10:02 -0800</bug_when>
    <thetext>&lt;rdar://problem/6487432&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105176</commentid>
    <comment_count>4</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2009-01-10 20:25:15 -0800</bug_when>
    <thetext>Maybe terminal was just getting confused?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105177</commentid>
    <comment_count>5</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2009-01-10 20:39:02 -0800</bug_when>
    <thetext>You&apos;re right, if i  force utf-8, then it shows up as y-with-umlauts: ÿ</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105280</commentid>
    <comment_count>6</comment_count>
    <who name="Paul Knight">pknight</who>
    <bug_when>2009-01-11 15:57:10 -0800</bug_when>
    <thetext>Those bytes at the end are actually EF BB BF, the UTF-8 BOM. This sequence shouldn&apos;t appear in the middle of the stream.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105347</commentid>
    <comment_count>7</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2009-01-12 11:40:50 -0800</bug_when>
    <thetext>Okay, the wonders of JS mean a byte order marker should be ignored if it appears midway through the content -- the lexer should be skipping it, and if it&apos;s skipping it then it shouldn&apos;t effect parsing.

That means if this is causing a parse error the reparsing is screwing up and declaring parseable content unparseable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105550</commentid>
    <comment_count>8</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2009-01-13 12:41:39 -0800</bug_when>
    <thetext>This bug causes the &quot;flags&quot; to be missing on the inset Google map when loaded on a Release build. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105902</commentid>
    <comment_count>9</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2009-01-15 08:52:18 -0800</bug_when>
    <thetext>Vastly reduced testcase: http://nerget.com/bugs/bug23225.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105907</commentid>
    <comment_count>10</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2009-01-15 09:36:40 -0800</bug_when>
    <thetext>The bisect-builds script reports:

Works: r38592  Fails: r38645
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105908</commentid>
    <comment_count>11</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2009-01-15 09:43:27 -0800</bug_when>
    <thetext>(In reply to comment #10)
&gt; The bisect-builds script reports:
&gt; Works: r38592  Fails: r38645

r38635 is the most likely suspect in that range.

http://trac.webkit.org/changeset/38635
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105909</commentid>
    <comment_count>12</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2009-01-15 09:50:21 -0800</bug_when>
    <thetext>Well yes, r38635 is the introduction of reparsing :P</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105917</commentid>
    <comment_count>13</comment_count>
      <attachid>26761</attachid>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2009-01-15 10:49:39 -0800</bug_when>
    <thetext>Created attachment 26761
Decompose the lexer output from the reparsing

Looking at this, it looks like the something causes us to extend the length of the inner function by one character so that it ends up incorrectly including the final }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105918</commentid>
    <comment_count>14</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2009-01-15 10:58:38 -0800</bug_when>
    <thetext>Okay, have further reduced this test case to 36 bytes and only a single level of functions -- we get the wrong length for a function if immediately following the function we get a bom, although i still don&apos;t know the reason for this :-/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105943</commentid>
    <comment_count>15</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2009-01-15 12:18:16 -0800</bug_when>
    <thetext>Got a fix, very simple, just banging out a testcase</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105956</commentid>
    <comment_count>16</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2009-01-15 13:15:51 -0800</bug_when>
    <thetext>Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	JavaScriptCore/ChangeLog
	M	JavaScriptCore/parser/Lexer.cpp
	M	LayoutTests/ChangeLog
	A	LayoutTests/fast/js/bom-in-file-retains-correct-offset-expected.txt
	A	LayoutTests/fast/js/bom-in-file-retains-correct-offset.html
	A	LayoutTests/fast/js/resources/bom-in-file-retains-correct-offset.js
Committed r39942
</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>26761</attachid>
            <date>2009-01-15 10:49:39 -0800</date>
            <delta_ts>2009-01-15 10:49:39 -0800</delta_ts>
            <desc>Decompose the lexer output from the reparsing</desc>
            <filename>reparsing.txt</filename>
            <type>text/plain</type>
            <size>1658</size>
            <attacher name="Oliver Hunt">oliver</attacher>
            
              <data encoding="base64">XG4gMHgwMDAwMDAwYSAgICAKZiAgMHgwMDAwMDA2NiAgICAKdSAgMHgwMDAwMDA3NSAgICAKbiAg
MHgwMDAwMDA2ZSAgICAKYyAgMHgwMDAwMDA2MyAgICAKdCAgMHgwMDAwMDA3NCAgICAKaSAgMHgw
MDAwMDA2OSAgICAKbyAgMHgwMDAwMDA2ZiAgICAKbiAgMHgwMDAwMDA2ZSAgICAKICAgMHgwMDAw
MDAyMCAgICAKZiAgMHgwMDAwMDA2NiAgICAKKCAgMHgwMDAwMDAyOCAgICAKKSAgMHgwMDAwMDAy
OSAgICAKICAgMHgwMDAwMDAyMCAgICAKeyAgMHgwMDAwMDA3YiAgICAKZiAgMHgwMDAwMDA2NiAg
ICAweDAwMDAwMDY2ICAgCnUgIDB4MDAwMDAwNzUgICAgMHgwMDAwMDA3NSAgIApuICAweDAwMDAw
MDZlICAgIDB4MDAwMDAwNmUgICAKYyAgMHgwMDAwMDA2MyAgICAweDAwMDAwMDYzICAgCnQgIDB4
MDAwMDAwNzQgICAgMHgwMDAwMDA3NCAgIAppICAweDAwMDAwMDY5ICAgIDB4MDAwMDAwNjkgICAK
byAgMHgwMDAwMDA2ZiAgICAweDAwMDAwMDZmICAgCm4gIDB4MDAwMDAwNmUgICAgMHgwMDAwMDA2
ZSAgIAogICAweDAwMDAwMDIwICAgIDB4MDAwMDAwMjAgICAKZyAgMHgwMDAwMDA2NyAgICAweDAw
MDAwMDY3ICAgCiggIDB4MDAwMDAwMjggICAgMHgwMDAwMDAyOCAgIAopICAweDAwMDAwMD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DAwNjYgICAg
CiggIDB4MDAwMDAwMjggICAgCikgIDB4MDAwMDAwMjkgICAgCjsgIDB4MDAwMDAwM2IgICAgClxu
IDB4MDAwMDAwMGEgICAgCiAgMHhmZmZmZmZmZiAgICAKICAgICAgICAgICAgICAKICAgICAgICAg
ICAgICAKICAgICAgICAgICAgICAKICAgICAgICAgICAgICAKICAgICAgICAgICAgICAKICAgICAg
ICAgICAgICAKICAgICAgICAgICAgICAKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoK
CgoKCgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>