Infinite recursion with E4X causes "out of memory" instead of catchable "stack overflow", take 2

RESOLVED WORKSFORME

Status

()

RESOLVED WORKSFORME
11 years ago
7 years ago

People

(Reporter: jruderman, Unassigned)

Tracking

(Blocks: 1 bug, {testcase})

Trunk
x86
Mac OS X
testcase
Points:
---
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

11 years ago
try {
  (function f() f(<a><b/></a>))();
} catch(e) {
  print("Caught: " + e);
}

Result: "out of memory".

Expected: "Caught: InternalError: script stack space quota is exhausted".

Changing the E4X object to the simpler "<a/>" makes the bug go away.

This seems pretty similar to bug 394941, but the testcase there still works correctly.
(Reporter)

Comment 1

10 years ago
Now I get "Caught: InternalError: too much recursion" with the testcase in comment 0.  But with the following testcase, I still get a straight oom:

try {
  x = <y/>;
  for (j=0;j<20;++j) { print(j); x.z = x; }
} catch(e) {
  print("Caught: " + e);
}

i.js:3: out of memory
With a current js shell, I still get "Caught: InternalError: too much recursion" with the testcase for comment 0. However, the testcase in comment #1 now runs fine with no OOM.
Same results in a debug shell. Comment 1 is a heckuva ball buster testcase.
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Flags: in-testsuite?
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.