mozilla / positron

a experimental, Electron-compatible runtime on top of Gecko
Other
561 stars 64 forks source link

MOZ_CRASH(Accessing the Subject Principal without an AutoJSAPI on the stack is forbidden) at /Users/myk/Projects/positron/dom/base/nsContentUtils.cpp:2760 #144

Closed mykmelez closed 7 years ago

mykmelez commented 7 years ago

After building debug (with #143 applied, although I'm not sure that matters) on Mac, running the sample browser hits MOZ_CRASH(Accessing the Subject Principal without an AutoJSAPI on the stack is forbidden) at /Users/myk/Projects/positron/dom/base/nsContentUtils.cpp:2760:

./mach run ~/Projects/electron-sample-apps/webview/browser/ … Hit MOZ_CRASH(Accessing the Subject Principal without an AutoJSAPI on the stack is forbidden) at /Users/myk/Projects/positron/dom/base/nsContentUtils.cpp:2760

01: nsContentUtils::SubjectPrincipal()[/Users/myk/Projects/positron/obj-x86_64-apple-darwin15.6.0-debug/dist/PositronDebug.app/Contents/MacOS/XUL +0x228af76]

02: nsContentUtils::IsCallerChrome()[/Users/myk/Projects/positron/obj-x86_64-apple-darwin15.6.0-debug/dist/PositronDebug.app/Contents/MacOS/XUL +0x228ad61]

03: XPCJSContext::InterruptCallback(JSContext*)[/Users/myk/Projects/positron/obj-x86_64-apple-darwin15.6.0-debug/dist/PositronDebug.app/Contents/MacOS/XUL +0x1554070]

04: InvokeInterruptCallback(JSContext*)[/Users/myk/Projects/positron/obj-x86_64-apple-darwin15.6.0-debug/dist/PositronDebug.app/Contents/MacOS/XUL +0x7c4f4f5]

05: JSRuntime::handleInterrupt(JSContext*)[/Users/myk/Projects/positron/obj-x86_64-apple-darwin15.6.0-debug/dist/PositronDebug.app/Contents/MacOS/XUL +0x7c4f336]

06: js::jit::CheckOverRecursedWithExtra(JSContext, js::jit::BaselineFrame, unsigned int, unsigned int)[/Users/myk/Projects/positron/obj-x86_64-apple-darwin15.6.0-debug/dist/PositronDebug.app/Contents/MacOS/XUL +0x7797160]

mykmelez commented 7 years ago

This doesn't happen in debug builds on Linux.

mykmelez commented 7 years ago

I just tested again a few times on Mac (using hello-world-server), and I could only reproduce the first time, right after I'd built. Subsequent runs didn't exhibit the problem.

brendandahl commented 7 years ago

I'm able to reproduce by introducing a some long running script main.js.

e.g.

function go() {
    var sum = 0;
    for (var i = 0; i < 100000; i++) {
        sum += i / 2;
    }
    console.log(sum);
    setTimeout(go, 500);
}
go();