Closed Bug 1478943 Opened 8 years ago Closed 8 years ago

Assertion failure: aIndex < mLength, at dist/include/mozilla/Vector.h:545

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox-esr52 --- unaffected
firefox-esr60 --- unaffected
firefox61 --- unaffected
firefox62 --- fixed
firefox63 --- fixed

People

(Reporter: gkw, Assigned: jonco)

References

(Blocks 1 open bug)

Details

(4 keywords, Whiteboard: [fuzzblocker][jsbugmon:update])

Attachments

(2 files)

The following testcase crashes on mozilla-central revision 8f2f847b2f9d (build with --enable-debug --enable-more-deterministic, run with --fuzzing-safe --no-threads --no-baseline --no-ion): gcparam("markStackLimit", 1); startgc(1); Backtrace: #0 0x0000000001c9e3c3 in mozilla::Vector<js::gc::MarkStack::TaggedPtr, 0ul, js::SystemAllocPolicy>::operator[] (this=<optimized out>, aIndex=1) at /home/ubuntu/shell-cache/js-dbg-64-dm-linux-8f2f847b2f9d/objdir-js/dist/include/mozilla/Vector.h:545 #1 js::gc::MarkStack::poisonUnused (this=0x7f69ea11a6a8) at js/src/gc/Marking.cpp:2257 #2 0x0000000001c805a7 in js::GCMarker::saveValueRanges (this=<optimized out>) at js/src/gc/Marking.cpp:1820 #3 0x0000000001c64b69 in js::GCMarker::drainMarkStack (this=0x7f69ea11a690, budget=...) at js/src/gc/Marking.cpp:1569 #4 0x0000000001c719b6 in js::gc::GCRuntime::drainMarkStack (sliceBudget=..., phase=js::gcstats::PhaseKind::MARK, this=<optimized out>) at js/src/gc/GC.cpp:5922 #5 js::gc::GCRuntime::incrementalCollectSlice (this=0x7f69ea1196d8, budget=..., reason=JS::gcreason::DEBUG_GC, session=...) at js/src/gc/GC.cpp:7130 #6 0x0000000001c73a4d in js::gc::GCRuntime::gcCycle (this=0x7f69ea1196d8, nonincrementalByAPI=<optimized out>, budget=..., reason=<optimized out>) at js/src/gc/GC.cpp:7519 /snip For detailed crash information, see attachment. GC is on the stack and GC functions are involved, so setting s-s as a start.
autobisectjs shows this is probably related to the following changeset: The first bad revision is: changeset: https://hg.mozilla.org/mozilla-central/rev/aa709ea6ba7c user: Jon Coppeard date: Thu Jul 26 15:33:46 2018 +0100 summary: Bug 1476239 - Poison unused mark stack memory r=sfink Jon, is bug 1476239 a likely regressor?
Blocks: 1476239
Flags: needinfo?(jcoppeard)
Setting [fuzzblocker] as this is happening quite frequently.
Summary: Assertion failure: aIndex < mLength, at /home/ubuntu/shell-cache/js-dbg-64-dm-linux-8f2f847b2f9d/objdir-js/dist/include/mozilla/Vector.h:545 → Assertion failure: aIndex < mLength, at dist/include/mozilla/Vector.h:545
Whiteboard: [jsbugmon:update] → [fuzzblocker][jsbugmon:update]
Not s-s. I was using the array subscript operator on a vector and taking the address of the the resulting reference, but in the case where the vector index was out of bounds the address will never be accessed. Also this is during poisoning which is not present in release builds.
Assignee: nobody → jcoppeard
Group: javascript-core-security
Flags: needinfo?(jcoppeard)
As above. Don't use subscript operator on possibly out-of-bounds index.
Attachment #8995465 - Flags: review?(sphink)
Attachment #8995465 - Flags: review?(sphink) → review+
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
The regressing bug 1476239 was backported to 62, so Jon, do you mind please nominating this for backport to beta?
Flags: needinfo?(jcoppeard)
Comment on attachment 8995465 [details] [diff] [review] bug1478943-mark-stack-poison This only affects debug/nightly builds so feel free to reject if this doesn't meet backporting criteria. Approval Request Comment [Feature/Bug causing the regression]: Bug 1476239. [User impact if declined]: This only affects debug builds, so there's no end user impact. On debug builds there may be an assertion failure. [Is this code covered by automated tests?]: Yes [Has the fix been verified in Nightly?]: Yes [Needs manual test from QE? If yes, steps to reproduce]: No [List of other uplifts needed for the feature/fix]: None [Is the change risky?]: No [Why is the change risky/not risky?]: This is a very small simple fix [String changes made/needed]: None
Flags: needinfo?(jcoppeard)
Attachment #8995465 - Flags: approval-mozilla-beta?
Comment on attachment 8995465 [details] [diff] [review] bug1478943-mark-stack-poison Makes life better for our fuzzers. Approved for 62.0b18.
Attachment #8995465 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: