question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] Native crash on React Native 0.65-rc3 / reanimated 2.3 alpha 2

See original GitHub issue

Description

The application ends up crashing after a few seconds of use with an issue seemingly originated in libreanimated.so:

react-native-reanimated@^2.3.0-alpha.2: react-native@^0.65.0-rc.3

The logs are from a simulator but it also happens on device. Please do let me know if I can provide you with any more debug info.

The crash:

tombstoned: received crash request for pid 16158
crash_dump64: performing dump of process 15998 (target tid = 16158)
DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
DEBUG   : Build fingerprint: 'google/sdk_gphone_x86_64/generic_x86_64_arm64:11/RSR1.201211.001/7027799:user/release-keys'
DEBUG   : Revision: '0'
DEBUG   : ABI: 'x86_64'
DEBUG   : Timestamp: 2021-08-04 16:45:05+0100
DEBUG   : pid: 15998, tid: 16158, name: hades  >>> com.getpaired.app <<<
DEBUG   : uid: 10160
DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
DEBUG   : Abort message: 'terminating with uncaught exception of type std::runtime_error: Unable to retrieve jni environment. Is the thread attached?'
DEBUG   :     rax 0000000000000000  rbx 0000000000003e7e  rcx 000077e3ffd1d2a8  rdx 0000000000000006
DEBUG   :     r8  0000000000000000  r9  0000000000000000  r10 000077e10f8f9fd0  r11 0000000000000246
DEBUG   :     r12 000077e10f8fa1c0  r13 0000003000000008  r14 000077e10f8f9fc8  r15 0000000000003f1e
DEBUG   :     rdi 0000000000003e7e  rsi 0000000000003f1e
DEBUG   :     rbp 000077e10f8fa660  rsp 000077e10f8f9fb8  rip 000077e3ffd1d2a8
DEBUG   : backtrace:
DEBUG   :       #00 pc 000000000005a2a8  /apex/com.android.runtime/lib64/bionic/libc.so (syscall+24) (BuildId: 3707c39fc397eeaa328142d90b50a973)
DEBUG   :       #01 pc 000000000005d212  /apex/com.android.runtime/lib64/bionic/libc.so (abort+194) (BuildId: 3707c39fc397eeaa328142d90b50a973)
DEBUG   :       #02 pc 00000000000a729b  /data/app/~~lmq3je1BbxNWbJtPz5Bjig==/com.getpaired.app-inlOIcjHWLG8qEZZwKEhfg==/lib/x86_64/libc++_shared.so (BuildId: 013d16f5e2afb684dc5c7ebda3499fd97205ac47)
DEBUG   :       #03 pc 00000000000a745d  /data/app/~~lmq3je1BbxNWbJtPz5Bjig==/com.getpaired.app-inlOIcjHWLG8qEZZwKEhfg==/lib/x86_64/libc++_shared.so (BuildId: 013d16f5e2afb684dc5c7ebda3499fd97205ac47)
DEBUG   :       #04 pc 00000000000bd4d2  /data/app/~~lmq3je1BbxNWbJtPz5Bjig==/com.getpaired.app-inlOIcjHWLG8qEZZwKEhfg==/lib/x86_64/libc++_shared.so (BuildId: 013d16f5e2afb684dc5c7ebda3499fd97205ac47)
DEBUG   :       #05 pc 00000000000bd468  /data/app/~~lmq3je1BbxNWbJtPz5Bjig==/com.getpaired.app-inlOIcjHWLG8qEZZwKEhfg==/lib/x86_64/libc++_shared.so (std::terminate()+40) (BuildId: 013d16f5e2afb684dc5c7ebda3499fd97205ac47)
DEBUG   :       #06 pc 00000000000d1b5e  /data/app/~~lmq3je1BbxNWbJtPz5Bjig==/com.getpaired.app-inlOIcjHWLG8qEZZwKEhfg==/lib/x86_64/libreanimated.so (BuildId: 62098f20cee9b154bcc6f0be2e58717a622f9f32)

Previous logs from application launch: 15998 15998 W m.getpaired.ap: Unexpected CPU variant for X86 using defaults: x86_64

D SoLoader: init start
D SoLoader: adding system library source: /vendor/lib64
D SoLoader: adding system library source: /system/lib64
D SoLoader: adding application source: com.facebook.soloader.DirectorySoSource[root = /data/app/~~lmq3je1BbxNWbJtPz5Bjig==/com.getpaired.app-inlOIcjHWLG8qEZZwKEhfg==/lib/x86_64 flags = 0]
D SoLoader: adding backup source from : com.facebook.soloader.ApkSoSource[root = /data/data/com.getpaired.app/lib-main flags = 1]
D SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /system/lib64 flags = 2]
D SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /vendor/lib64 flags = 2]
D SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /data/app/~~lmq3je1BbxNWbJtPz5Bjig==/com.getpaired.app-inlOIcjHWLG8qEZZwKEhfg==/lib/x86_64 flags = 0]
D SoLoader: Preparing SO source: com.facebook.soloader.ApkSoSource[root = /data/data/com.getpaired.app/lib-main flags = 1]
V fb-UnpackingSoSource: locked dso store /data/user/0/com.getpaired.app/lib-main
V fb-UnpackingSoSource: deps mismatch on deps store: regenerating
V fb-UnpackingSoSource: so store dirty: regenerating
08-04 16:42:14.620 15998 15998 D ApkSoSource: not allowing consideration of lib/x86_64/libreanimated.so: deferring to libdir

