Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ReportFatalException1 #6624

Open
bird8693 opened this issue Mar 16, 2021 · 2 comments
Open

ReportFatalException1 #6624

bird8693 opened this issue Mar 16, 2021 · 2 comments

Comments

@bird8693
Copy link

Enviroment

ubuntu18

poc

function AsmModule(stdlib) {
    'use asm';
    var m1 = stdlib.fround;
    function f1() {
        var x = m1(1.5);
        var y = 1;
        y = ~~~~x;
        return ~~~x;
    }   
    return f1; 
}
var global = { Math: Math };
var asmModule = AsmModule(global);
AsmModule(268435456);
print(asmModule());
print(asmModule());

callstack

[#0] 0x555555d59fac → DebugBreak()
[#1] 0x555555d59fac → ReportFatalException(context=<optimized out>, exceptionCode=<optimized out>, reasonCode=<optimized out>, scenario=<optimized out>)
[#2] 0x555555d5a3a7 → OutOfMemory_unrecoverable_error()
[#3] 0x555557ef6673 → Js::Exception::RaiseIfScriptActive(scriptContext=0x0, kind=0x0, returnAddress=0x0)
[#4] 0x555555d5a929 → Js::Throw::OutOfMemory()
[#5] 0x5555565a9a01 → Js::InterpreterStackFrame::ProcessLinkFailedAsmJsModule(this=<optimized out>)
[#6] 0x5555565a7d18 → Js::InterpreterStackFrame::ProcessAsmJsModule(this=<optimized out>)
[#7] 0x5555565685b9 → Js::InterpreterStackFrame::Process(this=<optimized out>)

@bird8693 bird8693 changed the title Cannot access memory at address 0x0 ReportFatalException1 Mar 16, 2021
@rhuanjl
Copy link
Collaborator

rhuanjl commented Mar 17, 2021

This case and several others like it are because CC aborts if an ASMModule is called with invalid params AFTER previously being called with valid params, looking at it I cannot see why this would be done except perhaps for testing purposes?

@pleath do you know why this was done? (it's from the initial commit)

@rhuanjl
Copy link
Collaborator

rhuanjl commented Mar 19, 2021

This is by design BUT I do wonder if it is a bad design choice AND it is not per-spec, per-spec when an ASM module is called in a non-conformant way it should behave like normal JS, not abort.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants