<?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>17502</bug_id>
          
          <creation_ts>2008-02-23 10:54:02 -0800</creation_ts>
          <short_desc>Assertion failure when trying to restart a sync XMLHttpRequest as an async one from onreadystatechange</short_desc>
          <delta_ts>2010-07-19 11:47:13 -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>XML</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>40996</dup_id>
          
          <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>1</everconfirmed>
          <reporter name="Julien Chaffraix">jchaffraix</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>71613</commentid>
    <comment_count>0</comment_count>
    <who name="Julien Chaffraix">jchaffraix</who>
    <bug_when>2008-02-23 10:54:02 -0800</bug_when>
    <thetext>While testing XMLHttpRequest behaviour, I have hit that assertion. Test case will come.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71616</commentid>
    <comment_count>1</comment_count>
      <attachid>19302</attachid>
    <who name="Julien Chaffraix">jchaffraix</who>
    <bug_when>2008-02-23 11:22:03 -0800</bug_when>
    <thetext>Created attachment 19302
test case

Explanation :

the readystatechange listener is called from processSyncLoadResults line changeState(Sent).
When we call open in the previous listener, we first set m_aborted to true in internalAbort but later in open we set it to false.
As a consequence, when we come to processSyncLoadResults the previous XMLHttpRequest is not cancelled (m_aborted is false) and then triggers the assertion as m_loader != 0 (we have created an async XHR in the listener).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>252735</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-07-16 15:46:39 -0700</bug_when>
    <thetext>There are no assertions in XMLHttpRequest::didFinishLoading() now, but I&apos;m getting an assertion failure in a different place:

ASSERTION FAILED: !m_didTellLoaderAboutRequest
(/Volumes/Data/Safari/OpenSource/WebCore/xml/XMLHttpRequest.cpp:571 void WebCore::XMLHttpRequest::createRequest(WebCore::ExceptionCode&amp;))</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>253306</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-07-19 11:47:13 -0700</bug_when>
    <thetext>This is fixed by r63680, as we no longer dispatch readystatechange at wrong times.

*** This bug has been marked as a duplicate of bug 40996 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>19302</attachid>
            <date>2008-02-23 11:22:03 -0800</date>
            <delta_ts>2008-02-23 11:22:03 -0800</delta_ts>
            <desc>test case</desc>
            <filename>xmlhttprequest-sync-vs-async-assertion-failure.html</filename>
            <type>text/html</type>
            <size>546</size>
            <attacher name="Julien Chaffraix">jchaffraix</attacher>
            
              <data encoding="base64">PGh0bWw+PGhlYWQ+PC9oZWFkPjxib2R5PgoKPHA+WW91IHNob3VsZCBzZWUgIlBBU1MiIG9uY2Ug
OjwvcD4KCjxzY3JpcHQgdHlwZT0idGV4dC9qYXZhc2NyaXB0Ij4KdmFyIHhocjsKCmlmICh3aW5k
b3cuWE1MSHR0cFJlcXVlc3QpIHsKICAgIHhociA9IG5ldyBYTUxIdHRwUmVxdWVzdCgpOwp9IGVs
c2UgewogICAgdHJ5IHsKICAgICAgICB4aHIgPSBuZXcgQWN0aXZlWE9iamVjdCgiTXN4bWwyLlhN
TEhUVFAiKTsKICAgIH0gY2F0Y2ggKGV4KSB7CiAgICAgICAgeGhyID0gbmV3IEFjdGl2ZVhPYmpl
Y3QoIk1pY3Jvc29mdC5YTUxIVFRQIik7CiAgICB9Cn0KCnhoci5vcGVuKCJHRVQiLCAicmVzb3Vy
Y2VzLzEyNTEuaHRtbCIsIGZhbHNlKTsKeGhyLm9ucmVhZHlzdGF0ZWNoYW5nZSA9IGZ1bmN0aW9u
ICgpIHsKICAgIHhoci5vcGVuKCJHRVQiLCAicmVzb3VyY2VzLzEyNTEuaHRtbCIsIHRydWUpOwog
ICAgeGhyLnNlbmQobnVsbCk7Cn0KCnhoci5zZW5kKG51bGwpOwoKZG9jdW1lbnQud3JpdGUoIlBB
U1MiKTsKCjwvc2NyaXB0PgoKPC9ib2R5PjwvaHRtbD4K
</data>

          </attachment>
      

    </bug>

</bugzilla>