Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
node-api: force env shutdown deferring behavior#37303
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
node-api: force env shutdown deferring behavior #37303
Uh oh!
There was an error while loading. Please reload this page.
Conversation
53f6c32 to cd3e2d1CompareRaisinTen commented Feb 10, 2021
I think we should add this in the commit message too: |
gabrielschulhof commented Feb 10, 2021
@RaisinTen I'm not 100% sure that the crash is the same. In
|
gabrielschulhof commented Feb 10, 2021
@RaisinTen it sounds like @mhdawson tried to reproduce #36868 and was unable to do so. Therefore I think we should close #36868 unless the test in question remains flaky. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot commented Feb 11, 2021
mhdawson left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
nodejs-github-bot commented Feb 12, 2021
nodejs-github-bot commented Feb 12, 2021
nodejs-github-bot commented Feb 13, 2021
nodejs-github-bot commented Feb 13, 2021 • edited by gabrielschulhof
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by gabrielschulhof
Uh oh!
There was an error while loading. Please reload this page.
mhdawson commented Feb 16, 2021
@gabrielschulhof I think @legendecas may be away for a few days and I'm thinking it might still be good to wait for him to have a look as well. What do you think? |
gabrielschulhof commented Feb 17, 2021
@mhdawson OK. |
legendecas commented Feb 18, 2021
@gabrielschulhof PR wise looks good to me. However, I may have been mistaken on the test case of #37236 (comment). I've tried the PR on my internal case and it does crash regardlessly. |
gabrielschulhof commented Feb 18, 2021
@legendecas if it still crashes, can you create a test case we can use here? You can even push it to my branch. |
The finalizer normally never gets called while a reference is strong. However, during environment shutdown all finalizers must get called. In order to unify the deferring behavior with that of a regular finalization, we must force the reference to be weak when we call its finalizer during environment shutdown. Fixes: nodejs#37236 Co-authored-by: Chengzhong Wu <[email protected]>
6415c99 to 21e5b1dComparegabrielschulhof commented Feb 18, 2021
Rebased. |
gabrielschulhof commented Feb 18, 2021
@legendecas P.S.: your original repro (https://github.com/legendecas/repro-napi-v8impl-refbase-double-free) no longer crashes with this PR. |
legendecas left a comment • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gabrielschulhof it's true. This PR does fix a crash case. I'll try to dig out the stable re-production on the one with weak references.
nodejs-github-bot commented Feb 18, 2021
nodejs-github-bot commented Feb 18, 2021
The finalizer normally never gets called while a reference is strong. However, during environment shutdown all finalizers must get called. In order to unify the deferring behavior with that of a regular finalization, we must force the reference to be weak when we call its finalizer during environment shutdown. Fixes: #37236 Co-authored-by: Chengzhong Wu <[email protected]> PR-URL: #37303 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
gabrielschulhof commented Feb 19, 2021
Landed in 03806a0. |
The finalizer normally never gets called while a reference is strong. However, during environment shutdown all finalizers must get called. In order to unify the deferring behavior with that of a regular finalization, we must force the reference to be weak when we call its finalizer during environment shutdown. Fixes: #37236 Co-authored-by: Chengzhong Wu <[email protected]> PR-URL: #37303 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
The finalizer normally never gets called while a reference is strong. However, during environment shutdown all finalizers must get called. In order to unify the deferring behavior with that of a regular finalization, we must force the reference to be weak when we call its finalizer during environment shutdown. Fixes: nodejs#37236 Co-authored-by: Chengzhong Wu <[email protected]> PR-URL: nodejs#37303 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
The finalizer normally never gets called while a reference is strong. However, during environment shutdown all finalizers must get called. In order to unify the deferring behavior with that of a regular finalization, we must force the reference to be weak when we call its finalizer during environment shutdown. Fixes: nodejs#37236 Co-authored-by: Chengzhong Wu <[email protected]> PR-URL: nodejs#37303 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
The finalizer normally never gets called while a reference is strong. However, during environment shutdown all finalizers must get called. In order to unify the deferring behavior with that of a regular finalization, we must force the reference to be weak when we call its finalizer during environment shutdown. Fixes: nodejs#37236 Co-authored-by: Chengzhong Wu <[email protected]> PR-URL: nodejs#37303 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
The finalizer normally never gets called while a reference is strong. However, during environment shutdown all finalizers must get called. In order to unify the deferring behavior with that of a regular finalization, we must force the reference to be weak when we call its finalizer during environment shutdown. Fixes: nodejs#37236 Co-authored-by: Chengzhong Wu <[email protected]> PR-URL: nodejs#37303 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
The finalizer normally never gets called while a reference is strong. However, during environment shutdown all finalizers must get called. In order to unify the deferring behavior with that of a regular finalization, we must force the reference to be weak when we call its finalizer during environment shutdown. Fixes: nodejs#37236 Co-authored-by: Chengzhong Wu <[email protected]> PR-URL: nodejs#37303 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
The finalizer normally never gets called while a reference is strong. However, during environment shutdown all finalizers must get called. In order to unify the deferring behavior with that of a regular finalization, we must force the reference to be weak when we call its finalizer during environment shutdown. Fixes: #37236 Co-authored-by: Chengzhong Wu <[email protected]> PR-URL: #37303 Backport-PR-URL: #37802 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
The finalizer normally never gets called while a reference is strong. However, during environment shutdown all finalizers must get called. In order to unify the deferring behavior with that of a regular finalization, we must force the reference to be weak when we call its finalizer during environment shutdown. Fixes: nodejs#37236 Co-authored-by: Chengzhong Wu <[email protected]> PR-URL: nodejs#37303 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
The finalizer normally never gets called while a reference is strong. However, during environment shutdown all finalizers must get called. In order to unify the deferring behavior with that of a regular finalization, we must force the reference to be weak when we call its finalizer during environment shutdown. Fixes: #37236 Co-authored-by: Chengzhong Wu <[email protected]> PR-URL: #37303 Backport-PR-URL: #42512 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
The finalizer normally never gets called while a reference is strong.
However, during environment shutdown all finalizers must get called. In
order to unify the deferring behavior with that of a regular
finalization, we must force the reference to be weak when we call its
finalizer during environment shutdown.
Fixes: #37236
Co-authored-by: @legendecas