Last Comment Bug 707911 - Rewrite StackTraceToString to use StringBuffer
: Rewrite StackTraceToString to use StringBuffer
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
-- normal (vote)
: mozilla15
Assigned To: Tom Schuster [:evilpie]
: Jason Orendorff [:jorendorff]
Depends on:
  Show dependency treegraph
Reported: 2011-12-06 02:45 PST by Tom Schuster [:evilpie]
Modified: 2012-05-19 18:37 PDT (History)
2 users (show)
ryanvm: in‑testsuite-
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

v1 (6.84 KB, patch)
2012-05-15 11:42 PDT, Tom Schuster [:evilpie]
bhackett1024: review+
Details | Diff | Splinter Review

Description User image Tom Schuster [:evilpie] 2011-12-06 02:45:10 PST

Comment 1 User image Tom Schuster [:evilpie] 2012-05-15 11:42:02 PDT
Created attachment 624124 [details] [diff] [review]

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.
Comment 2 User image Brian Hackett (:bhackett) 2012-05-15 16:24:50 PDT
Comment on attachment 624124 [details] [diff] [review]

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.
Comment 4 User image Ryan VanderMeulen [:RyanVM] 2012-05-19 18:37:06 PDT

Note You need to log in before you can comment on or make changes to this bug.