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


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

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

    
Comment 1 AWAY Tom Schuster [:evilpie] 2012-05-15 11:42:02 PDT
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.
Comment 2 Brian Hackett (:bhackett) 2012-05-15 16:24:50 PDT
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.
Comment 3 AWAY Tom Schuster [:evilpie] 2012-05-19 13:06:24 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/20b27f266d73
Comment 4 Ryan VanderMeulen [:RyanVM] 2012-05-19 18:37:06 PDT
https://hg.mozilla.org/mozilla-central/rev/20b27f266d73

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