Closed Bug 1332881 Opened 9 years ago Closed 9 years ago

Crash [@ js::CloseIterator] or Assertion failure: isObject(), at dist/include/js/Value.h:642

Categories

(Core :: JavaScript Engine, defect)

x86_64
macOS
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox51 --- unaffected
firefox52 --- unaffected
firefox53 --- fixed
firefox54 --- fixed

People

(Reporter: gkw, Assigned: arai)

References

Details

(Keywords: assertion, bugmon, testcase, Whiteboard: [jsbugmon:update])

Crash Data

Attachments

(2 files)

The following testcase crashes on mozilla-central revision d5343b0f7e6a (build with --enable-debug --enable-more-deterministic, run with --fuzzing-safe --no-threads --no-baseline --no-ion): (function () { for (var x in [0]) { try {} finally { return 0; } } })(); Backtrace: 0 js-dbg-64-dm-clang-darwin-d5343b0f7e6a 0x000000010fbbe87f Interpret(JSContext*, js::RunState&) + 27823 (Value.h:642) 1 js-dbg-64-dm-clang-darwin-d5343b0f7e6a 0x000000010fbb79a2 js::RunScript(JSContext*, js::RunState&) + 482 (Interpreter.cpp:406) 2 js-dbg-64-dm-clang-darwin-d5343b0f7e6a 0x000000010fbc95de js::ExecuteKernel(JSContext*, JS::Handle<JSScript*>, JSObject&, JS::Value const&, js::AbstractFramePtr, JS::Value*) + 942 (Interpreter.cpp:687) 3 js-dbg-64-dm-clang-darwin-d5343b0f7e6a 0x000000010fbc9937 js::Execute(JSContext*, JS::Handle<JSScript*>, JSObject&, JS::Value*) + 439 (RootingAPI.h:795) /snip For detailed crash information, see attachment.
Due to skipped revisions, the first bad revision could be any of: changeset: https://hg.mozilla.org/mozilla-central/rev/757b50c0ee48 user: Shu-yu Guo date: Sat Jan 14 14:51:38 2017 -0800 summary: Bug 1147371 - Implement IteratorClose for for-of. (r=arai) changeset: https://hg.mozilla.org/mozilla-central/rev/8ad6c93e5162 user: Shu-yu Guo date: Sat Jan 14 14:51:38 2017 -0800 summary: Bug 1147371 - Rename allowContentSpread to allowContentIter. (r=arai) changeset: https://hg.mozilla.org/mozilla-central/rev/d7d332a5b2e8 user: Shu-yu Guo date: Sat Jan 14 14:51:38 2017 -0800 summary: Bug 1147371 - Convert self-hosted code that need to call IteratorClose to use for-of. (r=arai) changeset: https://hg.mozilla.org/mozilla-central/rev/ce293b3c0a8b user: Shu-yu Guo date: Sat Jan 14 14:51:38 2017 -0800 summary: Bug 1147371 - Implement IteratorClose for array destructuring. (r=arai) changeset: https://hg.mozilla.org/mozilla-central/rev/e0dc4150f8ac user: Shu-yu Guo date: Sat Jan 14 14:51:39 2017 -0800 summary: Bug 1147371 - Implement calling IteratorClose and "return" on iterators in yield*. (r=jandem) Shu-yu, is bug 1147371 a likely regressor?
Blocks: 1147371
Flags: needinfo?(shu)
We also see crashes [@ js::CloseIterator] which reduce to this testcase variant.
Crash Signature: [@ js::CloseIterator]
Summary: Assertion failure: isObject(), at /Users/skywalker/shell-cache/js-dbg-64-dm-clang-darwin-d5343b0f7e6a/objdir-js/dist/include/js/Value.h:642 → Crash [@ js::CloseIterator] or Assertion failure: isObject(), at /Users/skywalker/shell-cache/js-dbg-64-dm-clang-darwin-d5343b0f7e6a/objdir-js/dist/include/js/Value.h:642
Summary: Crash [@ js::CloseIterator] or Assertion failure: isObject(), at /Users/skywalker/shell-cache/js-dbg-64-dm-clang-darwin-d5343b0f7e6a/objdir-js/dist/include/js/Value.h:642 → Crash [@ js::CloseIterator] or Assertion failure: isObject(), at dist/include/js/Value.h:642
overlooked that npops should be resolved before handling other stack values. added flushPops for StatementKind::ForOfLoop and StatementKind::ForInLoop cases in NonLocalExitControl::prepareForNonLocalJump.
Assignee: nobody → arai.unmht
Status: NEW → ASSIGNED
Attachment #8830203 - Flags: review?(shu)
maybe we could do some more cleanup to merge those JSOP_POPs. with dedicated emitPopn method that receives the number of values to pop, and emit better opcode sequence for the number. (it becomes more change so might be better doing in separated bug, to make it easier to uplift this)
Comment on attachment 8830203 [details] [diff] [review] Handle stack value in correct order when leaving loop and try-finally. Review of attachment 8830203 [details] [diff] [review]: ----------------------------------------------------------------- Doh, thank you very much for taking the bug and fixing it, arai.
Attachment #8830203 - Flags: review?(shu) → review+
Flags: needinfo?(shu)
https://hg.mozilla.org/integration/mozilla-inbound/rev/ad0c4806133ae96c62f4ecc47229d19887934b70 Bug 1332881 - Handle stack value in correct order when leaving loop and try-finally. r=shu
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
Comment on attachment 8830203 [details] [diff] [review] Handle stack value in correct order when leaving loop and try-finally. Approval Request Comment > [Feature/Bug causing the regression] bug 1147371 > [User impact if declined] possible crash by executing JavaScript > [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?] less risky > [Why is the change risky/not risky?] this patch changes the target stack offset of operations. the testcase confirms the offset is correct in most case. even if this patch is still wrong in some corner case, it won't cause any issue worse than unpatched, that tries to dereference random value. > [String changes made/needed] none
Attachment #8830203 - Flags: approval-mozilla-aurora?
Comment on attachment 8830203 [details] [diff] [review] Handle stack value in correct order when leaving loop and try-finally. Sounds like a regression in 53, let's take this crash fix for aurora.
Attachment #8830203 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
See Also: → 1334799
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: