Add enableSchedulerDelegateInvalidation feature flag (#56678)#56678
Closed
fkgozali wants to merge 1 commit intofacebook:mainfrom
Closed
Add enableSchedulerDelegateInvalidation feature flag (#56678)#56678fkgozali wants to merge 1 commit intofacebook:mainfrom
fkgozali wants to merge 1 commit intofacebook:mainfrom
Conversation
|
@fkgozali has exported this pull request. If you are a Meta employee, you can view the originating Diff in D103757271. |
710a630 to
63569f7
Compare
Summary: Introduces a new common React Native feature flag, `enableSchedulerDelegateInvalidation`, that gates a defensive guard around `Scheduler::uiManagerDidDispatchCommand` and `uiManagerDidFinishTransaction`. Those call sites enqueue a lambda via `runtimeScheduler_->scheduleRenderingUpdate` that captures the raw `SchedulerDelegate` pointer by value. With `RuntimeScheduler_Modern` (bridgeless) the lambda runs asynchronously, so if the `SchedulerDelegate` is destroyed between enqueue and execution the lambda dereferences dangling memory and the process crashes (`EXC_BAD_ACCESS` / `KERN_INVALID_ADDRESS`). The follow-up commit adds the actual guard wired to this flag. Defaults to `false` so behavior is unchanged on landing. Apps opt in by overriding the flag in their own `ReactNativeFeatureFlagsDefaults` subclass. Includes the regenerated feature-flag boilerplate (Kotlin/Java/Cxx accessors, defaults, providers, JS spec, native module) emitted by `yarn featureflags --update`. Changelog: [Internal] Reviewed By: shwanton Differential Revision: D103757271
63569f7 to
c5565e7
Compare
|
This pull request has been merged in d0672fb. |
Collaborator
|
This pull request was successfully merged by @fkgozali in d0672fb When will my fix make it into a release? | How to file a pick request? |
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.
Summary:
Introduces a new common React Native feature flag,
enableSchedulerDelegateInvalidation, that gates a defensive guard aroundScheduler::uiManagerDidDispatchCommandanduiManagerDidFinishTransaction. Those call sites enqueue a lambda viaruntimeScheduler_->scheduleRenderingUpdatethat captures the rawSchedulerDelegatepointer by value. WithRuntimeScheduler_Modern(bridgeless) the lambda runs asynchronously, so if theSchedulerDelegateis destroyed between enqueue and execution the lambda dereferences dangling memory and the process crashes (EXC_BAD_ACCESS/KERN_INVALID_ADDRESS). The follow-up commit adds the actual guard wired to this flag.Defaults to
falseso behavior is unchanged on landing. Apps opt in by overriding the flag in their ownReactNativeFeatureFlagsDefaultssubclass.Includes the regenerated feature-flag boilerplate (Kotlin/Java/Cxx accessors, defaults, providers, JS spec, native module) emitted by
yarn featureflags --update.Changelog:
[Internal]
Reviewed By: shwanton
Differential Revision: D103757271