<?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>9477</bug_id>
          
          <creation_ts>2006-06-16 22:39:12 -0700</creation_ts>
          <short_desc>REGRESSION: fast/dom/replaceChild.html crashes on WebKit ToT in debug build</short_desc>
          <delta_ts>2006-06-17 18:26:07 -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>JavaScriptCore</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></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Regression</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Kilzer (:ddkilzer)">ddkilzer</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>adele</cc>
    
    <cc>ggaren</cc>
    
    <cc>mitz</cc>
    
    <cc>mjs</cc>
    
    <cc>timothy</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>46017</commentid>
    <comment_count>0</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2006-06-16 22:39:12 -0700</bug_when>
    <thetext>Running fast/dom/replaceChild.html on WebKit ToT (r14895) causes a reproducible crash on my Mac OS X 10.4.6 (8I127/PowerPC) PB G4.

I&apos;m not sure when this bug was introduced.  This doesn&apos;t seem to happen when this test is loaded in the browser, although one of two resources is NOT loaded per the Activity Window when the test is opened in the browser.

Relevant stack trace bits:

Command: DumpRenderTree
Path:    /Users/ddkilzer/Projects/Cocoa/WebKit/WebKitBuild/Debug/DumpRenderTree
Parent:  perl [10628]

Version: ??? (???)

PID:    10671
Thread: 0

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0x2c323130

Thread 0 Crashed:
0   &lt;&lt;00000000&gt;&gt;        0x2c323130 0 + 741486896
1   com.apple.JavaScriptCore    0x12d1bc98 KJS::JSObject::call(KJS::ExecState*, KJS::JSObject*, KJS::List const&amp;) + 288 (object.cpp:96)
2   com.apple.JavaScriptCore    0x12d11110 KJS::FunctionCallDotNode::evaluate(KJS::ExecState*) + 908 (nodes.cpp:758)
3   com.apple.JavaScriptCore    0x12d0db0c KJS::ExprStatementNode::execute(KJS::ExecState*) + 220 (nodes.cpp:1661)
4   com.apple.JavaScriptCore    0x12d0a2e4 KJS::SourceElementsNode::execute(KJS::ExecState*) + 616 (nodes.cpp:2448)
5   com.apple.JavaScriptCore    0x12d07ca0 KJS::BlockNode::execute(KJS::ExecState*) + 216 (nodes.cpp:1638)
6   com.apple.JavaScriptCore    0x12d0d994 KJS::IfNode::execute(KJS::ExecState*) + 500 (nodes.cpp:1680)
7   com.apple.JavaScriptCore    0x12d0a194 KJS::SourceElementsNode::execute(KJS::ExecState*) + 280 (nodes.cpp:2442)
8   com.apple.JavaScriptCore    0x12d07ca0 KJS::BlockNode::execute(KJS::ExecState*) + 216 (nodes.cpp:1638)
9   com.apple.JavaScriptCore    0x12cf633c KJS::DeclaredFunctionImp::execute(KJS::ExecState*) + 92 (function.cpp:333)
10  com.apple.JavaScriptCore    0x12cf5964 KJS::FunctionImp::callAsFunction(KJS::ExecState*, KJS::JSObject*, KJS::List const&amp;) + 668 (function.cpp:104)
11  com.apple.JavaScriptCore    0x12d1bc98 KJS::JSObject::call(KJS::ExecState*, KJS::JSObject*, KJS::List const&amp;) + 288 (object.cpp:96)
12  com.apple.WebCore           0x01338aa8 KJS::JSAbstractEventListener::handleEvent(WebCore::Event*, bool) + 748 (kjs_events.cpp:105)
13  com.apple.WebCore           0x0114cb34 WebCore::Document::handleWindowEvent(WebCore::Event*, bool) + 308 (Document.cpp:2208)
14  com.apple.WebCore           0x012fa1ac WebCore::EventTargetNode::dispatchWindowEvent(WebCore::AtomicString const&amp;, bool, bool) + 324 (EventTargetNode.cpp:315)
15  com.apple.WebCore           0x0114fb68 WebCore::Document::implicitClose() + 700 (Document.cpp:1179)
16  com.apple.WebCore           0x0111ceb4 WebCore::Frame::checkEmitLoadEvent() + 724 (Frame.cpp:858)
17  com.apple.WebCore           0x011224ac WebCore::Frame::checkCompleted() + 528 (Frame.cpp:823)
18  com.apple.WebCore           0x011228d4 WebCore::Frame::finishedParsing() + 44 (Frame.cpp:778)
19  com.apple.WebCore           0x01149c88 WebCore::Document::finishedParsing() + 72 (Document.cpp:3223)
20  com.apple.WebCore           0x01040e0c WebCore::HTMLParser::finished() + 300 (HTMLParser.cpp:1345)
21  com.apple.WebCore           0x01046228 WebCore::HTMLTokenizer::end() + 308 (HTMLTokenizer.cpp:1489)
22  com.apple.WebCore           0x010466a4 WebCore::HTMLTokenizer::finish() + 1128 (HTMLTokenizer.cpp:1527)
23  com.apple.WebCore           0x01147abc WebCore::Document::finishParsing() + 84 (Document.cpp:1313)
24  com.apple.WebCore           0x011231d0 WebCore::Frame::endIfNotLoading() + 432 (Frame.cpp:734)
25  com.apple.WebCore           0x01123224 WebCore::Frame::end() + 52 (Frame.cpp:717)
26  com.apple.WebCore           0x01160b64 -[WebCoreFrameBridge end] + 72 (WebCoreFrameBridge.mm:703)
27  com.apple.WebKit            0x00246688 -[WebDataSource(WebPrivate) _finishedLoading] + 220 (WebDataSource.m:792)
28  com.apple.WebKit            0x002833c0 -[WebMainResourceLoader didFinishLoading] + 560 (WebMainResourceLoader.m:379)
29  com.apple.WebKit            0x00241788 -[WebLoader connectionDidFinishLoading:] + 184 (WebLoader.m:575)
30  com.apple.Foundation        0x929a884c -[NSURLConnection(NSURLConnectionInternal) _sendDidFinishLoadingCallback] + 188
31  com.apple.Foundation        0x929a6ab8 -[NSURLConnection(NSURLConnectionInternal) _sendCallbacks] + 556
32  com.apple.Foundation        0x929a6810 _sendCallbacks + 156
33  com.apple.CoreFoundation    0x907e44cc __CFRunLoopDoSources0 + 384
34  com.apple.CoreFoundation    0x907e39fc __CFRunLoopRun + 452
35  com.apple.CoreFoundation    0x907e347c CFRunLoopRunSpecific + 268
36  com.apple.Foundation        0x92985164 -[NSRunLoop runMode:beforeDate:] + 172
37  DumpRenderTree              0x00008ac4 dumpRenderTree + 904 (DumpRenderTree.m:744)
38  DumpRenderTree              0x00005d48 main + 3672 (DumpRenderTree.m:321)
39  DumpRenderTree              0x000024f0 _start + 340 (crt.c:272)
40  DumpRenderTree              0x00002398 start + 60</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46018</commentid>
    <comment_count>1</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2006-06-16 22:48:48 -0700</bug_when>
    <thetext>And fast/events/mouseover-mouseout2.html fails similarly.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46076</commentid>
    <comment_count>2</comment_count>
    <who name="">mitz</who>
    <bug_when>2006-06-17 04:25:22 -0700</bug_when>
    <thetext>The immediate cause for the bug is that when a frame is deallocated along with its WebCoreScriptDebugger, the corresponding WebCoreScriptDebuggerImp is deleted but not detached. I&apos;m surprised that it&apos;s otherwise okay to execute a script in a frame whose WebFrame has been deallocated.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46092</commentid>
    <comment_count>3</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2006-06-17 08:27:16 -0700</bug_when>
    <thetext>CC the usual suspects from Bug 9476.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46103</commentid>
    <comment_count>4</comment_count>
      <attachid>8889</attachid>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2006-06-17 12:27:12 -0700</bug_when>
    <thetext>Created attachment 8889
Patch v1

Patch v1 assumes that the WebFrame may get deallocated when the function is called, so it refetches the debugger before using it again in FunctionImp::callAsFunction().

I am running run-webkit-tests now.  Will report results when completed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46104</commentid>
    <comment_count>5</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2006-06-17 12:45:01 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; I am running run-webkit-tests now.  Will report results when completed.

All of the tests passed (including http tests; Bug 9478).
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46118</commentid>
    <comment_count>6</comment_count>
      <attachid>8889</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2006-06-17 17:12:34 -0700</bug_when>
    <thetext>Comment on attachment 8889
Patch v1

r=me -- Did Tim check the performance impact of adding the debugging hooks?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46122</commentid>
    <comment_count>7</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2006-06-17 17:25:54 -0700</bug_when>
    <thetext>Committed revision 14900.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46123</commentid>
    <comment_count>8</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2006-06-17 18:26:07 -0700</bug_when>
    <thetext>I did check performance, that is why the debugger is enabled only for debug builds or when a default is set.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>8889</attachid>
            <date>2006-06-17 12:27:12 -0700</date>
            <delta_ts>2006-06-17 17:12:34 -0700</delta_ts>
            <desc>Patch v1</desc>
            <filename>bug-9477-v1.diff</filename>
            <type>text/plain</type>
            <size>1433</size>
            <attacher name="David Kilzer (:ddkilzer)">ddkilzer</attacher>
            
              <data encoding="base64">SW5kZXg6IEphdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwo9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ZnVuY3Rpb24uY3BwCShyZXZpc2lvbiAxNDg5OSkKKysrIEphdmFTY3JpcHRDb3JlL2tqcy9mdW5j
dGlvbi5jcHAJKHdvcmtpbmcgY29weSkKQEAgLTExMyw2ICsxMTMsMTEgQEAgSlNWYWx1ZSAqRnVu
Y3Rpb25JbXA6OmNhbGxBc0Z1bmN0aW9uKEV4ZQogICAgIGZwcmludGYoc3RkZXJyLCAicmV0dXJu
aW5nOiB1bmRlZmluZWRcbiIpOwogI2VuZGlmCiAKKyAgLy8gVGhlIGRlYnVnZ2VyIG1heSBoYXZl
IGJlZW4gZGVhbGxvY2F0ZWQgYnkgbm93IGlmIHRoZSBXZWJGcmFtZQorICAvLyB3ZSB3ZXJlIHJ1
bm5pbmcgaW4gaGFzIGJlZW4gZGVzdHJveWVkLCBzbyByZWZldGNoIGl0LgorICAvLyBTZWUgaHR0
cDovL2J1Z3ppbGxhLm9wZW5kYXJ3aW4ub3JnL3Nob3dfYnVnLmNnaT9pZD05NDc3CisgIGRiZyA9
IGV4ZWMtPmR5bmFtaWNJbnRlcnByZXRlcigpLT5kZWJ1Z2dlcigpOworCiAgIGlmIChkYmcpIHsK
ICAgICBpZiAoaW5oZXJpdHMoJkRlY2xhcmVkRnVuY3Rpb25JbXA6OmluZm8pKQogICAgICAgbGlu
ZW5vID0gc3RhdGljX2Nhc3Q8RGVjbGFyZWRGdW5jdGlvbkltcCo+KHRoaXMpLT5ib2R5LT5sYXN0
TGluZSgpOwo=
</data>
<flag name="review"
          id="2599"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>