Bug 1405521 Comment 17 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

The stack shows an interesting cycle of:
```
XMLHttpRequest_Binding::open
...
XMLHttpRequestMainThread::FireReadystatechangeEvent
...
js::RunScript
...
XMLHttpRequest_Binding::send
...
XMLHttpRequestMainThread::ResumeEventDispatching
EventTarget::DispatchEvent
...
js::RunScript
...
XMLHttpRequest_Binding::open
```
over and over again.   So sync XHR that triggers sync XHR etc.  I wonder whether the user gets tired partway through and closes the tab...

Eventually we are way down into that stack, in danger of hitting JS engine stack-overflow checks, and processing events under a sync XHR.  We land in `nsDocumentOpenInfo::OnStartRequest` and go from there.  We try to create a wrapper for the document, try to create its proto, try to define properties on it, hit the over-recursion check in `CallJSAddPropertyOp` and fail it, fail to add the property and bubble up the stack failing things.

I added some notes to the Pernosco session for these bits.
The stack shows an interesting cycle of:
```
XMLHttpRequest_Binding::open
...
XMLHttpRequestMainThread::FireReadystatechangeEvent
...
js::RunScript
...
XMLHttpRequest_Binding::send
...
XMLHttpRequestMainThread::ResumeEventDispatching
EventTarget::DispatchEvent
...
js::RunScript
...
XMLHttpRequest_Binding::open
```
over and over again.   So sync XHR that triggers sync XHR etc.

Eventually we are way down into that stack, in danger of hitting JS engine stack-overflow checks, and processing events under a sync XHR.  We land in `nsDocumentOpenInfo::OnStartRequest` and go from there.  We try to create a wrapper for the document, try to create its proto, try to define properties on it, hit the over-recursion check in `CallJSAddPropertyOp` and fail it, fail to add the property and bubble up the stack failing things.

I added some notes to the Pernosco session for these bits.

Back to Bug 1405521 Comment 17