Expected behavior

Actual behavior & steps to reproduce

Can’t reproduce it deterministically, it always happens after a few seconds.

Snack or minimal code example

I hope the above stack traces can help narrow down the issue, we have a very complex app with heavy use of reanimated.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:31
  • Comments:30 (19 by maintainers)

github_iconTop GitHub Comments

8reactions
hmust92commented, Aug 7, 2021

I am also running into this issue on android with the react-native-reanimated@2.3.0-alpha.2 release.

Description

The application crashes immediately when running on android in the simplest use case.

Expected behavior

The application does not crash.

Actual behavior & steps to reproduce

Create a bare react native project. Install react-native-reanimated@2.3.0-alpha.2, follow the instructions for the android setup and then build the app. The app builds successfully on android studio but crashes immediately when trying to run it.

If I downgrade the version of react-native-reanimated to 2.2.0 in the same project it starts working again.

This problem ONLY exists on android. On iOS version 2.3.0-alpha.2 works fine.

Snack or minimal code example

https://github.com/hmust92/AwesomeProject

git clone https://github.com/hmust92/AwesomeProject

npm install

npm start

build with android studio (or run npm run android)

Package versions

  • React Native: 0.64.2
  • React Native Reanimated:2.3.0-alpha.2

Affected platforms

  • Android
  • iOS
  • Web
4reactions
andreialecucommented, Sep 3, 2021

It seems that 2.3.0-alpha.3 has just been released, but I’m getting the same crash on Android.

There does seem to be a difference, it crashes a bit later. With alpha.2 it was crashing instantly. But with alpha.3 I can interact with the app a bit before it crashes.

signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
Abort message: 'terminating with uncaught exception of type std::runtime_error: Unable to retrieve jni environment. Is the thread attached?'
    x0  0000000000000000  x1  000000000000741f  x2  0000000000000006  x3  000000703c858e50
    x4  fefefefefefefeff  x5  fefefefefefefeff  x6  fefefefefefefeff  x7  7f7f7f7f7f7f7f7f
    x8  00000000000000f0  x9  e141945ad3c060c7  x10 0000000000000000  x11 ffffffc0fffffbdf
    x12 0000000000000001  x13 0000054acec8d75a  x14 0032f644493fbe00  x15 0000000029aaaaab
    x16 000000733aeccc80  x17 000000733aeae3f0  x18 00000070240cc000  x19 0000000000007343
    x20 000000000000741f  x21 00000000ffffffff  x22 ffffff80ffffffc8  x23 000000703c8590a0
    x24 000000703c858f80  x25 000000703c858fc0  x26 0000000000000022  x27 0000000000000001
    x28 0000000000000670  x29 000000703c858ed0
    lr  000000733ae61e20  sp  000000703c858e30  pc  000000733ae61e4c  pst 0000000000001000
backtrace:
      #00 pc 000000000004de4c  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: ac8f7173c886715a2f2fec67246e21da)
      #01 pc 00000000000a01bc  /data/app/~~SEOKB12EXe-KGn4-AvZ9Iw==/poker.lets.android-pnZabrWOMlEiA11JIZ2UGA==/lib/arm64/libc++_shared.so (BuildId: 6de1c39a010a6596b5bb6546e6fe55445b037c1b)
      #02 pc 00000000000a03b0  /data/app/~~SEOKB12EXe-KGn4-AvZ9Iw==/poker.lets.android-pnZabrWOMlEiA11JIZ2UGA==/lib/arm64/libc++_shared.so (BuildId: 6de1c39a010a6596b5bb6546e6fe55445b037c1b)
      #03 pc 00000000000b4208  /data/app/~~SEOKB12EXe-KGn4-AvZ9Iw==/poker.lets.android-pnZabrWOMlEiA11JIZ2UGA==/lib/arm64/libc++_shared.so (BuildId: 6de1c39a010a6596b5bb6546e6fe55445b037c1b)
      #04 pc 00000000000b41a0  /data/app/~~SEOKB12EXe-KGn4-AvZ9Iw==/poker.lets.android-pnZabrWOMlEiA11JIZ2UGA==/lib/arm64/libc++_shared.so (std::terminate()+36) (BuildId: 6de1c39a010a6596b5bb6546e6fe55445b037c1b)
      #05 pc 00000000000d1544  /data/app/~~SEOKB12EXe-KGn4-AvZ9Iw==/poker.lets.android-pnZabrWOMlEiA11JIZ2UGA==/lib/arm64/libreanimated.so (BuildId: cc781b612ce4d32ce71ab169b388f207be7658bc)
Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found