rive-app / rive-android

A runtime for interactive animations on Android
https://rive.app
MIT License
332 stars 30 forks source link

Rive crashes when RiveAnimationView leaves the screen #313

Open anemchinova opened 5 months ago

anemchinova commented 5 months ago

Description

We're running Android 12 on NVIDIA Jetson TX2 NX, and we get Rive crashing in the following scenario:

  1. Add a Rive animation on screen
  2. Remove the animation from the screen

We're using Compose, so in our case the crash happens when the Composable leaves the Composition. I was also able to repro by finishing the Activity, or by removing the Fragment from a fragment manager. Setting the view's visibility to GONE doesn't seem to crash, though.

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'NVIDIA/lanai/lanai:11/RQ1A.210105.003/7825230_3167.5736:user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2024-01-17 08:38:35.441944096+0000
Process uptime: 0s
Cmdline: app.rive.runtime.example
pid: 8059, tid: 8090, name: Thread-2  >>> app.rive.runtime.example <<<
uid: 10055
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1290
    x0  0000002fa8346cf0  x1  00000030583b3f90  x2  0000000000000002  x3  0000000000000000
    x4  0000000000000020  x5  0000002ee832dc40  x6  0000eba80000eb80  x7  0000eb980000eb1c
    x8  0000000000000002  x9  000000000004ac90  x10 0000000000000001  x11 0000000000000030
    x12 0000000000000014  x13 0000eb880000ebb8  x14 000998aa40000000  x15 0000125e70000000
    x16 00000031189abd50  x17 0000002e4b0e18e8  x18 000000310c27a000  x19 00000030583b3f90
    x20 0000000000000000  x21 0000000000000002  x22 00000030583b4b70  x23 00000030583b428c
    x24 000000311e1e1a18  x25 000000311e1dea50  x26 0000000000008cd5  x27 000000311e1dea70
    x28 000000310b34b000  x29 000000310b443b40
    lr  000000311d3b9bb4  sp  000000310b443860  pc  000000311d85721c  pst 0000000000000000

backtrace:
      #00 pc 000000000103d21c  /vendor/lib64/libglcore.so (__glNVDestroyMsTransientBuffer+92) (BuildId: 4bf52c50245e2d5a9ab9f153e0b88bde)
      #01 pc 0000000000b9fbb0  /vendor/lib64/libglcore.so (__glDisposeFramebuffer(__GLcontextRec*, void*)+320) (BuildId: 4bf52c50245e2d5a9ab9f153e0b88bde)
      #02 pc 0000000000bd4390  /vendor/lib64/libglcore.so (freeTree(__GLcontextRec*, __GLnamesArrayRec*, __GLnamesBranchRec*, int)+208) (BuildId: 4bf52c50245e2d5a9ab9f153e0b88bde)
      #03 pc 0000000000bd42a0  /vendor/lib64/libglcore.so (__glNamesFreeArray+144) (BuildId: 4bf52c50245e2d5a9ab9f153e0b88bde)
      #04 pc 0000000000b9fa28  /vendor/lib64/libglcore.so (__glFreeFramebufferState(__GLcontextRec*)+264) (BuildId: 4bf52c50245e2d5a9ab9f153e0b88bde)
      #05 pc 0000000000b8998c  /vendor/lib64/libglcore.so (__glDestroyContext(__GLcontextRec*)+636) (BuildId: 4bf52c50245e2d5a9ab9f153e0b88bde)
      #06 pc 00000000010207dc  /vendor/lib64/libglcore.so (nvDestroyContext(__GLinterfaceRec*)+220) (BuildId: 4bf52c50245e2d5a9ab9f153e0b88bde)
      #07 pc 0000000000f5d864  /vendor/lib64/libglcore.so (NvGlEglContextDestroy+404) (BuildId: 4bf52c50245e2d5a9ab9f153e0b88bde)
      #08 pc 0000000000042fe0  /vendor/lib64/egl/libEGL_tegra.so (NvEglContext::~NvEglContext()+64) (BuildId: 02cc1a8bcae7b8a07c7fe36d79428f0c)
      #09 pc 00000000000430c8  /vendor/lib64/egl/libEGL_tegra.so (NvEglContext::~NvEglContext()+8) (BuildId: 02cc1a8bcae7b8a07c7fe36d79428f0c)
      #10 pc 000000000004444c  /vendor/lib64/egl/libEGL_tegra.so (NvEglIntDestroyContext(NvEglThread*, void*, void*)+444) (BuildId: 02cc1a8bcae7b8a07c7fe36d79428f0c)
      #11 pc 00000000000478d0  /vendor/lib64/egl/libEGL_tegra.so (NvEglPTDestroyContext(void*, void*)+144) (BuildId: 02cc1a8bcae7b8a07c7fe36d79428f0c)
      #12 pc 000000000001c03c  /system/lib64/libEGL.so (android::eglDestroyContextImpl(void*, void*)+64) (BuildId: 7d828050f1e1c4ae57f7feef44138852)
      #13 pc 000000000019aa14  /data/app/~~UIlfL4m4LbRyLaBHeD6ijg==/app.rive.runtime.example-qc_uxIBSfEowxiQnOzNBgw==/lib/arm64/librive-android.so (rive_android::EGLThreadState::~EGLThreadState()+44) (BuildId: 2bc1355cd8e2390945728260c2324277882f8317)
      #14 pc 000000000019ade8  /data/app/~~UIlfL4m4LbRyLaBHeD6ijg==/app.rive.runtime.example-qc_uxIBSfEowxiQnOzNBgw==/lib/arm64/librive-android.so (rive_android::SkiaThreadState::~SkiaThreadState()+148) (BuildId: 2bc1355cd8e2390945728260c2324277882f8317)
      #15 pc 000000000019c0d0  /data/app/~~UIlfL4m4LbRyLaBHeD6ijg==/app.rive.runtime.example-qc_uxIBSfEowxiQnOzNBgw==/lib/arm64/librive-android.so (rive_android::WorkerThread::threadMain()+608) (BuildId: 2bc1355cd8e2390945728260c2324277882f8317)
      #16 pc 000000000019be38  /data/app/~~UIlfL4m4LbRyLaBHeD6ijg==/app.rive.runtime.example-qc_uxIBSfEowxiQnOzNBgw==/lib/arm64/librive-android.so (BuildId: 2bc1355cd8e2390945728260c2324277882f8317)
      #17 pc 00000000000b1810  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+264) (BuildId: 6bfaf10f10e5ff343703efae2f1bdbdb)
      #18 pc 00000000000512f0  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 6bfaf10f10e5ff343703efae2f1bdbdb)

Provide a Repro

This is reproducible with Rive samples.

  1. Launch Rive samples app
  2. Tap any item
  3. Navigate back

Expected behavior

No crash.

Device & Versions

Additional context

We have two Rive animations and only one of them is causing the crash. Although, it reproduces consistently with all animations from Rive samples app.