Skip to content

Use weak ptr for runtime shadow node reference#45463

Closed
lenaic wants to merge 1 commit into
facebook:mainfrom
lenaic:export-D59804999
Closed

Use weak ptr for runtime shadow node reference#45463
lenaic wants to merge 1 commit into
facebook:mainfrom
lenaic:export-D59804999

Conversation

@lenaic
Copy link
Copy Markdown

@lenaic lenaic commented Jul 16, 2024

Summary:
Changelog: [Internal]

State updates will clone shadow nodes for an shadow tree revision that is outdated.

This can lead to accessing deallocated shadow node references because the JS renderer committed a newer revision and deallocated the one used by the pending state update.

By using a weak pointer to hold a reference to the runtime shadow node reference, we can only update references for wrappers that are still valid.

Differential Revision: D59804999

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Jul 16, 2024
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D59804999

@analysis-bot
Copy link
Copy Markdown

analysis-bot commented Jul 16, 2024

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 21,451,131 +28
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 24,647,374 +42
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 5bb57eb
Branch: main

Summary:
Pull Request resolved: facebook#45463

Changelog: [Internal]

State updates will clone shadow nodes for an shadow tree revision that is outdated.

This can lead to accessing deallocated shadow node references because the JS renderer committed a newer revision and deallocated the one used by the pending state update.

By using a weak pointer to hold a reference to the runtime shadow node reference, we can only update references for wrappers that are still valid.

Differential Revision: D59804999
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D59804999

@lenaic lenaic force-pushed the export-D59804999 branch from 6dfc30d to 4528295 Compare July 16, 2024 13:54
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jul 16, 2024
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in c0b288c.

@github-actions
Copy link
Copy Markdown

This pull request was successfully merged by Nick Lefever in c0b288c

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants