<?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>48643</bug_id>
          
          <creation_ts>2010-10-29 09:41:55 -0700</creation_ts>
          <short_desc>XMLDocumentParser gets deleted and then used in LayoutTest/fast/frames/set-parent-src-synchronously.xhtml on QT/Linux</short_desc>
          <delta_ts>2010-11-09 11:16:49 -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>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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>0</everconfirmed>
          <reporter name="Peter Rybin">peter.rybin</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>commit-queue</cc>
    
    <cc>peter.rybin</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>301823</commentid>
    <comment_count>0</comment_count>
    <who name="Peter Rybin">peter.rybin</who>
    <bug_when>2010-10-29 09:41:55 -0700</bug_when>
    <thetext>On Qt/Linux platform in LayoutTests/fast/frames/set-parent-src-synchronously.xhtml

an isntance of XMLDocumentParser gets deleted:

3:_ZN7WebCore17XMLDocumentParserD0Ev+0x6a)
4:_ZN3WTF10RefCountedIN7WebCore14DocumentParserEE5derefEv+0x43)
5:_ZN3WTF14derefIfNotNullIN7WebCore14DocumentParserEEEvPT_+0x2e)
6:_ZN3WTF6RefPtrIN7WebCore14DocumentParserEE5clearEv+0x2e)
7:_ZN7WebCore8Document12detachParserEv+0x52)
8:_ZN7WebCore8Document13cancelParsingEv+0x37)
9:_ZN7WebCore11FrameLoader5clearEbbb+0x8f)
10:_ZN7WebCore14DocumentWriter5beginERKNS_4KURLEbPNS_14SecurityOriginE+0x1b1)
11:_ZN7WebCore14DocumentWriter15replaceDocumentERKN3WTF6StringE+0x7b)
12:_ZN7WebCore16ScriptController22executeIfJavaScriptURLERKNS_4KURLENS_36ShouldReplaceDocumentIfJavaScriptURLE+0x27b)
13:_ZN7WebCore14SubframeLoader12requestFrameEPNS_21HTMLFrameOwnerElementERKN3WTF6StringERKNS3_12AtomicStringEbb+0x19c)
14:_ZN7WebCore20HTMLFrameElementBase7openURLEbb+0x171)
15:_ZN7WebCore20HTMLFrameElementBase11setLocationERKN3WTF6StringE+0xe1)
16:_ZN7WebCore20HTMLFrameElementBase20parseMappedAttributeEPNS_9AttributeE+0x6c)
17:_ZN7WebCore17HTMLIFrameElement20parseMappedAttributeEPNS_9AttributeE+0x2ce)
18:_ZN7WebCore13StyledElement16attributeChangedEPNS_9AttributeEb+0x292)
19:_ZN7WebCore7Element12setAttributeERKN3WTF12AtomicStringES4_Ri+0x308)
20:_ZN7WebCore38jsElementPrototypeFunctionSetAttributeEPN3JSC9ExecStateE+0x232)
21: ***
22: ***
23: ***
24: ***
25:_ZN7WebCore21JSMainThreadExecState8evaluateEPN3JSC9ExecStateERNS1_10ScopeChainERKNS1_10SourceCodeENS1_7JSValueE+0x54)
26:_ZN7WebCore16ScriptController15evaluateInWorldERKNS_16ScriptSourceCodeEPNS_15DOMWrapperWorldENS_14ShouldAllowXSSE+0x1bd)
27:_ZN7WebCore16ScriptController8evaluateERKNS_16ScriptSourceCodeENS_14ShouldAllowXSSE+0x3f)
28:_ZN7WebCore16ScriptController13executeScriptERKNS_16ScriptSourceCodeENS_14ShouldAllowXSSE+0xa9)
29:_ZN7WebCore17XMLDocumentParser15parseEndElementEv+0x63e)
30:_ZN7WebCore17XMLDocumentParser5parseEv+0x87)
31:_ZN7WebCore17XMLDocumentParser7doWriteERKN3WTF6StringE+0xee)
32:_ZN7WebCore17XMLDocumentParser6appendERKNS_15SegmentedStringE+0x17c)
33:_ZN7WebCore25DecodedDataDocumentParser11appendBytesEPNS_14DocumentWriterEPKcib+0xfb)
34:_ZN7WebCore14DocumentWriter7addDataEPKcib+0x275)
35:_ZN7WebCore14DocumentLoader10commitDataEPKci+0x14b)
36:_ZN7WebCore19FrameLoaderClientQt13committedLoadEPNS_14DocumentLoaderEPKci+0x39)
37:_ZN7WebCore14DocumentLoader10commitLoadEPKci+0xa1)
38:_ZN7WebCore14DocumentLoader12receivedDataEPKci+0x58)
39:_ZN7WebCore18MainResourceLoader7addDataEPKcib+0x5a)
40:_ZN7WebCore14ResourceLoader14didReceiveDataEPKcixb+0x60)
41:_ZN7WebCore18MainResourceLoader14didReceiveDataEPKcixb+0x1d3)
42:_ZN7WebCore14ResourceLoader14didReceiveDataEPNS_14ResourceHandleEPKcii+0x7c)
43:_ZN7WebCore20QNetworkReplyHandler11forwardDataEv+0x121)
44:_ZN7WebCore20QNetworkReplyHandler11qt_metacallEN11QMetaObject4CallEiPPv+0x9c)


