chakra-core / ChakraCore

ChakraCore is an open source Javascript engine with a C API.
MIT License
9.13k stars 1.2k forks source link

Assertion Failure in ChakraCore/lib/Runtime/./Types/RecyclableObject.h, VarIs<T>(aValue) #6962

Open anbu1024 opened 11 months ago

anbu1024 commented 11 months ago

ChakraCore version: commit c3ead3f

Build cmd:

./build.sh --debug --static

Test case:

function test(){

    async function foo(x) {
        const F = Float32Array;
        const S = Set;
        const A = Array;
        const R = Reflect;
        const O = Object;
        const isF = isFinite;
        const P = Proxy;
        const Sym = Symbol;
        const Boo = Boolean;
        const JS = JSON;
        const ev = eval;

        for (let i = 536870912; i < x; i = i ** x) {
            const f = await foo;
            const s = i.splice();
        }

        async function bart() {
            const w = new WeakMap();
            const s = w.set();
        }
        const ret = bart();
    }

    const r = foo();
    return r;
}

for(let i=0; i<1024; i++)
{
    test();
}

Execute

./ch ./test.js

Error msg:

ASSERTION 2785381: (ChakraCore/lib/Runtime/./Types/RecyclableObject.h, line 527) VarIs<T>(aValue)
 Failure: (VarIs<T>(aValue))
Illegal instruction
ppenzin commented 3 months ago

I can't reproduce it on the master following the exact steps provided.