<?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>21797</bug_id>
          
          <creation_ts>2008-10-22 08:56:55 -0700</creation_ts>
          <short_desc>REGRESSION: Crash in CFHTTPCookieStorageCopy beneath WebCore::cookies() when running fast/dom/document-attribute-js-null.html and http/tests/security/cookies/create-document.html</short_desc>
          <delta_ts>2008-12-29 13:43:06 -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>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, LayoutTestFailure</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Adam Roben (:aroben)">aroben</reporter>
          <assigned_to name="Sam Weinig">sam</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>96174</commentid>
    <comment_count>0</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2008-10-22 08:56:55 -0700</bug_when>
    <thetext>To reproduce:

1. Run fast/dom/document-attribute-js-null.html or http/tests/security/cookies/create-document.html

You&apos;ll crash in the call to CFHTTPCookieStorageCopy beneath WebCore::cookies(). The problem is that url is null. Here&apos;s the backtrace:

...CFNetwork frames elided...
&gt;	WebKit_debug.dll!WebCore::cookies(const WebCore::Document * __formal=0x023a88a0, const WebCore::KURL &amp; url={ReadArbitraryDebuggeeMemory failed (impl-&gt;characters()) = 0x80004005})  Line 82 + 0x19 bytes	C++
 	WebKit_debug.dll!WebCore::Document::cookie()  Line 2886 + 0x16 bytes	C++
 	WebKit_debug.dll!WebCore::jsDocumentCookie(JSC::ExecState * exec=0x03ba02a8, const JSC::Identifier &amp; __formal={...}, const JSC::PropertySlot &amp; slot={...})  Line 330 + 0x10 bytes	C++
 	WebKit_debug.dll!JSC::PropertySlot::getValue(JSC::ExecState * exec=0x03ba02a8, const JSC::Identifier &amp; propertyName={...})  Line 62 + 0x19 bytes	C++
 	WebKit_debug.dll!JSC::JSValue::get(JSC::ExecState * exec=0x03ba02a8, const JSC::Identifier &amp; propertyName={...}, JSC::PropertySlot &amp; slot={...})  Line 465 + 0x14 bytes	C++
 	WebKit_debug.dll!JSC::JSValue::get(JSC::ExecState * exec=0x03ba02a8, const JSC::Identifier &amp; propertyName={...})  Line 451 + 0x18 bytes	C++
 	WebKit_debug.dll!JSC::Machine::cti_op_get_by_val(void * * args=0x0012ead8)  Line 5010 + 0x1b bytes	C++
 	WebKit_debug.dll!JSC::Machine::cti_op_convert_this()  + 0xff bytes	C++
 	WebKit_debug.dll!JSC::Machine::execute(JSC::FunctionBodyNode * functionBodyNode=0x022d1270, JSC::ExecState * callFrame=0x0236b6dc, JSC::JSFunction * function=0x02993d00, JSC::JSObject * thisObj=0x02990000, const JSC::ArgList &amp; args={...}, JSC::ScopeChainNode * scopeChain=0x023a9bc8, JSC::JSValuePtr * exception=0x021ec91c)  Line 993 + 0x26 bytes	C++
 	WebKit_debug.dll!JSC::JSFunction::call(JSC::ExecState * exec=0x0236b6dc, JSC::JSValuePtr thisValue={...}, const JSC::ArgList &amp; args={...})  Line 82 + 0x54 bytes	C++
 	WebKit_debug.dll!JSC::call(JSC::ExecState * exec=0x0236b6dc, JSC::JSValuePtr functionObject={...}, JSC::CallType callType=CallTypeJS, const JSC::CallData &amp; callData={...}, JSC::JSValuePtr thisValue={...}, const JSC::ArgList &amp; args={...})  Line 39 + 0x23 bytes	C++
 	WebKit_debug.dll!WebCore::JSAbstractEventListener::handleEvent(WebCore::Event * event=0x023abf00, bool isWindowEvent=true)  Line 98 + 0x32 bytes	C++
 	WebKit_debug.dll!WebCore::Document::handleWindowEvent(WebCore::Event * evt=0x023abf00, bool useCapture=false)  Line 2714 + 0x2e bytes	C++
 	WebKit_debug.dll!WebCore::EventTargetNode::dispatchWindowEvent(WTF::PassRefPtr&lt;WebCore::Event&gt; e={...})  Line 412	C++
 	WebKit_debug.dll!WebCore::EventTargetNode::dispatchWindowEvent(const WebCore::AtomicString &amp; eventType={...}, bool canBubbleArg=false, bool cancelableArg=false)  Line 420	C++
 	WebKit_debug.dll!WebCore::Document::implicitClose()  Line 1581	C++
 	WebKit_debug.dll!WebCore::FrameLoader::checkCallImplicitClose()  Line 1354	C++
 	WebKit_debug.dll!WebCore::FrameLoader::checkCompleted()  Line 1309	C++
 	WebKit_debug.dll!WebCore::FrameLoader::finishedParsing()  Line 1257	C++
 	WebKit_debug.dll!WebCore::Document::finishedParsing()  Line 3837	C++
 	WebKit_debug.dll!WebCore::HTMLParser::finished()  Line 1556	C++
 	WebKit_debug.dll!WebCore::HTMLTokenizer::end()  Line 1854	C++
 	WebKit_debug.dll!WebCore::HTMLTokenizer::finish()  Line 1894	C++
 	WebKit_debug.dll!WebCore::Document::finishParsing()  Line 1723 + 0x15 bytes	C++
 	WebKit_debug.dll!WebCore::FrameLoader::endIfNotLoadingMainResource()  Line 1085	C++
 	WebKit_debug.dll!WebCore::FrameLoader::end()  Line 1063	C++
 	WebKit_debug.dll!WebCore::DocumentLoader::finishedLoading()  Line 345	C++
 	WebKit_debug.dll!WebCore::FrameLoader::finishedLoading()  Line 2976	C++
 	WebKit_debug.dll!WebCore::MainResourceLoader::didFinishLoading()  Line 334	C++
 	WebKit_debug.dll!WebCore::ResourceLoader::didFinishLoading(WebCore::ResourceHandle * __formal=0x0222b880)  Line 398 + 0xf bytes	C++
 	WebKit_debug.dll!WebCore::didFinishLoading(_CFURLConnection * conn=0x0231a6e0, const void * clientInfo=0x0222b880)  Line 119 + 0x1e bytes	C++
