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

Assertion assert(p->ref_count > 0); in gc_decref_child is failing. #172

Closed
anuragvohraec opened this issue Mar 27, 2023 · 2 comments
Closed

Comments

@anuragvohraec
Copy link

anuragvohraec commented Mar 27, 2023

Hi All,

I have created an app server based on quickjs. It works all fine with few users, but when I am load testing it with 1000s of request it fails due following assertion in quickjs source code (line 5680)

static void gc_decref_child(JSRuntime *rt, JSGCObjectHeader *p)
{
    assert(p->ref_count > 0); //fails here
}

How to debug such code, are there any advice to deal with such issues ?

@anuragvohraec
Copy link
Author

upon further inspection I found that that this varibale p is the global object of context.

void JS_AddIntrinsicBaseObjects(JSContext *ctx)
{
    ctx->global_obj = JS_NewObject(ctx); //created here
}

Ref count for global object is reduced to zero!

@anuragvohraec
Copy link
Author

Ok Fixed it, my code is releasing global object twice in a loop.

GerHobbelt pushed a commit to GerHobbelt/quickjs that referenced this issue Jun 21, 2024
…llard#172)

Bumps [undici](https://github.com/nodejs/undici) from 5.28.3 to 5.28.4.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](nodejs/undici@v5.28.3...v5.28.4)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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

1 participant