Closed Bug 1492574 Opened 6 years ago Closed 6 years ago

Assertion failure: !cx->isExceptionPending() with OOM and GetDynamicName

Categories

(Core :: JavaScript Engine: JIT, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: iain, Assigned: iain)

Details

Attachments

(4 files)

GetDynamicName calls AtomizeString, which may return nullptr in case of OOM, but does not clear pending exceptions. This leaks the exception flag, which triggers assertion failures in subsequent VM calls with AutoAssertNoPendingException guards.

The following testcase crashes:

function foo() {}
function foooooooooooooooooooooooooooooooo() {}
function fn(s) {
    var o = {a:1};
    eval(("f" + s) + "()");
     if (!("a" in o)) {
        print("unreachable");
     }
}
for (var i = 0; i < 1100; i++) {
    with ({}) {}
    fn("oo");
}
oomTest(new Function(`
fn(newRope("oooooooooooooooo", "oooooooooooooooo"));
`));
Assignee: nobody → iireland
Comment on attachment 9010686 [details]
Bug 1492574 - Avoid leaking OOM exception flag from GetDynamicName r?tcampbell

Ted Campbell [:tcampbell] has approved the revision.
Attachment #9010686 - Flags: review+
Comment on attachment 9010686 [details]
Bug 1492574 - Avoid leaking OOM exception flag from GetDynamicName r?tcampbell

Ted Campbell [:tcampbell] has requested changes to the revision.
Attachment #9010686 - Flags: review+
Comment on attachment 9012695 [details]
Bug 1492574: Remove unnecessary MutableHandle r?tcampbell

Ted Campbell [:tcampbell] (PTO until Oct 9) has approved the revision.
Attachment #9012695 - Flags: review+
Comment on attachment 9012693 [details]
Bug 1492574: Fix OOM handling in NewRope testing function r?tcampbell

Ted Campbell [:tcampbell] (PTO until Oct 9) has approved the revision.
Attachment #9012693 - Flags: review+
Comment on attachment 9012694 [details]
Bug 1492574: Rewrite GetDynamicName to return false if lookup can't be completed r?tcampbell

Ted Campbell [:tcampbell] (PTO until Oct 9) has approved the revision.
Attachment #9012694 - Flags: review+
Comment on attachment 9010686 [details]
Bug 1492574 - Avoid leaking OOM exception flag from GetDynamicName r?tcampbell

Ted Campbell [:tcampbell] (PTO until Oct 9) has approved the revision.
Attachment #9010686 - Flags: review+
Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/23bab6bcd81c
Avoid leaking OOM exception flag from GetDynamicName r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/414785cda258
Fix OOM handling in NewRope testing function r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/dfdc496fab45
Rewrite GetDynamicName to return false if lookup can't be completed r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/5109c878f7e2
Remove unnecessary MutableHandle r=tcampbell
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: