Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal signal 11 crash on Android 7.0 #1453

Closed
curtismartintransloc opened this issue Dec 4, 2019 · 27 comments
Closed

Fatal signal 11 crash on Android 7.0 #1453

curtismartintransloc opened this issue Dec 4, 2019 · 27 comments

Comments

@curtismartintransloc
Copy link

curtismartintransloc commented Dec 4, 2019

This has been happening for a little while for us apparently, but we don't get crash logs reported from it since the crash seems to be occurring in native code. It happens on the latest version of Lottie (3.3.0) and previous ones.

We have an an animation that causes our app to crash whenever we play it forward or backward. It only crashes on devices running 7.0 (pre-7.0 and post-7.0, including 7.x.x are fine). Here's what I'm seeing in the Logcat:

A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x4 in tid 7235 (RenderThread)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 3801, tid: 4185, name: RenderThread  >>> com.transloc.microtransit.dev.debug <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4
    r0 8ed30730  r1 00000000  r2 00000044  r3 af30a4b1
    r4 8e82b478  r5 8e82b478  r6 00000000  r7 849e4680
    r8 8e82b278  r9 00000001  sl 8597bf00  fp 8e82b1c0
    ip af369628  sp 8e82b110  lr af31a759  pc af34e29a  cpsr a00f0030
backtrace:
    #00 pc 0006329a  /system/lib/libhwui.so
    #01 pc 0006299b  /system/lib/libhwui.so
    #02 pc 000625d5  /system/lib/libhwui.so
    #03 pc 00023e5f  /system/lib/libhwui.so
    #04 pc 000258b3  /system/lib/libhwui.so
    #05 pc 00028d51  /system/lib/libhwui.so (_ZN7android10uirenderer12renderthread12RenderThread10threadLoopEv+80)
    #06 pc 0000e3e5  /system/lib/libutils.so (_ZN7android6Thread11_threadLoopEPv+140)
    #07 pc 00068a15  /system/lib/libandroid_runtime.so (_ZN7android14AndroidRuntime15javaThreadShellEPv+80)
    #08 pc 000474e3  /system/lib/libc.so (_ZL15__pthread_startPv+22)
    #09 pc 00019dcd  /system/lib/libc.so (__start_thread+6)

I've reproduced the issue by starting a new empty project that only has a LottieAnimationView.

Here's the layout:

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <com.airbnb.lottie.LottieAnimationView
        android:id="@+id/pin_button"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:layout_gravity="center"
        app:lottie_fileName="pinning_animation.json" />

</FrameLayout>

And here's the Activity:

package com.transloc.lottietest

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.airbnb.lottie.LottieAnimationView
import com.airbnb.lottie.RenderMode

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val pinButton = findViewById<LottieAnimationView>(R.id.pin_button)

        pinButton.setOnClickListener {
            pinButton.resumeAnimation()
        }
    }
}

The animation will play briefly, then the app will freeze momentarily, and then it will crash. I've found that setting the render mode to SOFTWARE will work around the issue.

@gpeal
Copy link
Collaborator

gpeal commented Dec 5, 2019

@curtismartintransloc Does this happen on all devices?

@curtismartintransloc
Copy link
Author

We've seen it happen on the two devices we have in house running 7.0, a Nexus 6 and an LG Aristo.

@disparate
Copy link

disparate commented Dec 12, 2019

Hello, maybe it can help, got same exception for the following lottie
3d_0146.zip.
Devices are Samsungs s8 and j7 (both android 7.0)
Reproduced on hardware layer type only.

@gpeal
Copy link
Collaborator

gpeal commented Dec 16, 2019

@disparate Are you sure your S8 is on 7.0? Did you flash it back to that/never upgrade it?

@frogsm
Copy link

frogsm commented Dec 20, 2019

It also happen to in Samsung S7(android 7.0)

I updated Lottie 2.7.0 to 3.1.0.
It was fine in 2.7.0 but it happened after updating.

It is the same as the latest version of 3.3.0.

@gpeal
Copy link
Collaborator

gpeal commented Dec 20, 2019

@frogsm Can you try using software rendering? Part of the upgrade set the render mode to AUTO and it went from software to hardware rendering.

@disparate
Copy link

disparate commented Dec 20, 2019

@disparate Are you sure your S8 is on 7.0? Did you flash it back to that/never upgrade it?

@gpeal Yes, I checked it. Happens only on 7.0 definitely. Never upgraded.

@pranishres
Copy link

Has this issue been resolved? I am also facing crash issue in Android 7.0 devices. All devices.

@disparate
Copy link

Has this issue been resolved? I am also facing crash issue in Android 7.0 devices. All devices.

