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

src: fix crash on FSReqPromise destructor #43533

Merged
merged 1 commit into from
Jul 9, 2022

Commits on Jun 22, 2022

  1. src: fix crash on FSReqPromise destructor

    We are deciding whether to end `fs` promises by checking
    `can_call_into_js()` whereas in the `FSReqPromise` destructor we're
    using the `is_stopping()` check. Though this may look as semantically
    correct it has issues because though both values are modified before
    termination on `Environment::ExitEnv()` and both are atomic they are not
    syncronized together so it may happen that when reaching the destructor
    `call_into_js` may be set to `false` whereas `is_stopping` remains
    `false` causing the crash. Fix this by checking with
    `can_call_into_js()` also in the destructor.
    
    Fixes: nodejs#43499
    santigimeno committed Jun 22, 2022
    Configuration menu
    Copy the full SHA
    8310739 View commit details
    Browse the repository at this point in the history