Closed Bug 1481032 Opened 6 years ago Closed 6 years ago

Assertion failure: reqCapacity < oldCapacity, at js/src/vm/NativeObject.cpp:988

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 --- unaffected
firefox63 --- fixed

People

(Reporter: gkw, Assigned: anba)

References

Details

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

Attachments

(2 files)

The following testcase crashes on mozilla-central revision 37b33c4f58b9 (build with --enable-debug, run with --fuzzing-safe --no-threads --no-baseline --no-ion): x = []; x[6] = 0; Object.preventExtensions(x); x.length = 1; Backtrace: #0 0x000000000191e25f in js::NativeObject::shrinkElements (this=0x7f038c8002c0, cx=0x7f038c917000, reqCapacity=1) at js/src/vm/NativeObject.cpp:988 #1 0x000000000108bb13 in js::ArraySetLength (cx=0x7f038c917000, arr=..., id=..., attrs=4, value=..., result=...) at js/src/builtin/Array.cpp:795 #2 0x0000000001926b78 in js::CallJSSetterOp (cx=<optimized out>, op=0x108c470 <array_length_setter(JSContext*, JS::Handle<JSObject*>, JS::Handle<jsid>, JS::Handle<JS::Value>, JS::ObjectOpResult&)>, result=..., obj=..., id=..., v=...) at js/src/vm/JSContext-inl.h:301 #3 NativeSetExistingDataProperty (cx=<optimized out>, obj=..., shape=..., v=..., result=...) at js/src/vm/NativeObject.cpp:2516 #4 SetExistingProperty (cx=0x7f038c917000, id=..., v=..., receiver=..., pobj=..., prop=..., result=...) at js/src/vm/NativeObject.cpp:2728 /snip For detailed crash information, see attachment.
autobisectjs shows this is probably related to the following changeset: The first bad revision is: changeset: https://hg.mozilla.org/mozilla-central/rev/c543368b25a6 user: André Bargull date: Thu Aug 02 13:03:04 2018 -0700 summary: Bug 1478503: Shrink capacity when modifying length on a non-extensible array. r=jandem Andre, is bug 1478503 a likely regressor?
Blocks: 1478503
Flags: needinfo?(andrebargull)
(In reply to Gary Kwong [:gkw] [:nth10sd] from comment #2) > Andre, is bug 1478503 a likely regressor? Yes, the issue is caused by bug 1478503.
Assignee: nobody → andrebargull
Status: NEW → ASSIGNED
Flags: needinfo?(andrebargull)
Attached patch bug1481032.patchSplinter Review
Simply overlooked to adjust the call to shrinkElements() in ArraySetLength.
Attachment #8997970 - Flags: review?(jdemooij)
Attachment #8997970 - Flags: review?(jdemooij) → review+
Pushed by btara@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/b20289e44689 Non-extensible arrays are already shrunk to capacity. r=jandem
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: