flipper: Android App crash - React Native Flipper

🐛 Bug Report

Following the React Native guide in the repo, Main Activity invokes the ReactNativeFlipper class. After creating a client and setting up some plugins, the app consistently crashes after client.start() run. I tried to use the debugger but even a force step into client.start() crashes immediately.

Crashes with

A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x13 in tid 8831 (FlipperEventBas), pid 8540 (tion.androiddev)

To Reproduce

Flipper v0.127.0 ReactNativeFlipper.java from here

Environment

Flipper desktop Version 0.127.0 (50.0.0) Flipper SDk version 0.127.0 M1 Macbook

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 25
  • Comments: 37 (4 by maintainers)

Most upvoted comments

I ran this command and my issues were fixed:

adb shell run-as "com.example.yourapppackage" rm -rf files/sonar

Uninstalling the app and installing it again helped me, as stated here (not sure how often it’s needed)

Using Flipper 0.125.0 in combination with React Native 0.68.0.

Same here with Expo SDK 45

Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 11235 (FlipperEventBas), pid 11213 (ile.development)

My error is slightly different: A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 16410 (FlipperEventBas), pid 16260

The error only happens when I open the app on the physical device (either running directly or running from android studio), works fine in the emulator.

I ran this command and my issues were fixed:

adb shell run-as "com.example.yourapppackage" rm -rf files/sonar

This worked! @redbluenat can you please share how did you figure this out?

0.105.0 works for the time being 👍

Running into this for the first time; version doesn’t seem to matter. I tried 0.143.0, 0.140.0, 0.130.0, 0.127.0, 0.125.0, and 0.115.0. Same-ish error from each:

Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 10401 (FlipperEventBas), pid 10352 (om.apps.myapp)

Unknown

Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 10401 (FlipperEventBas), pid 10352 (om.apps.myapp)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'google/sdk_gphone_arm64/emulator_arm64:11/RSR1.210722.003/7604015:user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2022-04-21 21:44:24-0300
pid: 10352, tid: 10401, name: FlipperEventBas  >>> com.myapp.apps.myapp <<<
uid: 10173
signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
    x0  0000000000000000  x1  00000000000028a1  x2  0000000000000006  x3  0000006ef8c86260
    x4  00000000ebad808a  x5  00000000ebad808a  x6  00000000ebad808a  x7  00000000ebad808b
    x8  00000000000000f0  x9  33d9f45fb88567e6  x10 0000000000000000  x11 ffffffc0fffffbdf
    x12 0000000000000001  x13 0000000000000045  x14 000000000000000c  x15 000000000000000c
    x16 00000071f9259c80  x17 00000071f923b3f0  x18 0000006ef564a000  x19 0000000000002870
    x20 00000000000028a1  x21 00000000ffffffff  x22 ffffff910737959f  x23 0000006ef8c864c0
    x24 0000006ef8c86a60  x25 0000006ef8c88000  x26 0000000000000001  x27 0000006ef8c88000
    x28 0000000000000001  x29 0000006ef8c862e0
    lr  00000071f91eee20  sp  0000006ef8c86240  pc  00000071f91eee4c  pst 0000000000001000
backtrace:
      #00 pc 000000000004de4c  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: ac8f7173c886715a2f2fec67246e21da)
      #01 pc 00000000000af7e4  /data/app/~~fO98cWoAFBc5zYr_tK_dyQ==/com.myapp.apps.myapp-ZptehU344KMTFEBTMuobeA==/base.apk!libc++_shared.so (offset 0x8c57000) (BuildId: ece72a2ebc3774a1be9fd21271258acd3bcdfaa7)
      #02 pc 00000000000aedc8  /data/app/~~fO98cWoAFBc5zYr_tK_dyQ==/com.myapp.apps.myapp-ZptehU344KMTFEBTMuobeA==/base.apk!libc++_shared.so (offset 0x8c57000) (BuildId: ece72a2ebc3774a1be9fd21271258acd3bcdfaa7)
      #03 pc 00000000000aebf8  /data/app/~~fO98cWoAFBc5zYr_tK_dyQ==/com.myapp.apps.myapp-ZptehU344KMTFEBTMuobeA==/base.apk!libc++_shared.so (offset 0x8c57000) (__gxx_personality_v0+200) (BuildId: ece72a2ebc3774a1be9fd21271258acd3bcdfaa7)
      #04 pc 0000000000141930  /data/app/~~fO98cWoAFBc5zYr_tK_dyQ==/com.myapp.apps.myapp-ZptehU344KMTFEBTMuobeA==/base.apk!libflipper.so (offset 0xb32a000) (BuildId: 13d2240eea342578eea1fab06199c84c43f722ed)

Edit: Got things working by downgrading to 0.105.0. Worth noting that the app would boot until I connected and then closed flipper. After the crash was triggered on every launch.

Hi, I have a similar problem. I can use my app as long as the flipper desktop app is closed. But as soon as I open it the app crash. I have an Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 12545 (FlipperEventBas), pid 12518 (com.soraredata) error.

Capture d’écran 2023-02-06 à 16 02 16

The adb shell run-as “com.example.yourapppackage” rm -rf files/sonar is not working for me

still having this problem

I had a closer look at this today, and it looks like the “crash” I’m seeing may not be related after all. It turns out that with 0.125, Flipper is trying to load arm64/libflipper.so first before trying arm64-v8a/libflipper.so on device. This causes a SIGILL which I mistook for a crash. If I just let it continue, it will actually recover and successfully launch. Interestingly, if I bump Flipper to latest 0.164, this no longer happens.

In any case, sorry for the noise! 🙇‍♂️

It seems like it was fixed in 0.130.0. At least it works for me sfter update.

Same issue here, this issue makes it hard to use Flipper. RN 0.70.1 and Flipper 0.166

To reproduce on a mac (short hand notes):

npx react-native init app
brew install Flipper
cd app && npm run android 
  • optionally fix android/gradle properties - FLIPPER_VERSION=0.164.0 (latest available on maven)

Note:

  • Fresh app install allows the app to run without Flipper.
  • Once the app has been connected to Flipper, then subsequent npm run android will not work. Requires uninstalling the app and running the command
  • My expo based app also has the same issue.

Another item to flag is a connection loop that starts happening when you refresh an android app from within Flipper (have not dug into this in depth)

I’m confused by this issue. I cannot get an Android app to run with any version of flipper newer than 0.105.0 and yet there have been many releases of Flipper since then. Is this not affecting all Android users? Are there a disproportionate number of iOS users so that this is not a high priority? It just seems weird. Why release a bunch of new features, etc. if half the users can’t use them? Is there some workaround that I am not aware of?

I’m sorry but a fix hasn’t been released, I will update once it is.

Same issue here. Tried forcing ndkVersion to 23 but no luck. I’ll wait for an official solution @lblasa . Thanks! Downgrading flipper solves the issue.

No worries! Maybe the info about updating to 0.164 will help somebody else.

I’m confused by this issue. I cannot get an Android app to run with any version of flipper newer than 0.105.0 and yet there have been many releases of Flipper since then. Is this not affecting all Android users?

Flipper has been working fine for us up until we introduced C++ code: https://github.com/microsoft/react-native-test-app/pull/1127

Like you said, we had to downgrade to 0.105 for things to start working again. Maybe this is related to how Flipper interacts with libc++_shared.so?

Hi @daxaxelrod many thanks for reporting this.

I can definitely see there’s an issue here: https://github.com/facebook/flipper/blob/main/react-native/ReactNativeFlipperExample/android/build.gradle

As the example is trying to use NDK r21, it should be r23. This will be fixed very soon.