Closed Bug 421624 Opened 16 years ago Closed 12 years ago

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

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jruderman, Unassigned)

Details

(Keywords: testcase)

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.
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
Closed: 12 years ago
Flags: in-testsuite?
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.