Closed brianwernick closed 2 months ago
Hi @brianwernick thanks for the report!
Not necessarily repro steps, however we have the RiveAnimationView wrapped for Compose and it seems to be occurring when we transition from one "screen" (full screen Composable) to another where both have RiveAnimationViews that use the same rive animation asset.
I'd like to take a look at this setup, can you share a sample project with the transition you describe?
@umberto-sonnino I've setup a sample app that has a Composable named Issue324 which shows the setup for the screen and transitions. If you want to run this on a device you can swap out the SimpleExample()
call in the MainActivity
with Issue324()
@umberto-sonnino I've added a second Composable named Issue324V2 that includes updates based on our updated understanding of where the crash is coming from after one of our engineers encountered the issue at a different state in the screen transition. With this version we've been able to consistently reproduce the crash (takes up to a minute).
In our application when we transition these two screens, the first screen performs a size animation on the RiveAnimationView
which isn't ideal since changing the size of a Composable will trigger recomposition, however the AndroidView
wrapper is keeping the RiveAnimationView
around so I didn't worry about it too much and was planning on cleaning it up later. However, reviewing the tombstones above and others leads me to believe that the underlying surface texture used by the TextureView
is being replaced by a new one that's sized to the new view's size. With this happening at the screens refresh rate (e.g 60/90/120 times a second) means that we are likely hitting some boundary with memory, or timing.
This leads me to 2 conclusions:
RiveAnimationView
so that we aren't resizing the view as frequently (the animation runs for 250ms).TextureView
is creating a new surface each size update. It's been a while since I dug into the TextureView
surface buffer, maybe this issue is coming from the Skia/GLES handling used by Rive.Hey @brianwernick , thanks again to you and your team, this clearly repros with the repo you shared! I'm looking into a fix, we might be able to optimize a couple of things that should allow you to still use the resizing animation
I'm going to mark this as resolved (close) since 9.3.1
seems to resolve the crash that can be reproduced. Additionally we have updated our app to use a graphics layer scale for short-lived size changes which should also avoid the mass amount of resizes. @umberto-sonnino Thanks for jumping on this and getting a resolution out quickly
I'm going to mark this as resolved (close) since
9.3.1
seems to resolve the crash that can be reproduced. Additionally we have updated our app to use a graphics layer scale for short-lived size changes which should also avoid the mass amount of resizes. @umberto-sonnino Thanks for jumping on this and getting a resolution out quickly
Thank you @brianwernick and your team for providing us with a repro - that made everything easier!
We've continued to see this crash in rive-react-native 7.0.2 so I'm not sure this is completely fixed
Our Android app is throwing this error quite frequently with react-native-rive version 7.0.2.
[split_config.arm64_v8a.apk!librive-android.so] rive_android::EGLThreadState::createEGLSurface(ANativeWindow*)
Could you share a repro of this crash with one of your setups @evelant or @Waltari10? This should've been fixed in the latest Android version
Unfortunately we can't reproduce the crash locally. It seems to happen at random to users in production.
@umberto-sonnino This continues to happen with rive-react-native 7.0.4. Random crashes in production. Seems to be affecting a sizeable percentage of our users ☹️
OS Version: Android 11 (RPXS31.Q2-58-17-4-8)
Report Version: 104
Exception Type: Unknown (SIGABRT)
Application Specific Information:
Abort
Thread 0 Crashed:
0 libc.so 0x7ee169930c abort
1 libc.so 0x7ee16fc348 <unknown> + 544948077384
2 libc.so 0x7ee16fb944 <unknown> + 544948074820
3 libc.so 0x7ee16fb79c pthread_mutex_lock
4 libc++.so 0x7edf2df3a8 std::__1::mutex::lock
5 libc++.so 0x7edf2e017c std::__1::__shared_mutex_base::lock_shared
6 libgui.so 0x7ee29b940c android::Surface::hook_query
7 libEGL.so 0x7eddf5f7ac eglGetFrameTimestampSupportedANDROID
8 libEGL.so 0x7eddf5f71c eglGetFrameTimestampSupportedANDROID
9 split_config.arm64_v8a.apk 0x7bdf3040ac rive_android::EGLThreadState::createEGLSurface
10 split_config.arm64_v8a.apk 0x7bdf30be60 rive_android::SkiaWorkerImpl::SkiaWorkerImpl
11 split_config.arm64_v8a.apk 0x7bdf30b1f4 rive_android::WorkerImpl::Make
12 split_config.arm64_v8a.apk 0x7bdf30ae50 <unknown> + 532025486928
13 split_config.arm64_v8a.apk 0x7bdf3056b0 rive_android::WorkerThread::threadMain
14 split_config.arm64_v8a.apk 0x7bdf30548c <unknown> + 532025463948
15 libc.so 0x7ee16fac6c <unknown> + 544948071532
16 libc.so 0x7ee169b2c8 <unknown> + 544947679944
EOF
Unfortunately we can't reproduce the crash locally. It seems to happen at random to users in production.
Any particular way you're using Rive inside the app? Any chance it's being used inside a transition or something of the like? If you have something like that that you could share it could help us narrow things down
Our app doesn't use any transitions between native views. The only thing we do is show/hide (render or not render) regular react native views. The Rive animations we have live at the root component of the app so they never get destroyed/moved/whatever after the app boots. The .riv files can be found here:
https://ymugbdbublahxiheenub.supabase.co/storage/v1/object/public/test/confettithv4.riv https://ymugbdbublahxiheenub.supabase.co/storage/v1/object/public/test/taskherofabv5.riv
One possible thing of note -- we use react-native-skia in our app. I'd assume that's a completely separate skia instance from the one inside Rive but I thought it worth mentioning in case some sort of conflict is possible.
Description
In our production app we are seeing reports in the Google Play Console and Sentry (3rd party reporting tool) that the app is crashing frequently due to seg faults that are traced back to Rive. Specifically the common source function call is
rive_android::EGLThreadState::createEGLSurface
Trace 1
Trace 2
Provide a Repro
Not necessarily repro steps, however we have the
RiveAnimationView
wrapped for Compose and it seems to be occurring when we transition from one "screen" (full screen Composable) to another where both haveRiveAnimationView
s that use the same rive animation asset.Expected behavior
The
RiveAnimationView
doesn't cause a seg fault / crashDevice & Versions (please complete the following information)
9.2.2
(an app update with9.3.0
will also be rolling out soon to see if that helps)Pixel 7
,Redmi Note 8 Pro
,Galaxy A12
])31
,32
,33
,34
])Additional context
RiveAnimationView
that's wrapped by anAndroidView
for Compose interopSkia
renderer