rive-android icon indicating copy to clipboard operation
rive-android copied to clipboard

v10.4.4 - Crash on Mali GPUs

Open NicolasDucom opened this issue 1 year ago • 9 comments

Description

When using the Rive Renderer, we're noticing a high number of crashes on Mali powered Android TVs

Stack Trace

pid: 0, tid: 21852 >>> com.recisio.kfandroid <<<

backtrace:
  #00  pc 0x00000000000ffc72  /data/app/~~r7xHJgwc5qYQvmk8vpMk6w==/com.recisio.kfandroid-kmFQNeUHPNTYYKnlSKZVIA==/split_config.armeabi_v7a.apk!librive-android.so (Java_app_rive_runtime_kotlin_renderers_Renderer_constructor+54) (BuildId: d9d971be760fa817afcb8f0818cf7cef9ebddcb7)
  #01  pc 0x0000000000100863  /data/app/~~r7xHJgwc5qYQvmk8vpMk6w==/com.recisio.kfandroid-kmFQNeUHPNTYYKnlSKZVIA==/oat/arm/base.odex (art_jni_trampoline+82)
  #02  pc 0x00000000000d39d5  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub_internal+68)
  #03  pc 0x00000000004f73b9  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub+280)
  #04  pc 0x000000000012bbf7  /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+142)
  #05  pc 0x00000000002400c7  /apex/com.android.art/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+250)
  #06  pc 0x00000000002385cb  /apex/com.android.art/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+750)
  #07  pc 0x00000000004eaca5  /apex/com.android.art/lib/libart.so (MterpInvokeDirect+512)
  #08  pc 0x00000000000ce514  /apex/com.android.art/lib/libart.so (mterp_op_invoke_direct+20)
  #09  pc 0x0000000000428880  /data/app/~~r7xHJgwc5qYQvmk8vpMk6w==/com.recisio.kfandroid-kmFQNeUHPNTYYKnlSKZVIA==/base.apk (app.rive.runtime.kotlin.renderers.Renderer.make+28)
  #10  pc 0x00000000004e8d1b  /apex/com.android.art/lib/libart.so (MterpInvokeVirtual+1290)
  #11  pc 0x00000000000ce414  /apex/com.android.art/lib/libart.so (mterp_op_invoke_virtual+20)
  #12  pc 0x0000000000419de4  /data/app/~~r7xHJgwc5qYQvmk8vpMk6w==/com.recisio.kfandroid-kmFQNeUHPNTYYKnlSKZVIA==/base.apk (app.rive.runtime.kotlin.RiveTextureView.onAttachedToWindow+28)
  #13  pc 0x00000000004e98d9  /apex/com.android.art/lib/libart.so (MterpInvokeSuper+2012)
  #14  pc 0x00000000000ce494  /apex/com.android.art/lib/libart.so (mterp_op_invoke_super+20)
  #15  pc 0x0000000000418a24  /data/app/~~r7xHJgwc5qYQvmk8vpMk6w==/com.recisio.kfandroid-kmFQNeUHPNTYYKnlSKZVIA==/base.apk (app.rive.runtime.kotlin.RiveAnimationView.onAttachedToWindow+22683648)
  #16  pc 0x000000000023137f  /apex/com.android.art/lib/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.8690765502787650888)+250)
  #17  pc 0x0000000000237d33  /apex/com.android.art/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+114)
  #18  pc 0x00000000004da1c1  /apex/com.android.art/lib/libart.so (artQuickToInterpreterBridge+684)
  #19  pc 0x00000000000d8561  /apex/com.android.art/lib/libart.so (art_quick_to_interpreter_bridge+32)
  #20  pc 0x00000000007afd4d  /system/framework/arm/boot-framework.oat (android.view.View.dispatchAttachedToWindow+388)
  #21  pc 0x00000000008526f5  /system/framework/arm/boot-framework.oat (android.view.ViewGroup.dispatchAttachedToWindow+204)
  #22  pc 0x00000000008526f5  /system/framework/arm/boot-framework.oat (android.view.ViewGroup.dispatchAttachedToWindow+204)
  #23  pc 0x00000000008526f5  /system/framework/arm/boot-framework.oat (android.view.ViewGroup.dispatchAttachedToWindow+204)
  #24  pc 0x00000000008526f5  /system/framework/arm/boot-framework.oat (android.view.ViewGroup.dispatchAttachedToWindow+204)
  #25  pc 0x00000000008526f5  /system/framework/arm/boot-framework.oat (android.view.ViewGroup.dispatchAttachedToWindow+204)
  #26  pc 0x00000000008526f5  /system/framework/arm/boot-framework.oat (android.view.ViewGroup.dispatchAttachedToWindow+204)
  #27  pc 0x00000000008526f5  /system/framework/arm/boot-framework.oat (android.view.ViewGroup.dispatchAttachedToWindow+204)
  #28  pc 0x00000000008526f5  /system/framework/arm/boot-framework.oat (android.view.ViewGroup.dispatchAttachedToWindow+204)
  #29  pc 0x00000000008526f5  /system/framework/arm/boot-framework.oat (android.view.ViewGroup.dispatchAttachedToWindow+204)
  #30  pc 0x00000000007d8e4d  /system/framework/arm/boot-framework.oat (android.view.ViewRootImpl.performTraversals+884)
  #31  pc 0x00000000007ddff7  /system/framework/arm/boot-framework.oat (android.view.ViewRootImpl.doTraversal+158)
  #32  pc 0x00000000003ed64d  /system/framework/arm/boot-framework.oat (android.content.ContextWrapper.getAssets [DEDUPED]+52)
  #33  pc 0x00000000006cdd4d  /system/framework/arm/boot-framework.oat (android.view.Choreographer.doCallbacks+716)
  #34  pc 0x00000000006ce3fb  /system/framework/arm/boot-framework.oat (android.view.Choreographer.doFrame+1178)
  #35  pc 0x000000000078a85b  /system/framework/arm/boot-framework.oat (android.view.Choreographer$FrameDisplayEventReceiver.run+66)
  #36  pc 0x0000000000561591  /system/framework/arm/boot-framework.oat (android.os.Handler.dispatchMessage+64)
  #37  pc 0x000000000056406f  /system/framework/arm/boot-framework.oat (android.os.Looper.loop+1542)
  #38  pc 0x000000000039bec1  /system/framework/arm/boot-framework.oat (android.app.ActivityThread.main+752)
  #39  pc 0x00000000000d39d5  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub_internal+68)
  #40  pc 0x00000000004f74e9  /apex/com.android.art/lib/libart.so (art_quick_invoke_static_stub+276)
  #41  pc 0x000000000012bc09  /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+160)
  #42  pc 0x0000000000403fbd  /apex/com.android.art/lib/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned int)+820)
  #43  pc 0x00000000003a3857  /apex/com.android.art/lib/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+30)
  #44  pc 0x0000000000083637  /apex/com.android.art/javalib/arm/boot.oat (art_jni_trampoline+110)
  #45  pc 0x0000000000746629  /system/framework/arm/boot-framework.oat (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+112)
  #46  pc 0x000000000074d8f9  /system/framework/arm/boot-framework.oat (com.android.internal.os.ZygoteInit.main+1872)
  #47  pc 0x00000000000d39d5  /apex/com.android.art/lib/libart.so (art_quick_invoke_stub_internal+68)
  #48  pc 0x00000000004f74e9  /apex/com.android.art/lib/libart.so (art_quick_invoke_static_stub+276)
  #49  pc 0x000000000012bc09  /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+160)
  #50  pc 0x0000000000403171  /apex/com.android.art/lib/libart.so (art::JValue art::InvokeWithVarArgs<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, std::__va_list)+348)
  #51  pc 0x0000000000403423  /apex/com.android.art/lib/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+42)
  #52  pc 0x0000000000329c3b  /apex/com.android.art/lib/libart.so (art::JNI<true>::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+530)
  #53  pc 0x000000000006690d  /system/lib/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+28)
  #54  pc 0x000000000006c593  /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+514)
  #55  pc 0x0000000000002e3d  /system/bin/app_process32 (main+992)
  #56  pc 0x000000000005cec3  /apex/com.android.runtime/lib/bionic/libc.so (__libc_init+66)

Device & Versions (please complete the following information)

Seems to be centered around : ARM Mali 470 devices, armeabi-v7a ABI Xiaomi MiBox 4 for example

NicolasDucom avatar Sep 26 '25 09:09 NicolasDucom

Hi @NicolasDucom. Is that the entire stack trace?

Tod-Rive avatar Oct 01 '25 17:10 Tod-Rive

@Tod-Rive it's all we're getting from crash reports, I might be able to get my hands on one of those devices I'll see if I can get something more complete.

NicolasDucom avatar Oct 01 '25 18:10 NicolasDucom

That would be very helpful. Let me know.

Tod-Rive avatar Oct 01 '25 19:10 Tod-Rive

Hey @Tod-Rive , got my hands on a device, here's a more complete stack trace, I'm available if you need help testing

crash.txt

NicolasDucom avatar Oct 09 '25 08:10 NicolasDucom

From the crash log it looks like this is a null pointer exception in the Java_app_rive_runtime_kotlin_renderers_Renderer_constructor. From a cursory scan of the code, it's not obvious where that might be.

signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4
Cause: null pointer dereference

We may need to acquire a MiBox 4 or equivalent to diagnose further. @NicolasDucom, can you confirm that that is the device you used to reproduce?

ErikUggeldahl avatar Nov 14 '25 17:11 ErikUggeldahl

@ErikUggeldahl the MiBox 4 was the most represented one on our crash reporter, we reproduced the issue on a Xiaomi Mi TV Stick (not entirely clear if there are multiple generations of this device, I can give you more detailed specs if needed)

NicolasDucom avatar Nov 14 '25 17:11 NicolasDucom

Perfect, thanks @NicolasDucom. This would be a good device to add to our device lab as an older Android 9 device with, in the stick's case, a Mali 450 GPU. I'll put in an order for one and see if I can't reproduce.

ErikUggeldahl avatar Nov 14 '25 17:11 ErikUggeldahl

Hey,

We recently started using Rive on the Home Screen in our Chess.com Android app, and unfortunately this became our Top 1 crash (and it's Top 1 by one order of magnitude - we have thousands of them reported every day).

Device vendors are:

Image

Android versions are:

Image

henieek avatar Dec 08 '25 12:12 henieek

I threw Claude at this much like I did for fixing the audio issue (PR 428), and it seems to believe that the crash is being caused by the fact that the RefWorker::RiveWorker function when s_isSupported != RiveRecndererSupport::yes that we just hit this line and never actually set s_riveWorker before returning it which is ultimately what ends up causing the null pointer dereference, which was guarded in CurrentOrFallback but that was removed in commit f5e10d3b

nshurtz avatar Dec 10 '25 16:12 nshurtz