Closed Bug 1499010 Opened 6 years ago Closed 6 years ago

Assertion failure: !JS_IsExceptionPending(cx_), at js/src/vm/JSContext.cpp:1687

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox-esr60 --- unaffected
firefox62 --- unaffected
firefox63 --- unaffected
firefox64 --- fixed

People

(Reporter: gkw, Assigned: iain)

References

Details

(4 keywords, Whiteboard: [jsbugmon:])

Attachments

(4 files)

The following testcase crashes on mozilla-central revision 6e0139775220 (build with --enable-debug, run with --fuzzing-safe --ion-eager --cache-ir-stubs=off):

function testMathyFunction(f, inputs) {
    for (var j = 0; j < 29; ++j) {
        for (var k = 0; k < 29; ++k) {
            try {
                f(inputs[j], inputs[k]);
            } catch (e) {}
        }
    }
}
mathy2 = function(x, y) {
    (Math.pow(y, y))(h || (0, h.f));
}
testMathyFunction(mathy2, [
  1, Number.MIN_SAFE_INTEGER, -Number.A, -Number.R, 2, 2, 0xf, 0, 1, 0, 2, Math.PI, 2, 0xf,
  2, 0, 1, 0, 0, Number.MAX_VALUE, 0, 0, Number.MAX_SAFE_INTEGER, 1, 0, -Number.E, 0, 2, 0
]);

Backtrace:

#0  0x00005568631cc930 in js::AutoUnsafeCallWithABI::AutoUnsafeCallWithABI (this=0x7ffc79dfa5e8, strictness=js::NoExceptions) at js/src/vm/JSContext.cpp:1687
#1  0x0000556862a422aa in js::ecmaPow (x=-9007199254740991, y=-9007199254740991) at js/src/jsmath.cpp:575
#2  0x0000556862a29551 in PowOperation (cx=<optimized out>, lhs=..., rhs=..., res=...) at js/src/vm/Interpreter.cpp:1835
#3  js::PowValues (cx=<optimized out>, lhs=..., rhs=..., res=...) at js/src/vm/Interpreter.cpp:5221
#4  0x0000556862f2ce9a in js::jit::RPow::recover (this=<optimized out>, cx=0x7f04ad418000, iter=...) at js/src/jit/Recover.cpp:824
#5  0x0000556862dc774d in js::jit::SnapshotIterator::computeInstructionResults (this=<optimized out>, cx=0x7f04ad418000, results=0x7ffc79dfb8d0) at js/src/jit/JitFrames.cpp:2056
/snip

For detailed crash information, see attachment.

This reproduces about 80% of the time for me, so not setting to be monitored by JSBugMon.
autobisectjs shows this is probably related to the following changeset:

The first bad revision is:
changeset:   https://hg.mozilla.org/mozilla-central/rev/838b2692a934
user:        Iain Ireland
date:        Thu Oct 11 02:07:02 2018 +0000
summary:     Bug 1492977: Rework RAII exception guards r=tcampbell

Iain, is bug 1492977 a likely regressor?
Blocks: 1492977
Flags: needinfo?(iireland)
Yes, this is the same issue as bug 1498303 but with a different unmarked function as culprit. Patch coming shortly.
Flags: needinfo?(iireland)
Assignee: nobody → iireland
This one slipped through because RPow::recover calls ecmaPow through the interpreter (PowValues -> PowOperation -> ecmaPow), not directly. I did one last pass looking for other calls that might sneak through, but didn't find anything (other than RPowHalf, which also calls ecmaPow). Hopefully this is the last of these bugs.
Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ad329ec90b6e
Mark ecmaPow to allow calling from recovery code r=tcampbell
https://hg.mozilla.org/mozilla-central/rev/ad329ec90b6e
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Can we land the testcase?
Flags: needinfo?(iireland)
Yes.
Flags: needinfo?(iireland)
Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d4cbc3865457
Add testcase for AutoUnsafeCallWithABI recovery fuzz bugs r=tcampbell
Note: this testcase covers this bug, bug 1498303, and bug 1499471.
Flags: needinfo?(tcampbell)
Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2eb4c1dd70f1
Add fixed testcase for AutoUnsafeCallWithABI recovery fuzz bugs r=tcampbell
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: