Rewrite StackTraceToString to use StringBuffer

RESOLVED FIXED in mozilla15

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: evilpie, Assigned: evilpie)

Tracking

unspecified
mozilla15
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Comment hidden (empty)
Depends on: 700169
No longer depends on: 700169
Assignee: general → evilpies
Created attachment 624124 [details] [diff] [review]
v1

I think this works around the problem in the old version of this.

So before I try to add name, line and file for a new StackFrame, I first try to reserve that space, this way we shouldn't OOM while adding either name, line or file and all entries should be correct.

I also kept around the length limit.
Attachment #624124 - Flags: review?(bhackett1024)
Comment on attachment 624124 [details] [diff] [review]
v1

Review of attachment 624124 [details] [diff] [review]:
-----------------------------------------------------------------

Nice cleanup.

::: js/src/jit-test/tests/basic/bug707911.js
@@ +12,5 @@
> +	/* oom should not cause abort, but instead just shorten the stacktrace */
> +} catch (e) {
> +	/* we assume at least one entry make it into the stack */
> +	assertEq(e.stack.indexOf('a@') >= 0, true); 
> +}

Without a value for -A this test won't trigger an OOM while constructing the stack trace, it will hit recursion limits long before.  Either fix the test or remove it.
Attachment #624124 - Flags: review?(bhackett1024) → review+
http://hg.mozilla.org/integration/mozilla-inbound/rev/20b27f266d73
Target Milestone: --- → mozilla15
https://hg.mozilla.org/mozilla-central/rev/20b27f266d73
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.