...CFNetwork frames elided...
 	user32.dll!_InternalCallWinProc@20()  + 0x28 bytes	
 	user32.dll!_UserCallWinProcCheckWow@32()  + 0xb7 bytes	
 	user32.dll!_DispatchMessageWorker@8()  + 0xdc bytes	
 	user32.dll!_DispatchMessageW@4()  + 0xf bytes	
 	DumpRenderTree_debug.exe!runTest(const char * pathOrURL=0x0012f6e8)  Line 751 + 0xc bytes	C++
 	DumpRenderTree_debug.exe!main(int argc=2, char * * argv=0x01bf1208)  Line 1088 + 0xc bytes	C++
 	DumpRenderTree_debug.exe!__tmainCRTStartup()  Line 597 + 0x19 bytes	C
 	DumpRenderTree_debug.exe!mainCRTStartup()  Line 414	C
 	kernel32.dll!_BaseProcessStart@4()  + 0x23 bytes</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96175</commentid>
    <comment_count>1</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2008-10-22 08:57:09 -0700</bug_when>
    <thetext>Also affects http/tests/security/cookies/xmlhttprequest.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96180</commentid>
    <comment_count>2</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2008-10-22 09:05:52 -0700</bug_when>
    <thetext>&lt;rdar://problem/6310682&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96194</commentid>
    <comment_count>3</comment_count>
    <who name="">mitz</who>
    <bug_when>2008-10-22 10:27:22 -0700</bug_when>
    <thetext>Documents create with createDocument have an empty cookieURL(), which is then passed to cookies(), causing the crash. Perhaps Document::cookie() and Document::setCookie() should return early if the cookieURL() is empty.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103717</commentid>
    <comment_count>4</comment_count>
    <who name="Adele Peterson">adele</who>
    <bug_when>2008-12-29 12:21:33 -0800</bug_when>
    <thetext>I implemented Dan&apos;s suggestion.  I&apos;m now getting some other weird crashes in ThreadGlobalData.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103720</commentid>
    <comment_count>5</comment_count>
      <attachid>26294</attachid>
    <who name="Adele Peterson">adele</who>
    <bug_when>2008-12-29 12:49:49 -0800</bug_when>
    <thetext>Created attachment 26294
patch

I now think the ThreadGlobalData problem is unrelated.  This is a pretty safe change which should prevent the cookie crashes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103724</commentid>
    <comment_count>6</comment_count>
    <who name="Adele Peterson">adele</who>
    <bug_when>2008-12-29 13:43:06 -0800</bug_when>
    <thetext>Committed revision 39501</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>26294</attachid>
            <date>2008-12-29 12:49:49 -0800</date>
            <delta_ts>2008-12-29 13:36:30 -0800</delta_ts>
            <desc>patch</desc>
            <filename>patch.txt</filename>
            <type>text/plain</type>
            <size>1792</size>
            <attacher name="Adele Peterson">adele</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiAzOTUwMCkKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTcgQEAKKzIwMDgtMTItMjkgIEFkZWxlIFBldGVyc29uICA8YWRlbGVAYXBwbGUu
Y29tPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgIEZp
eCBmb3IgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTIxNzk3CisgICAg
ICAgIDxyZGFyOi8vcHJvYmxlbS82MzEwNjgyPiBSRUdSRVNTSU9OOiBDcmFzaCBp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aXMsIGNvb2tpZVVSTCgpKTsKKyAgICBLVVJMIGNvb2tpZVVSTCA9IHRoaXMt
PmNvb2tpZVVSTCgpOworICAgIGlmIChjb29raWVVUkwuaXNFbXB0eSgpKQorICAgICAgICByZXR1
cm4gU3RyaW5nKCk7CisKKyAgICByZXR1cm4gY29va2llcyh0aGlzLCBjb29raWVVUkwpOwogfQog
CiB2b2lkIERvY3VtZW50OjpzZXRDb29raWUoY29uc3QgU3RyaW5nJiB2YWx1ZSkKQEAgLTI5MTAs
NyArMjkxNCwxMSBAQCB2b2lkIERvY3VtZW50OjpzZXRDb29raWUoY29uc3QgU3RyaW5nJiB2CiAg
ICAgaWYgKHBhZ2UoKSAmJiAhcGFnZSgpLT5jb29raWVFbmFibGVkKCkpCiAgICAgICAgIHJldHVy
bjsKIAotICAgIHNldENvb2tpZXModGhpcywgY29va2llVVJMKCksIHBvbGljeUJhc2VVUkwoKSwg
dmFsdWUpOworICAgIEtVUkwgY29va2llVVJMID0gdGhpcy0+Y29va2llVVJMKCk7CisgICAgaWYg
KGNvb2tpZVVSTC5pc0VtcHR5KCkpCisgICAgICAgIHJldHVybjsKKworICAgIHNldENvb2tpZXMo
dGhpcywgY29va2llVVJMLCBwb2xpY3lCYXNlVVJMKCksIHZhbHVlKTsKIH0KIAogU3RyaW5nIERv
Y3VtZW50OjpyZWZlcnJlcigpIGNvbnN0Cg==
</data>
<flag name="review"
          id="12448"
          type_id="1"
          status="+"
          setter="beidson"
    />
          </attachment>
      

    </bug>

</bugzilla>