Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Garbage collection error when trying to dispose of date in array #41

Open
AashJ opened this issue Aug 6, 2024 · 1 comment
Open

Garbage collection error when trying to dispose of date in array #41

AashJ opened this issue Aug 6, 2024 · 1 comment

Comments

@AashJ
Copy link

AashJ commented Aug 6, 2024

  test.only("Date in array", async () => {
    const ctx = (await getQuickJS()).newContext();
    const arena = new Arena(ctx, { isMarshalable: true });
    const scope = { results: [new Date(2022, 7, 26)] };
    arena.expose(scope);

    const evalResult = arena.evalCode("results[0]");
    console.log(evalResult);
    expect(evalResult).instanceOf(Date);

    arena.dispose();
    ctx.dispose();
  });

When running this test, an error is thrown:

RuntimeError: Aborted(Assertion failed: list_empty(&rt->gc_obj_list), at: quickjs/quickjs.c,1983,JS_FreeRuntime). Build with -s ASSERTIONS=1 for more info.

My best guess is the quickjs handle isn't being properly disposed of, but i'm not 100% sure. Working on a PR, but thought I'd flag here incase anyone had ideas.

@dangchinh25
Copy link

dangchinh25 commented Aug 22, 2024

Having the same issue with doing something like evalCode('{t: new Date()}'), my guess is that this lib is not properly handling disposal of Date value nested inside an Object somewhere 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants