iOS Simulator: SIGSEGV in -[RiveFactory decodeImage:] when a RiveView with referenced image assets mounts again after the last RiveView unmounted

Aperta
#449 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
43/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
ios, typescript
Ambito
mobile

Direzione di ricerca

Start by tracing RiveReactNativeView.processAssetBytes, RiveFactory.decodeImage:, and RenderContextManager to understand how render contexts are retained across view unmounts. Reproduce the issue with the reported two-asset mount and unmount sequence in the iOS Simulator. Done when repeated remounts no longer crash while processing referenced image assets.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Versions: rive-react-native 9.8.6 (RiveRuntime 6.24.0), React Native 0.87, iOS Simulator on an Apple-silicon Mac. Not reproduced on a physical iPhone.

What happens: the app crashes natively (SIGSEGV) in -[RiveFactory decodeImage:], called from RiveReactNativeView.processAssetBytes, when a RiveView that supplies images through referencedAssets mounts again after every RiveView had been unmounted. The first mount always works.

Steps

  1. Render a RiveView for a .riv with two referenced image assets, supplied as URLs via referencedAssets.
  2. Unmount it so no RiveView is alive.
  3. Mount a new RiveView for the same file and assets.
  4. The app crashes while the asset bytes are processed. Intermittent: 4 of 5 automated runs.

What we think happens: RenderContextManager keeps its render contexts weakly ("when no more RiveRenderViews require these, they can be freed"), and RiveFactory holds a raw rive::Factory*. After the last view unmounts the context is freed, and decoding assets for the new view dereferences it.

Tried: decoding on the main thread (same crash, now on the main thread); dropping stale loads with a generation token (still crashes); holding a RiveFile reference (not reliable). RenderContextManager.shared().newDefaultContext() isn't callable from Swift because RenderContext is only forward-declared.

Lingua principale
TypeScript
Stelle
789
Fork
81
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rive-app/rive-react-native

Tutte le issue di rive-app/rive-react-native

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.