Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear operationsInBatch_ before terminating UI runtime #6779

Merged
merged 2 commits into from
Dec 3, 2024

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
17 checks passed
@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
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