<?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>15250</bug_id>
          
          <creation_ts>2007-09-21 03:37:11 -0700</creation_ts>
          <short_desc>REGRESSION: Reproducible crash in Safari when evaluating script in Drosera console</short_desc>
          <delta_ts>2007-09-21 04:15:21 -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>523.x (Safari 3)</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>InRadar, Regression</keywords>
          <priority>P1</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark Rowe (bdash)">mrowe</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>koivisto</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>210</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2007-09-21 03:37:11 -0700</bug_when>
    <thetext>Evaluating any JavaScript in the Drosera console will crash the Safari instance it is attached to with the following backtrace:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x01640b39 in KJS::JSCell::isObject (this=0x0) at value.h:231
231	    return type() == ObjectType;
(gdb) bt
#0  0x01640b39 in KJS::JSCell::isObject (this=0x0) at value.h:231
#1  0x01875015 in KJS::JSCell::isObject (this=0x0, info=0x1cb2120) at object.h:539
#2  0x0187507d in KJS::JSValue::isObject (this=0x0, c=0x1cb2120) at object.h:545
#3  0x018a1a28 in KJS::ScriptInterpreter::isGlobalObject (this=0x27ef6020, v=0x0) at /Volumes/Data/Home/Documents/Work/WebKit-git/OpenSource/WebCore/bindings/js/kjs_binding.cpp:270
#4  0x02c44cc5 in KJS::GlobalFuncImp::callAsFunction (this=0x27183360, exec=0xbfffd82c, thisObj=0x0, args=@0xbfffc9a0) at function.cpp:820
#5  0x02c2298a in KJS::JSObject::call (this=0x27183360, exec=0xbfffd82c, thisObj=0x0, args=@0xbfffc9a0) at object.cpp:94
#6  0x01640696 in -[WebCoreScriptCallFrame evaluateWebScript:] (self=0x27c93e20, _cmd=0x3bc2fa, script=0x26d9b990) at /Volumes/Data/Home/Documents/Work/WebKit-git/OpenSource/WebCore/bridge/mac/WebCoreScriptDebugger.mm:366
#7  0x00362880 in -[WebScriptCallFrame evaluateWebScript:] (self=0x26c1e9f0, _cmd=0x3bc2fa, script=0x26d9b990) at /Volumes/Data/Home/Documents/Work/WebKit-git/OpenSource/WebKit/WebView/WebScriptDebugDelegate.mm:192
#8  0x935a3f7d in __invoking___ ()
#9  0x935a3968 in -[NSInvocation invoke] ()
#10 0x935a3a38 in -[NSInvocation invokeWithTarget:] ()
#11 0x935a3eaa in ___forwarding___ ()
#12 0x935a3f12 in __forwarding_prep_0___ ()
#13 0x935a3f7d in __invoking___ ()
#14 0x935a3968 in -[NSInvocation invoke] ()
#15 0x93f4bc94 in -[NSConnection dispatchInvocation:] ()
#16 0x93f49c47 in -[NSConnection handleRequest:sequence:] ()
#17 0x93f4948d in -[NSConnection handlePortCoder:] ()
#18 0x93f48fbe in -[NSConcretePortCoder dispatch] ()

I&apos;m pretty sure this is due to Antti&apos;s changes relating to the global object used by &quot;eval&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>209</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2007-09-21 03:46:09 -0700</bug_when>
    <thetext>-[WebCoreScriptCallFrame evaluateWebScript:] retrieves eval from the global object, if it exists, and then calls it with a NULL this object.  It is trivial to null-check thisObj inside GlobalFuncImp::callAsFunction in one place, which resolves the crash, but I&apos;m not sure that it is correct for -[WebCoreScriptCallFrame evaluteWebScript:] to be passing NULL for thisObj in the first place.  It clearly used to work, so I&apos;ll go ahead and prepare a patch to restore this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>208</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2007-09-21 03:47:47 -0700</bug_when>
    <thetext>&lt;rdar://problem/5496942&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>204</commentid>
    <comment_count>3</comment_count>
      <attachid>16338</attachid>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2007-09-21 03:51:27 -0700</bug_when>
    <thetext>Created attachment 16338
Proposed patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205</commentid>
    <comment_count>4</comment_count>
      <attachid>16338</attachid>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2007-09-21 04:14:07 -0700</bug_when>
    <thetext>Comment on attachment 16338
Proposed patch

Antti reviewed this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>206</commentid>
    <comment_count>5</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2007-09-21 04:15:21 -0700</bug_when>
    <thetext>Landed in r25681.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>16338</attachid>
            <date>2007-09-21 03:51:27 -0700</date>
            <delta_ts>2007-09-21 04:14:07 -0700</delta_ts>
            <desc>Proposed patch</desc>
            <filename>patch.txt</filename>
            <type>text/plain</type>
            <size>1557</size>
            <attacher name="Mark Rowe (bdash)">mrowe</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCB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cmUva2pzL2Z1bmN0aW9uLmNwcAorKysgYi9KYXZhU2NyaXB0Q29yZS9ranMvZnVu
Y3Rpb24uY3BwCkBAIC04MTcsNyArODE3LDcgQEAgSlNWYWx1ZSogR2xvYmFsRnVuY0ltcDo6Y2Fs
bEFzRnVuY3Rpb24oRXhlY1N0YXRlKiBleGVjLCBKU09iamVjdCogdGhpc09iaiwgY29uc3QKICAg
ICAgICAgaWYgKCFwcm9nTm9kZSkKICAgICAgICAgICByZXR1cm4gdGhyb3dFcnJvcihleGVjLCBT
eW50YXhFcnJvciwgZXJyTXNnLCBlcnJMaW5lLCBzaWQsIE5VTEwpOwogCi0gICAgICAgIGJvb2wg
c3dpdGNoR2xvYmFsID0gZXhlYy0+ZHluYW1pY0ludGVycHJldGVyKCktPmlzR2xvYmFsT2JqZWN0
KHRoaXNPYmopICYmIHRoaXNPYmogIT0gZXhlYy0+ZHluYW1pY0ludGVycHJldGVyKCktPmdsb2Jh
bE9iamVjdCgpOworICAgICAgICBib29sIHN3aXRjaEdsb2JhbCA9IHRoaXNPYmogJiYgZXhlYy0+
ZHluYW1pY0ludGVycHJldGVyKCktPmlzR2xvYmFsT2JqZWN0KHRoaXNPYmopICYmIHRoaXNPYmog
IT0gZXhlYy0+ZHluYW1pY0ludGVycHJldGVyKCktPmdsb2JhbE9iamVjdCgpOwogICAgICAgICAg
IAogICAgICAgICAvLyBlbnRlciBhIG5ldyBleGVjdXRpb24gY29udGV4dAogICAgICAgICBJbnRl
cnByZXRlciogaW50ZXJwcmV0ZXIgPSBzd2l0Y2hHbG9iYWwgPyBleGVjLT5keW5hbWljSW50ZXJw
cmV0ZXIoKS0+aW50ZXJwcmV0ZXJGb3JHbG9iYWxPYmplY3QodGhpc09iaikgOiBleGVjLT5keW5h
bWljSW50ZXJwcmV0ZXIoKTsK
</data>
<flag name="review"
          id="6879"
          type_id="1"
          status="+"
          setter="mrowe"
    />
          </attachment>
      

    </bug>

</bugzilla>