Skip to content

Clear operationsInBatch_ before terminating UI runtime#6779

Merged
tomekzaw merged 2 commits intomainfrom
@tomekzaw/clear-operations-in-batch
Dec 3, 2024
Merged

Clear operationsInBatch_ before terminating UI runtime#6779
tomekzaw merged 2 commits intomainfrom
@tomekzaw/clear-operations-in-batch

Conversation

@tomekzaw
Copy link
Member

@tomekzaw tomekzaw commented Dec 2, 2024

Summary

This PR fixes the following crash that happens during a reload due to jsi::Value outliving the UI runtime.

The offending jsi::Value comes from operationsInBatch_ inside ReanimatedModuleProxy (formerly NativeReanimatedModule.

In ~ReanimatedModuleProxy we manually clear data structures containing jsi::Value prior to resetting uiWorkletRuntime_ which effectively terminates the runtimes. It looks like we forgot about operationsInBatch_.

Screenshot 2024-12-02 at 13 00 08

Test plan

  1. Launch FabricExample app
  2. Reload the app several times
  3. Repeat steps 1 and 2 several times

@tomekzaw tomekzaw added this pull request to the merge queue Dec 3, 2024
Merged via the queue into main with commit 4d8e98f Dec 3, 2024
@tomekzaw tomekzaw deleted the @tomekzaw/clear-operations-in-batch branch December 3, 2024 09:30
tomekzaw added a commit that referenced this pull request Dec 9, 2024
## Summary

This PR fixes the following crash that happens during a reload due to
`jsi::Value` outliving the UI runtime.

The offending `jsi::Value` comes from `operationsInBatch_` inside
`ReanimatedModuleProxy` (formerly `NativeReanimatedModule`.

In `~ReanimatedModuleProxy` we manually clear data structures containing
`jsi::Value` prior to resetting `uiWorkletRuntime_` which effectively
terminates the runtimes. It looks like we forgot about
`operationsInBatch_`.

<img width="1624" alt="Screenshot 2024-12-02 at 13 00 08"
src="https://github.com/user-attachments/assets/23c8df28-885e-45e7-b88c-779edc3c4fb5">

## Test plan

1. Launch FabricExample app
2. Reload the app several times
3. Repeat steps 1 and 2 several times
@tomekzaw tomekzaw mentioned this pull request Dec 9, 2024
tomekzaw added a commit that referenced this pull request Dec 9, 2024
## Summary

This PR fixes the following crash that happens during a reload due to
`jsi::Value` outliving the UI runtime.

The offending `jsi::Value` comes from `operationsInBatch_` inside
`ReanimatedModuleProxy` (formerly `NativeReanimatedModule`.

In `~ReanimatedModuleProxy` we manually clear data structures containing
`jsi::Value` prior to resetting `uiWorkletRuntime_` which effectively
terminates the runtimes. It looks like we forgot about
`operationsInBatch_`.

<img width="1624" alt="Screenshot 2024-12-02 at 13 00 08"
src="https://github.com/user-attachments/assets/23c8df28-885e-45e7-b88c-779edc3c4fb5">

## Test plan

1. Launch FabricExample app
2. Reload the app several times
3. Repeat steps 1 and 2 several times
tjzel pushed a commit that referenced this pull request Dec 13, 2024
## Summary

This PR fixes the following crash that happens during a reload due to
`jsi::Value` outliving the UI runtime.

The offending `jsi::Value` comes from `operationsInBatch_` inside
`ReanimatedModuleProxy` (formerly `NativeReanimatedModule`.

In `~ReanimatedModuleProxy` we manually clear data structures containing
`jsi::Value` prior to resetting `uiWorkletRuntime_` which effectively
terminates the runtimes. It looks like we forgot about
`operationsInBatch_`.

<img width="1624" alt="Screenshot 2024-12-02 at 13 00 08"
src="https://github.com/user-attachments/assets/23c8df28-885e-45e7-b88c-779edc3c4fb5">

## Test plan

1. Launch FabricExample app
2. Reload the app several times
3. Repeat steps 1 and 2 several times
tjzel pushed a commit that referenced this pull request Dec 13, 2024
## Summary

This PR fixes the following crash that happens during a reload due to
`jsi::Value` outliving the UI runtime.

The offending `jsi::Value` comes from `operationsInBatch_` inside
`ReanimatedModuleProxy` (formerly `NativeReanimatedModule`.

In `~ReanimatedModuleProxy` we manually clear data structures containing
`jsi::Value` prior to resetting `uiWorkletRuntime_` which effectively
terminates the runtimes. It looks like we forgot about
`operationsInBatch_`.

<img width="1624" alt="Screenshot 2024-12-02 at 13 00 08"
src="https://github.com/user-attachments/assets/23c8df28-885e-45e7-b88c-779edc3c4fb5">

## Test plan

1. Launch FabricExample app
2. Reload the app several times
3. Repeat steps 1 and 2 several times
tjzel pushed a commit that referenced this pull request Dec 13, 2024
## Summary

This PR fixes the following crash that happens during a reload due to
`jsi::Value` outliving the UI runtime.

The offending `jsi::Value` comes from `operationsInBatch_` inside
`ReanimatedModuleProxy` (formerly `NativeReanimatedModule`.

In `~ReanimatedModuleProxy` we manually clear data structures containing
`jsi::Value` prior to resetting `uiWorkletRuntime_` which effectively
terminates the runtimes. It looks like we forgot about
`operationsInBatch_`.

<img width="1624" alt="Screenshot 2024-12-02 at 13 00 08"
src="https://github.com/user-attachments/assets/23c8df28-885e-45e7-b88c-779edc3c4fb5">

## Test plan

1. Launch FabricExample app
2. Reload the app several times
3. Repeat steps 1 and 2 several times
r0h0gg6 pushed a commit to r0h0gg6/react-native-reanimated that referenced this pull request Jul 28, 2025
…nsion#6779)

## Summary

This PR fixes the following crash that happens during a reload due to
`jsi::Value` outliving the UI runtime.

The offending `jsi::Value` comes from `operationsInBatch_` inside
`ReanimatedModuleProxy` (formerly `NativeReanimatedModule`.

In `~ReanimatedModuleProxy` we manually clear data structures containing
`jsi::Value` prior to resetting `uiWorkletRuntime_` which effectively
terminates the runtimes. It looks like we forgot about
`operationsInBatch_`.

<img width="1624" alt="Screenshot 2024-12-02 at 13 00 08"
src="https://github.com/user-attachments/assets/23c8df28-885e-45e7-b88c-779edc3c4fb5">

## Test plan

1. Launch FabricExample app
2. Reload the app several times
3. Repeat steps 1 and 2 several times
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants