[v18.x] src: per-realm binding data#47174
Closed
legendecas wants to merge 1 commit intonodejs:v18.x-stagingfrom
Closed
[v18.x] src: per-realm binding data#47174legendecas wants to merge 1 commit intonodejs:v18.x-stagingfrom
legendecas wants to merge 1 commit intonodejs:v18.x-stagingfrom
Conversation
Collaborator
|
Review requested:
|
Collaborator
anonrig
approved these changes
Apr 2, 2023
Contributor
|
@legendecas are you able to restart the ASan test to confirm it passes before landing in v18? Thanks! |
Binding data is inherited from BaseObject and created in a specific realm. They need to be tracked on a per-realm basis so that they can be released properly when a realm is disposed. PR-URL: nodejs#46556 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> # Conflicts: # src/dataqueue/queue.cc
4740107 to
125af5c
Compare
Member
Author
|
Seems like I can not restart the ASan action either. I've rebased the branch on the tip of v18.x-staging. |
Collaborator
Contributor
|
Landed in 0b92035 |
danielleadams
pushed a commit
that referenced
this pull request
May 29, 2023
Binding data is inherited from BaseObject and created in a specific realm. They need to be tracked on a per-realm basis so that they can be released properly when a realm is disposed. PR-URL: #46556 Backport-PR-URL: #47174 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> # Conflicts: # src/dataqueue/queue.cc
hybrist
reviewed
Jul 16, 2023
| context->SetAlignedPointerInEmbedderData( | ||
| ContextEmbedderIndex::kBindingListIndex, &(this->bindings_)); | ||
| ContextEmbedderIndex::kBindingDataStoreIndex, | ||
| realm->binding_data_store()); |
Contributor
There was a problem hiding this comment.
This function is called from node_contextify.cc like this:
env->AssignToContext(v8_context, nullptr, info);This appears to get an invalid value in that flow. What's the expected behavior? Should the embedder data be nullptr when realm is nullptr?
Contributor
There was a problem hiding this comment.
I haven't fully looked into how this slot is used but I suspect the fix is:
// Used to retrieve bindings
context->SetAlignedPointerInEmbedderData(
ContextEmbedderIndex::kBindingDataStoreIndex,
realm != nullptr ? realm->binding_data_store() : nullptr);
aduh95
pushed a commit
to aduh95/node
that referenced
this pull request
Feb 18, 2025
Binding data is inherited from BaseObject and created in a specific realm. They need to be tracked on a per-realm basis so that they can be released properly when a realm is disposed. PR-URL: nodejs#46556 Backport-PR-URL: nodejs#47174 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> # Conflicts: # src/dataqueue/queue.cc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Binding data is inherited from BaseObject and created in a specific realm. They need to be tracked on a per-realm basis so that they can be released properly when a realm is disposed.
PR-URL: #46556
Reviewed-By: Joyee Cheung joyeec9h3@gmail.com
Reviewed-By: Colin Ihrig cjihrig@gmail.com
Reviewed-By: Matteo Collina matteo.collina@gmail.com