Conversation
If created platform with CreatePlatform, the crash occurs because it does not check if it was initialized to v8_platform when DisposePlatform was called.
0641ee3 to
4058d53
Compare
| } | ||
|
|
||
| inline void Dispose() { | ||
| if(!initialize_) |
There was a problem hiding this comment.
Disposing without initializing first sounds like a buggy use case to me. Why do we return instead of aborting here?
There was a problem hiding this comment.
Line 958 in bd6d651
Here is the part that calls DisposePlatform globally.
If created through CreatePlatform then v8_platform is not initialized.
So should be ignored instead of Aborting.
There was a problem hiding this comment.
In that case I think the state should be maintained in the caller instead of in the callee..
There was a problem hiding this comment.
DrainTasks now run after RunAtExit has run.
Is this order of execution important?
If order is not important, I think can Dispose with AtExit.
|
@nodejs/v8 |
|
@Trott Fwiw, the embedders team is probably a better target for pings, if you want to notify somebody – I don’t quite know why the bot tagged this with V8, it’s not directly related. @jc-lab Thanks for bringing this up – I feel like the issue is a bit larger; in particular, currently we always initialize/tear down the platform in |
| }; | ||
|
|
||
| struct V8Platform { | ||
| bool initialize_; |
There was a problem hiding this comment.
@jc-lab Can you call this initialized_ and use a default initializer instead of adding a constructor? i.e.
| bool initialize_; | |
| bool initialized_ = false; |
| } | ||
|
|
||
| inline void Dispose() { | ||
| if(!initialize_) |
There was a problem hiding this comment.
| if(!initialize_) | |
| if (!initialized_) |
The bot tags on the names of the files changed. In this case it matched the following regular expression: |
|
@nodejs/embedders |
|
I’ve included this in #30467, along with a fixup commit for the comments above. |
If created platform with CreatePlatform, the crash occurs because it does not check if it was initialized to v8_platform when DisposePlatform was called. Refs: nodejs#31260
If created platform with CreatePlatform, the crash occurs because it does not check if it was initialized to v8_platform when DisposePlatform was called. Refs: #31260 Co-authored-by: Anna Henningsen <anna@addaleax.net> PR-URL: #30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
If created platform with CreatePlatform, the crash occurs because it does not check if it was initialized to v8_platform when DisposePlatform was called. Refs: nodejs#31260 Co-authored-by: Anna Henningsen <anna@addaleax.net> PR-URL: nodejs#30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
If created platform with CreatePlatform, the crash occurs because it does not check if it was initialized to v8_platform when DisposePlatform was called. Backport-PR-URL: #35241 Refs: #31260 Co-authored-by: Anna Henningsen <anna@addaleax.net> PR-URL: #30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
If created platform with CreatePlatform, the crash occurs because it does not check if it was initialized to v8_platform when DisposePlatform was called.
node/src/env.cc
Line 958 in bd6d651
node/src/node_v8_platform-inl.h
Lines 176 to 178 in bd6d651