Closed Bug 579656 Opened 14 years ago Closed 13 years ago

Error 'script stack space quota is exhausted' when parsing 3MB XML file using Jquery


(Core :: JavaScript Engine, defect)

1.9.2 Branch
Not set





(Reporter: pete, Unassigned)





(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv: Gecko/20100625 Firefox/3.6.6
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv: Gecko/20100625 Firefox/3.6.6

I've spun this off as a new bug from on Boris Zbarsky's advice.

I'm running into 'script stack space quota is exhausted' when loading a 3.4MB XML file using JQuery, and
have created a minimal example that reproduces the problem at

Reproducible: Always

Steps to Reproduce:
1 - Open in Firefox
2 - After a few seconds check the error console

Actual Results:  
The code fails with the message 

Error: script stack space quota is exhausted
Source File:
Line: 21

Expected Results:  
The XML file should be loaded and parsed

The same page runs with no problems in Safari 5.0 and Chrome 6.0. 
My full Firefox version is 

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:
Gecko/20100625 Firefox/3.6.6

You can download a zip of the source files at

Boris noted:
"what happens is that execution of the relevant regexp needs more than 65MB of backtrack stack data, which is what makes you get the error message.  The relevant js_ReportOutOfScriptQuota call is PushBackTrackState here:

3520            btincr = JS_ROUNDUP(btincr, btsize);
3521            JS_ARENA_GROW_CAST(gData->backTrackStack, REBackTrackData *,
3522                               &gData->cx->regexpPool, btsize, btincr);
3523            if (!gData->backTrackStack) {
3524                js_ReportOutOfScriptQuota(gData->cx);"

I'll also be contacting the JQuery team to see if they have any insight, but since it runs on other platforms it seems worth looking into what's different on Firefox.

I've also run the XML file through the validator at and the syntax is valid.
I've filed this bug with the JQuery team to track any fixes that could be applied on the framework side:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729)
Confirmed. Still haven't checked trunk builds.

Pete, can you attach the testcase to the bug?
Ever confirmed: true
OS: Mac OS X → All
Hardware: x86 → All
See Also: → 547967
Version: unspecified → 1.9.2 Branch
Bug 596317 - misleading error message: "script stack space quota is exhausted"
FYI see

fx  = 1.25M
chrome = 105M

I'm hitting the limit in fx3.6.10 using lucidchart  with ~15 tabs.
This was discussed in more depth/fixed way back here:
this is removed by bug 644241
Closed: 13 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.