Bug 17502 - Assertion failure when trying to restart a sync XMLHttpRequest as an async one from onreadystatechange
Summary: Assertion failure when trying to restart a sync XMLHttpRequest as an async on...
Status: RESOLVED DUPLICATE of bug 40996
Alias: None
Product: WebKit
Classification: Unclassified
Component: XML (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2008-02-23 10:54 PST by Julien Chaffraix
Modified: 2010-07-19 11:47 PDT (History)
1 user (show)

See Also:

test case (546 bytes, text/html)
2008-02-23 11:22 PST, Julien Chaffraix
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Chaffraix 2008-02-23 10:54:02 PST
While testing XMLHttpRequest behaviour, I have hit that assertion. Test case will come.
Comment 1 Julien Chaffraix 2008-02-23 11:22:03 PST
Created attachment 19302 [details]
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).
Comment 2 Alexey Proskuryakov 2010-07-16 15:46:39 PDT
There are no assertions in XMLHttpRequest::didFinishLoading() now, but I'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&))
Comment 3 Alexey Proskuryakov 2010-07-19 11:47:13 PDT
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 ***