Repository navigation
src: avoid using v8 on Isolate termination - #44669
Conversation
There was a problem hiding this comment.
| if (isolate_->IsExecutionTerminating()) | |
| if (is_stopping()) |
?
There was a problem hiding this comment.
I already tried that approach but it made a number of tests not to exit because, I think, they need that some immediates that don't call into JS to run before exiting (also, apparently calling TerminateExecution() doesn't make an immediate call to IsExecutionTerminating() to return true, it may take a while before it does).
There was a problem hiding this comment.
Well yeah, looking at this code, it seems like this isn’t the right place to just return; without calling the remaining callbacks. Some of them perform cleanup operations that shouldn’t be skipped, it’s rather up to the callbacks to ensure that they don’t call into JS.
There was a problem hiding this comment.
Can you leave a comment here about why this is necessary? I’d definitely like to avoid a change like this, esp. considering that this method should never attempt to call into JS anyway, so if it’s about signaling something specific to callers then it’s probably worth thinking about whether there’s another way of doing this. (If it’s about the HandleScope then I’d suggest to conditionally omit that scope, but that seems like it would cause trouble for us in other places as well.)
There was a problem hiding this comment.
Yes, it was because of the HandleScope and I agree this is not the place to make this change. I'm trying another approach in the next patch.
6eacee5 to
7f571ba
Compare
commented
Sep 19, 2022
|
@addaleax I updated the code. Could you PTAL? Thanks! |
commented
Sep 20, 2022
|
Is this something that we can land on |
commented
Sep 20, 2022
commented
Sep 20, 2022
|
Debug build is green 🎉 |
e5ed81c to
9b39fbd
Compare
commented
Sep 20, 2022
I don't think there's a reason this can't land on |
commented
Sep 20, 2022
|
Ok, then would you like to retarget this to |
Fix multiple instances of those uncovered while running the tests on debug builds. Fixes: nodejs/node-v8#227
9b39fbd to
965bcb8
Compare
commented
Sep 20, 2022
|
@targos done |
commented
Sep 21, 2022
|
@nodejs/cpp-reviewers |
commented
Sep 21, 2022
commented
Sep 21, 2022
|
Landed in d2cf01d |
commented
Jun 26, 2023
|
I think this may be causing access to uninitialized memory because this code may run during construction of |
Fixes: nodejs/node-v8#227