Closed
Bug 1249954
Opened 9 years ago
Closed 9 years ago
SingleStepCallback should check return value of Vector::append.
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla47
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
Details
Attachments
(1 file)
2.07 KB,
patch
|
terrence
:
review+
|
Details | Diff | Splinter Review |
https://dxr.mozilla.org/mozilla-central/rev/69ec3dc408a2a720cb2b8210fea33e3504aeec22/js/src/shell/js.cpp#4287
> static void
> SingleStepCallback(void* arg, jit::Simulator* sim, void* pc)
> {
> ...
> if (frameNo > 0)
> stack.append(",", 1);
> stack.append(frames[i].label, strlen(frames[i].label));
> ...
> stacks.append(Move(stack));
> ...
> }
return value of append is ignored there.
both stack and stacks use SystemAllocPolicy and it's fallible.
this callback cannot report error, so it should crash on OOM.
or, perhaps we could just report the OOM and continue? as it's used only from simulator.
Assignee | ||
Comment 1•9 years ago
|
||
added AutoEnterOOMUnsafeRegion and crash on append failure.
Assignee: nobody → arai.unmht
Attachment #8721760 -
Flags: review?(terrence)
Comment 2•9 years ago
|
||
Comment on attachment 8721760 [details] [diff] [review]
Handle OOM in SingleStepCallback.
Review of attachment 8721760 [details] [diff] [review]:
-----------------------------------------------------------------
Excellent! Please add a MOZ_WARN_UNUSED_RESULT to StackChars::append (and any other oom-unsafe methods in that class).
Attachment #8721760 -
Flags: review?(terrence) → review+
Assignee | ||
Comment 3•9 years ago
|
||
(In reply to Terrence Cole [:terrence] from comment #2)
> Excellent! Please add a MOZ_WARN_UNUSED_RESULT to StackChars::append (and
> any other oom-unsafe methods in that class).
it's already added in bug 1237201, and I noticed this case as warning message is shown for the line :)
https://dxr.mozilla.org/mozilla-central/rev/e1cf617a1f2813b6cd66f460313a61c223406c9b/mfbt/Vector.h#608
Assignee | ||
Comment 4•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/251b599adc5d1a35d7971de526ea4ba68385c0b1
Bug 1249954 - Handle OOM in SingleStepCallback. r=terrence
Comment 5•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in
before you can comment on or make changes to this bug.
Description
•