@pranishres
The workaround that you can proceed with if you want to use that lottie, is forcing SOFTWARE rendering on that lottie for android 7.0.

@Ovadia-B
Copy link

Any updates on that?
Still happens with version 3.4.0 and software rendering.

@pranishres
Copy link

Has this issue been resolved? I am also facing crash issue in Android 7.0 devices. All devices.

@pranishres
The workaround that you can proceed with if you want to use that lottie, is forcing SOFTWARE rendering on that lottie for android 7.0.

I removed hardware acceleration configuration from manifest. What hardware acceleration does is to smoothen the graphics rendering process. After disabling it, my lottie were little slower but it solved the crash issue

@Mihir3646
Copy link

Mihir3646 commented May 11, 2020

I am also facing the same issue in all 7.0 version devices. Any solution? Using lottie:3.4.0 version.

@pranishres
Copy link

I am also facing the same issue in all 7.0 version devices. Any solution? Using lottie:3.4.0 version.

I removed hardware acceleration configuration from manifest. What hardware acceleration does is to smoothen the graphics rendering process. After disabling it, my lottie were little slower but it solved the crash issue

@Mihir3646
Copy link

Mihir3646 commented May 11, 2020

I am also facing the same issue in all 7.0 version devices. Any solution? Using lottie:3.4.0 version.

I removed hardware acceleration configuration from manifest. What hardware acceleration does is to smoothen the graphics rendering process. After disabling it, my lottie were little slower but it solved the crash issue

In Manifest file it is already false android:hardwareAccelerated="false"

Also programmatically when needed I put below code to enable it, still crashing in 7.0

if (Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.N_MR1) {
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, 
                         WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
}

@gpeal
Copy link
Collaborator

gpeal commented May 14, 2020

@Mihir3646 No need to do that at a global level. You can tell Lottie to render with software with setRenderMode

@Mihir3646
Copy link

@Mihir3646 No need to do that at a global level. You can tell Lottie to render with software with setRenderMode

@gpeal Thank you, let me try with your mention solution. If working fine I will update here.

@kenMarquez
Copy link

kenMarquez commented May 21, 2020

@gpeal I had this problem in React Native, but this property is not actually exposed from the native side, I made an RP to expose this property, I tried it and it works 🎉

lottie-react-native/lottie-react-native#654

@Mihir3646
Copy link

@Mihir3646 No need to do that at a global level. You can tell Lottie to render with software with setRenderMode

Still Happening

full stacktrace

#00 pc 0000000000065b7a /system/lib/libhwui.so
#1 pc 000000000006514d /system/lib/libhwui.so
#2 pc 0000000000064cdb /system/lib/libhwui.so
#3 pc 00000000000245fd /system/lib/libhwui.so
#4 pc 00000000000262d1 /system/lib/libhwui.so
#5 pc 000000000002a969 /system/lib/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+80)
#6 pc 000000000000e349 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+140)
#7 pc 00000000000678b7 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+102)
#8 pc 0000000000048293 /system/lib/libc.so (__pthread_start(void*)+22)
#9 pc 0000000000019cfd /system/lib/libc.so (__start_thread+6)

@oritgurel
Copy link
Contributor

oritgurel commented Aug 20, 2020 via email

@OritYokee
Copy link
Contributor

@gpeal is there a planned release/release date for the next Lottie version?

@jdvp
Copy link

jdvp commented Sep 9, 2020

This appears to be released in v3.4.2, can anyone verify the fix and close this ticket if it is working?

@gpeal
Copy link
Collaborator

gpeal commented Oct 2, 2020

3.4.2 just changed the default but setting render mode to software has always been an option. I'm going to close this and using software rendering for problematic devices or sticking to the new default which is software for 7.0 is the recommended path forward.

@gpeal gpeal closed this as completed Oct 2, 2020
@serhiipalash
Copy link

or sticking to the new default which is software for 7.0 is the recommended path forward.

Hi @gpeal ! Did you mean that if we don't change the render mode manually in the code and just update to 3.4.2 it will solve the crashes on Android 7.0?

@gpeal
Copy link
Collaborator

gpeal commented Mar 10, 2021

@serhiipalash You should change RenderMode to Software for 7.0 on that animation

@serhiipalash
Copy link

@gpeal but we don't know what exact animation crashes the app. We have a few of them on different screens.

@MrHaddis
Copy link

MrHaddis commented Apr 3, 2023

Hi@gpeal I use lottie 6.0.0,and setSoftMode RenderMode.SOFTWARE.In android 6.0 device have same problem。
Fatal signal 11 (SIGSEGV), code 1, fault addr 0x5c in tid 11244 (RenderThread)

@MrHaddis
Copy link

MrHaddis commented Apr 3, 2023

@gpeal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests