<?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>9731</bug_id>
          
          <creation_ts>2006-07-04 12:56:11 -0700</creation_ts>
          <short_desc>[Drosera] crash when trying to access the scope chain</short_desc>
          <delta_ts>2008-05-17 09:55:53 -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>New Bugs</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>9597</blocked>
    
    <blocked>9598</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Timothy Hatcher">timothy</reporter>
          <assigned_to name="Timothy Hatcher">timothy</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>48188</commentid>
    <comment_count>0</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2006-07-04 12:56:11 -0700</bug_when>
    <thetext>Drosera crashes Safari when it tries to access the scope chain. This is happening because the WebCoreScriptDebugger and one of the WebCoreScriptCallFrames is holding on to an old WebScriptObject for the frame&apos;s window. The window object is cleared each time a page loads, so the debugger needs to be detached and reattached when this happens.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48191</commentid>
    <comment_count>1</comment_count>
      <attachid>9195</attachid>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2006-07-04 13:06:02 -0700</bug_when>
    <thetext>Created attachment 9195
Patch to fix the crash</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48194</commentid>
    <comment_count>2</comment_count>
      <attachid>9195</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2006-07-04 14:37:21 -0700</bug_when>
    <thetext>Comment on attachment 9195
Patch to fix the crash

Sounds wrong to me. The window object is cleared, yes, but it is the same window object. Why do we need to create a new WebScriptObject each time when it&apos;s the same window object?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48200</commentid>
    <comment_count>3</comment_count>
      <attachid>9195</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2006-07-04 14:52:07 -0700</bug_when>
    <thetext>Comment on attachment 9195
Patch to fix the crash

I talked to Tim and made it clear this is not a fix, but rather a workaround, for whatever bug he&apos;s run into.

He&apos;s going to investigate further.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48303</commentid>
    <comment_count>4</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2006-07-04 22:39:59 -0700</bug_when>
    <thetext>Turns out this crash is the same root cause of &lt;rdar://problem/4608404&gt; WebScriptObject&apos;s _executionContext has no ownership policy.

Here is what Goeff had to say in the radar.

&quot;Whenever the current page changes, FrameMac::setView calls FrameMac::cleanupPluginRootObjects() (WebCore/bridge/mac/FrameMac.mm), which calls removeAllNativeReferences(), which unprotects all JSObjects that have been bound to wrappers in other languages (Java, C, Objc). The assumption in this code is that JSObjects only get bound to wrappers belonging to plug-ins, and that plug-ins go away when the page changes.

This assumption is incorrect. WebKit&apos;s WebScriptObject API allows an app to embed a WebView and access its data through WebScriptObject wrappers. As long as those wrappers are alive, the data they bind should remain alive, too.&quot;

I do not understand the design well enough to fix cleanupPluginRootObjects, I will leave it to Geoff.

Can my patch land with a FIXME until &lt;rdar://problem/4608404&gt; is fixed? This fix will unblock bug 9597,  and bug 9598.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48305</commentid>
    <comment_count>5</comment_count>
      <attachid>9195</attachid>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2006-07-04 22:59:28 -0700</bug_when>
    <thetext>Comment on attachment 9195
Patch to fix the crash

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48306</commentid>
    <comment_count>6</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2006-07-04 23:13:01 -0700</bug_when>
    <thetext>Landed in r15159. The [_frame _detachScriptDebugger] line can be rolled out once &lt;rdar://problem/4608404&gt; is fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80742</commentid>
    <comment_count>7</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2008-05-17 09:55:53 -0700</bug_when>
    <thetext>Closing since Drosera has been replaced by the new Web Inspector debugger. Moving to the New Bugs component so the Drosera component can be closed and removed.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>9195</attachid>
            <date>2006-07-04 13:06:02 -0700</date>
            <delta_ts>2006-07-04 22:59:28 -0700</delta_ts>
            <desc>Patch to fix the crash</desc>
            <filename>9731.patch</filename>
            <type>text/plain</type>
            <size>2064</size>
            <attacher name="Timothy Hatcher">timothy</attacher>
            
              <data encoding="base64">SW5kZXg6IENoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBDaGFuZ2VMb2cJKHJldmlzaW9uIDE1MTUw
KQorKysgQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMjIgQEAKKzIwMDYtMDct
MDQgIFRpbW90aHkgSGF0Y2hlciAgPHRpbW90aHlAYXBwbGUuY29tPgorCisgICAgICAgIFJldmll
d2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgIEJ1ZyA5NzMxOiBbRHJvc2VyYV0gY3Jh
c2ggd2hlbiB0cnlpbmcgdG8gYWNjZXNzIH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nZ2VyXTsKKyAgICB9CisgICAgW1t3diBfZnJhbWVM
b2FkRGVsZWdhdGVGb3J3YXJkZXJdIHdlYlZpZXc6d3Ygd2luZG93U2NyaXB0T2JqZWN0QXZhaWxh
YmxlOltzZWxmIHdpbmRvd1NjcmlwdE9iamVjdF1dOwogfQogCiAtIChpbnQpc3BlbGxDaGVja2Vy
RG9jdW1lbnRUYWcK
</data>
<flag name="review"
          id="2764"
          type_id="1"
          status="+"
          setter="mjs"
    />
          </attachment>
      

    </bug>

</bugzilla>