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

Crash in libcamera2ndk.so (SIGSEGV) in versions prior to Android 8.1 / Android O MR1 (API 27) #291

Open
RegisAG opened this issue Apr 5, 2018 · 7 comments
Labels
known issue Known issue. No fix expected.

Comments

@RegisAG
Copy link

RegisAG commented Apr 5, 2018

I have an app in production used by many users. On some of them, only on Android 7.x, I have got the following error:

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0

backtrace:
  #00  pc 000000000000b91c  /system/lib64/libcamera2ndk.so
  #01  pc 000000000000d0a0  /system/lib64/libcamera2ndk.so
  #02  pc 000000000001499c  /system/lib64/libcamera2ndk.so
  #03  pc 00000000000166bc  /system/lib64/libcamera2ndk.so
  #04  pc 00000000000120f4  /system/lib64/libstagefright_foundation.so (_ZN7android8AHandler14deliverMessageERKNS_2spINS_8AMessageEEE+52)
  #05  pc 0000000000015e9c  /system/lib64/libstagefright_foundation.so (_ZN7android8AMessage7deliverEv+112)
  #06  pc 000000000001322c  /system/lib64/libstagefright_foundation.so (_ZN7android7ALooper4loopEv+480)
  #07  pc 00000000000124e8  /system/lib64/libutils.so (_ZN7android6Thread11_threadLoopEPv+272)
  #08  pc 00000000000a5110  /system/lib64/libandroid_runtime.so (_ZN7android14AndroidRuntime15javaThreadShellEPv+116)
  #09  pc 00000000000696bc  /system/lib64/libc.so (_ZL15__pthread_startPv+196)
  #10  pc 000000000001dbf0  /system/lib64/libc.so (__start_thread+16)

Any idea on the origin of this problem ?

@inio
Copy link

inio commented Apr 5, 2018

This, unfortunately, is a known issue in Android versions prior to 8.1. It generally occurs only during extremely high CPU usage. There's nothing we can do about it. ☹️

@inio inio added the known issue Known issue. No fix expected. label Apr 5, 2018
@inio inio changed the title signal 11 (SIGSEGV), code 1 (SEGV_MAPERR) libcamera2ndk.so Crash in libcamera2ndk.so (SIGSEGV) on Android versions below 8.1 Apr 5, 2018
@RegisAG
Copy link
Author

RegisAG commented Jun 11, 2018

Any update concerning this problem ? Note that according to my Android Vitals dashboard, this crash happens almost only on: Galaxy S7 Edge (hero2lte) (47.3% of the crashes), Galaxy S7 (herolte) (42% of the crashes), Galaxy S7 (heroltebmc) (2.2% of the crashes) => 90% of the occurences of this crash happen on S7 (running Android 7.x). Do you plan to fix this problem ? The S7 represents 20% of my installs and thus crash has a bad influence on my rating.

@inio
Copy link

inio commented Jun 11, 2018

This issue happens with high CPU load resulting in blocked Binder threads. If you can reduce your app's CPU usage and avoid blocking/waiting in any callbacks running on Binder threads, it may reduce this issue.

Long term, we're looking at ways to mitigate this issue, but they are major rewrites of substantial parts of our codebase. This is a bug in the android NDK Camera 2 API implementation that was fixed in Android 8.1.

@RegisAG
Copy link
Author

RegisAG commented Jun 11, 2018

"avoid blocking/waiting in any callbacks running on Binder threads" : how to do that ? :)

@inio
Copy link

inio commented Jun 11, 2018

Anything related to Android services should avoid blocking in callbacks. Google Play Services for example.

@fredsa fredsa changed the title Crash in libcamera2ndk.so (SIGSEGV) on Android versions below 8.1 Crash in libcamera2ndk.so (SIGSEGV) in versions prior to Android 8.1 / Android O MR1 (API 27) Apr 27, 2019
@gkiernozek
Copy link

gkiernozek commented May 8, 2019

@RegisAG - try newest ARCore 1.9.0 - I have not experienced the freeze yet from time I've updated SDK and hopefully it stays this way :)

Let me know if 1.9.0 ever crashes for you as it did in previous versions so I can be prepared that problem can still occur.

@Noltibus
Copy link

Noltibus commented May 4, 2020

We still experience this error in production. Only on Samsung devices (S8, A6, A7 2108) with Android versions 9 and 10. the stacktrace reads as follows:

signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> one.realnote.app <<<

backtrace:
  #00  pc 000000000001e1b0  /system/lib64/libcamera2ndk.so (android::acam::CameraManagerGlobal::DeathNotifier::binderDied(android::wp<android::IBinder> const&)+276)
  #01  pc 000000000004e400  /system/lib64/libbinder.so (android::BpBinder::reportOneDeath(android::BpBinder::Obituary const&)+148)
  #02  pc 000000000004e320  /system/lib64/libbinder.so (android::BpBinder::sendObituary()+148)
  #03  pc 0000000000058b18  /system/lib64/libbinder.so (android::IPCThreadState::executeCommand(int)+668)
  #04  pc 00000000000587c8  /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+156)
  #05  pc 0000000000058f04  /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+60)
  #06  pc 000000000007f024  /system/lib64/libbinder.so (android::PoolThread::threadLoop()+24)
  #07  pc 00000000000135fc  /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+288)
  #08  pc 00000000000ef900  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+140)
  #09  pc 00000000000e28c0  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
  #10  pc 000000000008503c  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

Currently using ArCore 1.16

@devbridie devbridie unpinned this issue Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
known issue Known issue. No fix expected.
Projects
None yet
Development

No branches or pull requests

4 participants