and then used again:

* segfault *
WebCore::XMLDocumentParser::popCurrentNode()
WebCore::XMLDocumentParser::parseEndElement()
WebCore::XMLDocumentParser::parse()
WebCore::XMLDocumentParser::doWrite(WTF::String const&amp;)
WebCore::XMLDocumentParser::append(WebCore::SegmentedString const&amp;)
WebCore::DecodedDataDocumentParser::appendBytes(WebCore::DocumentWriter*, char const*, int, bool)
WebCore::DocumentWriter::addData(char const*, int, bool)
WebCore::DocumentLoader::commitData(char const*, int)
WebCore::FrameLoaderClientQt::committedLoad(WebCore::DocumentLoader*, char const*, int)
WebCore::DocumentLoader::commitLoad(char const*, int)
WebCore::MainResourceLoader::addData(char const*, int, bool)
WebCore::ResourceLoader::didReceiveData(char const*, int, long long, bool)
WebCore::MainResourceLoader::didReceiveData(char const*, int, long long, bool)
WebCore::ResourceLoader::didReceiveData(WebCore::ResourceHandle*, char const*, int, int)
WebCore::QNetworkReplyHandler::forwardData()
WebCore::QNetworkReplyHandler::qt_metacall(QMetaObject::Call, int, void**)
QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**)
QMetaCallEvent::placeMetaCall(QObject*)
QObject::event(QEvent*)
QApplicationPrivate::notify_helper(QObject*, QEvent*)
QApplication::notify(QObject*, QEvent*)
QCoreApplication::notifyInternal(QObject*, QEvent*)
QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)
QCoreApplication::sendPostedEvents(QObject*, int)


Method WebCore::XMLDocumentParser::parseEndElement() in XMLDocumentParserQt.cpp seems to be a point where 2 stacktraces split. It first calls  executeScript  where parser gets deleted, and then --  popCurrentNode,  and process fails.

This segfault is very flaky. It is also often erroneously attributed to innocent LayoutTests/fast/frames/set-unloaded-frame-location.html that goes right after in the batch run.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>306783</commentid>
    <comment_count>1</comment_count>
      <attachid>73376</attachid>
    <who name="Peter Rybin">peter.rybin</who>
    <bug_when>2010-11-09 07:31:18 -0800</bug_when>
    <thetext>Created attachment 73376
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>306844</commentid>
    <comment_count>2</comment_count>
      <attachid>73376</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-11-09 09:59:05 -0800</bug_when>
    <thetext>Comment on attachment 73376
Patch

Great.  Thanks for fixing the Qt bug Peter!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>306886</commentid>
    <comment_count>3</comment_count>
      <attachid>73376</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-11-09 11:16:44 -0800</bug_when>
    <thetext>Comment on attachment 73376
Patch

Clearing flags on attachment: 73376

Committed r71654: &lt;http://trac.webkit.org/changeset/71654&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>306887</commentid>
    <comment_count>4</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-11-09 11:16:49 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>73376</attachid>
            <date>2010-11-09 07:31:18 -0800</date>
            <delta_ts>2010-11-09 11:16:44 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-48643-20101109183116.patch</filename>
            <type>text/plain</type>
            <size>1370</size>
            <attacher name="Peter Rybin">peter.rybin</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYkNvcmUvQ2hhbmdlTG9nIGIvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXgg
ODM1MGU2MmRhYTkzZmQyZjIyOTdjNDM0MTlhNWUzZjdkMDNiZjVhYS4uNWM5ZGE0NmRiNzI4NTMx
ZWE5ZGY3MTNiNGE0OWMzMTM4ZTcyMjE3YyAxMDA2NDQKLS0tIGEvV2ViQ29yZS9DaGFuZ2VMb2cK
KysrIGIvV2ViQ29yZS9DaGFuZ2VMb2cKQEAgLTEsMyArMSwxMyBAQAorMjAxMC0xMS0wOSAgUGV0
ZXIgUnliaW4gIDxwZXRlci5yeWJpbkBnbWFpbC5jb20+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkg
Tk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgWE1MRG9jdW1lbnRQYXJzZXIgZ2V0cyBkZWxldGVk
IGFuZCB0aGVuIHVzZWQgaW4gTGF5b3V0VGVzdC9mYXN0L2ZyYW1lcy9zZXQtcGFyZW50LXNyYy1z
eW5jaHJvbm91c2x5LnhodG1sIG9uIFFUL0xpbnV4CisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJr
aXQub3JnL3Nob3dfYnVnLmNnaT9pZD00ODY0MworCisgICAgICAgICogZG9tL1hNTERvY3VtZW50
UGFyc2VyUXQuY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