Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A/libc: Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x708d31bd64 in tid 22188

Tags:

android

Hi guys I don't have much Android experience but I've been given a task that I'm quite stumped on. I'm getting the error

A/libc: Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x708d31bd64 in tid 22188 

This happens when I try to install my app on to a Galaxy Note 9 running on Android 10. I'm using Android Studio 4.1 R3. I've been searching for answers all day and the closest I've come is from https://github.com/facebook/react-native/issues/29517.

From what I gather, this error is only for Android 10 and above, and that I need to disable Execute Memory Only (XOM) or use mprotect() somewhere. As indicated in https://source.android.com/devices/tech/debug/execute-only-memory#disabling, I need to do either one of the following:

// Android.mk
LOCAL_XOM := false

// Android.bp
cc_binary { // or other module types
   ...
   xom: false,
}

My question is then where are Android.mk and Android.bp? I'm not able to find either files in my project.

OR

If code introspection is necessary on executable code sections, first call mprotect to mark the code readable. Then after the operation is complete, call mprotect again to mark it unreadable.

How exactly do you use mprotect()? I'm not able to find any clear examples showing its usage.

like image 960
Mark Avatar asked Oct 28 '20 23:10

Mark


1 Answers

Android 10 seems to have problems with Arm64 based architecture. Which give you Execute-only memory violation for some libraries. https://source.android.com/devices/tech/debug/native-crash

You can find out more details about the root of the problem (the library that's giving the issue) with:

Use the Android Debugger to get a crash dump.

  1. On the Android device navigate to Settings > Developer options > enable USB debugging

  2. Connect the Android device to computer with USB

  3. Download the Android SDK Platform Tools: Android Studio > Tools> SDK Manager > Android SDK > SDK Tools > Android SDK Platform-Tools

  4. If on windows navigate to - C:\Users\[user]\AppData\Local\Android\sdk\platform-tools

    If on mac navigate to /Users/[user]/Library/Android/sdk/platform-tools

  5. Run the App and crash the app

  6. From the terminal run: ./adb logcat -v threadtime -d > /path_to_random_text_file_for_crash_dump/test.txt

A more detailed error should be in the test.txt.

Again I cannot confirm that this will help solve your problem but that's what has helped me. For me I believe it was Twilio running on an old version, 3.1.x instead of the newer version.

like image 122
Mark Avatar answered Nov 07 '22 21:11

Mark