GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||
GeezerVison is showing github.com — n-api: back up env before async work finalize by gabrielschulhof · Pull Request #21129 · nodejs/node Conversation
Contributor
We must back up the value of Fixes: #20966 Checklist
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
Considering this fixes a regression, I'd say a test should be added. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@MayhemYDG the problem is it's a memory corruption regression, so a 100% reliable test is hard to create. After all, when c072057 introduced the regression, the async work test which we already have should have segfaulted but didn't. My only thought with the above comment was to add a second test which essentially runs the first test over and over and over, because that's what I used for reproducing. But you're right - I think I'll add a test like the one in the gist, with, say, 500 iterations. Hopefully in that many iterations it will crash if we ever again have such a bug. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
18a98d9 to
2853b40
Compare
|
Well, the test I added crashes before the fix and passes after the fix, so FWIW, it captures the fix. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
2853b40 to
a3b4c9e
Compare
|
Another CI: https://ci.nodejs.org/job/node-test-pull-request/15268/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
We must back up the value of `_env` before calling the async work complete callback, because the complete callback may delete the instance in which `_env` is stored by calling `napi_delete_async_work`, and because we need to use it after the complete callback has completed. Fixes: nodejs#20966
a3b4c9e to
c7b1950
Compare
There was an error while loading. Please reload this page.
|
sigh ... forgot to set the name of the async context - weird that it did not throw in debug mode O_o Here's another CI: https://ci.nodejs.org/job/node-test-pull-request/15273/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@gabrielschulhof |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'm +1 to land this after only 40h so it make it into 10.4.0, since the most significant stakeholders are aware of this. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@refack OK, landing it then. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
We must back up the value of `_env` before calling the async work complete callback, because the complete callback may delete the instance in which `_env` is stored by calling `napi_delete_async_work`, and because we need to use it after the complete callback has completed. Fixes: #20966 PR-URL: #21129 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
|
landed in 991f406 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
We must back up the value of `_env` before calling the async work complete callback, because the complete callback may delete the instance in which `_env` is stored by calling `napi_delete_async_work`, and because we need to use it after the complete callback has completed. Fixes: #20966 PR-URL: #21129 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
|
Should this be backported to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@MylesBorins this actually fixes a regression introduced by c072057, so, unless we backport that commit too, we need not backport this commit. As it stands, it doesn't look like that commit was backported to v8.x. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
We must back up the value of `_env` before calling the async work complete callback, because the complete callback may delete the instance in which `_env` is stored by calling `napi_delete_async_work`, and because we need to use it after the complete callback has completed. Fixes: nodejs/node#20966 PR-URL: nodejs/node#21129 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
n-api: regression with napi_delete_async_work since v10.2.0
There was an error while loading. Please reload this page.