Skip to content

android app crashes with a Fatal signal (SIGSEGV) #445

@yahya-valus

Description

@yahya-valus

Description

Hey everyone, following up on a specific crash pattern with @reactvision/react-viro on Android. The app crashes with a Fatal signal 11 (SIGSEGV) specifically when the AR camera is active and the app is moved to the background for an extended period (approximately 5+ minutes). The crash will only happen when the 3dModel in ARScene is rendered from a url.

The Stack Trace

#00 pc 00000000004ef650 ... libviro_renderer.so (VROPlatformRunTask)
#01 pc 00000000003a5f60 ... libviro_renderer.so (VROPlatformRunTask(int)+428)

Environment

  1. Development OS: macOS
  2. Device OS & Version: Android 15 & 16
  3. Version: @reactvision/react-viro 2.52.1, React Native 0.81.5
  4. Device(s): Samsung and Pixel devices

Current (failing) Attempt

I am currently using AppState to conditionally hide/unmount ViroARSceneNavigator when the app goes inactive/background.

However, it seems that the native cleanup is not deep enough to survive a long background stay, and the renderer still attempts to access a stale GL context on resume.

Questions

  1. Is there a way to completely deallocate the Viro native bridge when the app hits the background, rather than simply unmounting the component?
  2. Has anyone successfully handled onPause/onResume at the native Android level to prevent the renderer from accessing a reclaimed OpenGL context?
  3. Is there a recommended lifecycle handling pattern for long background AR sessions?

Reproducible Demo

  1. Launch the app and navigate to a screen with ViroARSceneNavigator active.
  2. Keep the AR camera running.
  3. Move the app to the background.
  4. Wait approximately 5+ minutes.
  5. Resume the app.
  6. Observe crash with Fatal signal 11 (SIGSEGV) in libviro_renderer.so.

The issue is consistently reproducible under these conditions.

Here is the link for my repo as well: https://github.com/yahyafahim/Viro-AR

Metadata

Metadata

Assignees

No one assigned

    Labels

    to be releasedIt's fixed/done and coming in a next update

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions