<?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>10022</bug_id>
          
          <creation_ts>2006-07-19 18:10:02 -0700</creation_ts>
          <short_desc>REGRESSION: Crash in WebCore::XMLTokenizer::characters</short_desc>
          <delta_ts>2006-07-29 08:15:48 -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>XML</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.pogdesign.co.uk/cat/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>NeedsReduction</keywords>
          <priority>P1</priority>
          <bug_severity>Blocker</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jon">jon</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ddkilzer</cc>
    
    <cc>mrowe</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>50395</commentid>
    <comment_count>0</comment_count>
    <who name="Jon">jon</who>
    <bug_when>2006-07-19 18:10:02 -0700</bug_when>
    <thetext>You may need to refresh the page to get the crash as it seems to successfully load sometimes. 

Thread 0 Crashed:
0   com.apple.WebCore        	0x010429c4 WebCore::XMLTokenizer::characters(unsigned char const*, int) + 148 (XMLTokenizer.cpp:861)
1   com.apple.WebCore        	0x01045a10 WebCore::XMLTokenizer::resumeParsing() + 64 (DeprecatedPtrList.h:53)
2   com.apple.WebCore        	0x01045cd4 WebCore::XMLTokenizer::notifyFinished(WebCore::CachedResource*) + 484 (XMLTokenizer.cpp:1320)
3   com.apple.WebCore        	0x0112f618 WebCore::CachedScript::checkNotify() + 88 (CachedScript.cpp:109)
4   com.apple.WebCore        	0x0112facc WebCore::CachedScript::data(WTF::Vector&lt;char, (unsigned long)0&gt;&amp;, bool) + 236 (CachedScript.cpp:101)
5   com.apple.WebCore        	0x01131c9c WebCore::Loader::receivedAllData(WebCore::TransferJob*, NSData*) + 300 (loader.cpp:139)
6   com.apple.WebCore        	0x0104b394 -[WebCoreResourceLoaderImp finishJobAndHandle:] + 116 (WebCoreResourceLoaderImp.mm:98)
7   com.apple.WebKit         	0x00325490 -[WebSubresourceLoader didFinishLoading] + 80
8   com.apple.WebKit         	0x0032728c -[WebLoader connectionDidFinishLoading:] + 44 (WebLoader.m:575)
9   com.apple.Foundation     	0x9297684c -[NSURLConnection(NSURLConnectionInternal) _sendDidFinishLoadingCallback] + 188
10  com.apple.Foundation     	0x92974ab8 -[NSURLConnection(NSURLConnectionInternal) _sendCallbacks] + 556
11  com.apple.Foundation     	0x92974810 _sendCallbacks + 156
12  com.apple.CoreFoundation 	0x907dc4cc __CFRunLoopDoSources0 + 384
13  com.apple.CoreFoundation 	0x907db9fc __CFRunLoopRun + 452
14  com.apple.CoreFoundation 	0x907db47c CFRunLoopRunSpecific + 268
15  com.apple.HIToolbox      	0x931eb740 RunCurrentEventLoopInMode + 264
16  com.apple.HIToolbox      	0x931eadd4 ReceiveNextEventCommon + 380
17  com.apple.HIToolbox      	0x931eac40 BlockUntilNextEventMatchingListInMode + 96
18  com.apple.AppKit         	0x936eeae4 _DPSNextEvent + 384
19  com.apple.AppKit         	0x936ee7a8 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 116
20  com.apple.SafariDev      	0x00006740 0x1000 + 22336
21  com.apple.AppKit         	0x936eacec -[NSApplication run] + 472
22  com.apple.AppKit         	0x937db87c NSApplicationMain + 452
23  com.apple.SafariDev      	0x0005c77c 0x1000 + 374652
24  com.apple.SafariDev      	0x0005c624 0x1000 + 374308</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50408</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2006-07-19 21:20:24 -0700</bug_when>
    <thetext>Confirmed with r15536.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50411</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2006-07-19 21:56:11 -0700</bug_when>
    <thetext>The page in question has an HTML 4.0 doctype, yet claims to be application/xhtml+xml via the Content-Type meta tag.  This causes WebKit to attempt to process the HTML 4.0 document using the XML tokenizer.  A lot of the code in XMLTokenizer makes the assumption that m_currentNode is non-NULL, and this crash is caused by a violation of that assumption.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50413</commentid>
    <comment_count>3</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2006-07-19 22:06:38 -0700</bug_when>
    <thetext>Ok, so the website tricked me.  It returns HTML 4.0 by default unless the browser advertises support for application/xhtml+xml.  The XHTML page validates fine, so there must be a more insidious bug hiding somewhere.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50420</commentid>
    <comment_count>4</comment_count>
      <attachid>9578</attachid>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2006-07-19 23:49:09 -0700</bug_when>
    <thetext>Created attachment 9578
Patch

Occasionally when parsing is paused and then resumed, data may have arrived that when parsed causes callbacks to be queued.  If XMLTokenizer::finish() has been called while the parser was paused, then we call end() to clean up the parse.  This results in the current node being cleared, which causes a crash when the callbacks are finally processed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50422</commentid>
    <comment_count>5</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2006-07-19 23:50:35 -0700</bug_when>
    <thetext>I should note that I intend to write an HTTP layout test for this later this evening, but it may be tricky to find the exact sequence of data arrival that will easily trigger the bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50447</commentid>
    <comment_count>6</comment_count>
      <attachid>9578</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2006-07-20 09:38:59 -0700</bug_when>
    <thetext>Comment on attachment 9578
Patch

Is there a way to make a test for this bug? The fix looks OK, but I&apos;d we normally require a regression test for each fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50519</commentid>
    <comment_count>7</comment_count>
      <attachid>9578</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2006-07-21 19:46:05 -0700</bug_when>
    <thetext>Comment on attachment 9578
Patch

I see the answer now.

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51113</commentid>
    <comment_count>8</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2006-07-29 08:15:26 -0700</bug_when>
    <thetext>Committed revision 15689.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>9578</attachid>
            <date>2006-07-19 23:49:09 -0700</date>
            <delta_ts>2006-07-21 19:46:05 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>webkit-bug-10022-v1.patch</filename>
            <type>text/plain</type>
            <size>1346</size>
            <attacher name="Mark Rowe (bdash)">mrowe</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiAxNTU0MCkKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTQgQEAKKzIwMDYtMDctMjAgIE1hcmsgUm93ZSAgPG9wZW5kYXJ3aW4ub3JnQGJk
YXNoLm5ldC5uej4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAg
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bGVkLCBjYWxsIGVuZCgpCi0gICAgaWYgKG1fZmluaXNoQ2FsbGVkKQorCisg
ICAgLy8gRmluYWxseSwgaWYgZmluaXNoKCkgaGFzIGJlZW4gY2FsbGVkIGFuZCB3cml0ZSgpIGRp
ZG4ndCByZXN1bHQKKyAgICAvLyBpbiBhbnkgZnVydGhlciBjYWxsYmFja3MgYmVpbmcgcXVldWVk
LCBjYWxsIGVuZCgpCisgICAgaWYgKG1fZmluaXNoQ2FsbGVkICYmIG1fcGVuZGluZ0NhbGxiYWNr
cy0+aXNFbXB0eSgpKQogICAgICAgICBlbmQoKTsKIH0KIAo=
</data>
<flag name="review"
          id="2917"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>