Closed Bug 1249954 Opened 9 years ago Closed 9 years ago

SingleStepCallback should check return value of Vector::append.

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla47
Tracking Status
firefox47 --- fixed

People

(Reporter: arai, Assigned: arai)

Details

Attachments

(1 file)

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.
added AutoEnterOOMUnsafeRegion and crash on append failure.
Assignee: nobody → arai.unmht
Attachment #8721760 - Flags: review?(terrence)
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+
(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
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.

Attachment

General

Created:
Updated:
Size: