Android libc so sigabrt

What the hell is this log?

Jul 28, 2019 · 6 min read

In Android, What part of the stack trace from a native crash is important?

If you are an Android developer maybe your app gets crash and you face with some back stack trace in the Logcat that is very unordinary.

You always expect to see the stack of classes and find what lines are due to the crash, but I talk about the kind of log that you can’t see any class of your code. Something like below:

Crashes

An Android app crashes whenever there’s an unexpected exit caused by an unhandled exception or signal. An app that is written using Java crashes if it throws an unhandled exception, represented by the Throwable class. An app that is written using native-code languages crashes if there’s an unhandled signal, such as SIGSEGV, during its execution.

So there are two types of crashes in Android, Unhandled Exception (or java crash) and Signal (or native crash).
You are probably familiar with Logcat output in java crash. Where you can find a line that causes the crash and you can handle that. But we intend to talk about the native crash.

I am coding java not native

Maybe you say I am coding in java so why should I pay attention to native crash?

Okay, maybe you still not face this kind of crash but it’s not mean that this is not happening on java code. Maybe the reason that you still not see it is:
1- You are lucky
2- The Crashlytics tools like firebase can’t log these crashes.

here is the important point, the native crash is a signal from the kernel that stops application so no more code can run and everything will be stoped so crashlytics tools can’t log these crashes, But maybe you can see some of them on play store crashlytics section (because play store is outer service).

Diagnose the crashes

If you coding native you must learn more about kinds of the native crash.
Here is the help page from the official ASOP website that explains all situations.

But if you coding java you will face with SIGABRT crash . the SIGABRT means Signal Abort, so when this happens the process of application immediately will be aborted.

Читайте также:  Поставить смайлик андроид инстаграм

Reading a stack trace

To introduce the different pieces in a crash dump, let’s work through this example crash dump from ASOP website. (I write this section only for who that want knows what meaning each part of the stack trace, you can skip this and read My Experience part.)

So let’s start investing in important parts.

The revision refers to the hardware rather than the software. This is usually unused but can be useful to help you automatically ignore bugs known to be caused by bad hardware.

The ABI is one of arm, arm64, mips, mips64, x86, or x86–64. These are the architecture of CPU

This line identifies the specific thread in the process that crashed. In this case, it was the process’ main thread, so the process ID and thread ID match. The first name is the thread name, and the name surrounded by >>> and

My Experience

I was faced with the native crash in two situations.

Application Not Responding (ANR)

If you do a large task in the main thread (UI thread) the application not responding so the kernel decides to abort the process.

In this situation the back stack trace looks like this:

Below libc.so you can see the libhwui.so. This is the library for rendering UI.
So if you see libhwui.so in back stack trace it means you have ANR in your app.

Use Reflection

In my case, once I used the reflection in a for loop I get the native crash for Android Oreo+. In this situation the back stack trace looks like this:

Below libc.so you can see libart.so. Art is the java virtual machine for Android.
So if you see libart.so take care that you don’t use reflection.
It doesn’t mean every libart.so is about reflection just as my experience is a candidate for debugging.

Thank you for reading my article. Share your native crash experience with us to help other ones.

Источник

Android Fatal Signal 6 (SIGABRT) #442

Comments

omida commented Jul 15, 2016

Hi Dmitry, Cárthach,

I was successfully able to create the libessentia.so library for use in Android, and compile the native C++ code with the Android NDK. However, I get a runtime error when trying to create an algorithm. I used the standard_mfcc.cpp code as a use case. You can find the C++ code in the following text document:

After a little debugging using print statements I realized the problem is occurring when the program is trying to create an algorithm using “factory.create()”. The problem occurred no matter which algorithm was to be created (e.g., MonoLoader, FrameCutter, MFCC, etc.).

Here’s the logcat I get:

——— beginning of crash
07-15 16:10:31.844 12623-12623/? A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 12623 (xample.hellojni)
07-15 16:10:31.844 1175-1175/? D/KeyguardSecurityView: showSecurityScreen(None)
07-15 16:10:31.852 12397-12576/? I/Icing: Post-init done
07-15 16:10:31.917 304-304/? I/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
07-15 16:10:31.917 304-304/? I/DEBUG: Build fingerprint: ‘motorola/surnia_verizon/surnia_cdma:5.1/LPIS23.29-17.5-2/2:user/release-keys’
07-15 16:10:31.917 304-304/? I/DEBUG: Revision: ‘p300’
07-15 16:10:31.917 304-304/? I/DEBUG: ABI: ‘arm’
07-15 16:10:31.917 304-304/? I/DEBUG: pid: 12623, tid: 12623, name: xample.hellojni >>> com.example.hellojni
07-15 16:10:32.029 823-1609/? I/ActivityManager: Killing 12373:com.motorola.moto:context_engine/u0a30 (adj 15): empty #7
07-15 16:10:32.214 304-304/? I/DEBUG: Tombstone written to: /data/tombstones/tombstone_06
07-15 16:10:32.229 823-846/? I/BootReceiver: Copying /data/tombstones/tombstone_06 to DropBox (SYSTEM_TOMBSTONE)
07-15 16:10:32.234 823-12668/? W/ActivityManager: Force finishing activity 1 com.example.hellojni/.HelloJni
07-15 16:10:32.290 823-845/? W/ActivityManager: Activity pause timeout for ActivityRecord<3685b98a u0 com.example.hellojni.hellojni t106 f>
07-15 16:10:32.301 233-233/? E/lowmemorykiller: Error writing /proc/12623/oom_score_adj; errno=22
07-15 16:10:32.333 233-233/? E/lowmemorykiller: Error writing /proc/12623/oom_score_adj; errno=22
07-15 16:10:32.333 823-845/? E/JavaBinder: . FAILED BINDER TRANSACTION .
07-15 16:10:32.339 323-323/? I/Zygote: Process 12623 exited due to signal (6)

Читайте также:  Почему андроид не перевел часы

I would much appreciate it if you can help me out!

The text was updated successfully, but these errors were encountered:

Источник

App Crashes with Fatal signal 6 SIGABRT on Android, works fine on iOS #44352

Comments

thecoffeehog commented Nov 7, 2019

Device

Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)

Run Log

Launching lib/main.dart on Android SDK built for x86 in debug mode.
Initializing gradle.
Resolving dependencies.
Running Gradle task ‘assembleDebug’.
Built build/app/outputs/apk/debug/app-debug.apk.
D/EGL_emulation( 5811): eglMakeCurrent: 0xd788c600: ver 3 0 (tinfo 0xbea08740)
D/eglCodecCommon( 5811): setVertexArrayObject: set vao to 0 (0) 1 0
I/OpenGLRenderer( 5811): Davey! duration=880ms; Flags=1, IntendedVsync=147055416692, Vsync=147055416692, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=147063080756, AnimationStart=147063103561, PerformTraversalsStart=147063106099, DrawStart=147747192191, SyncQueued=147748305438, SyncStart=147750795069, IssueDrawCommandsStart=147751505231, SwapBuffers=147816177519, FrameCompleted=147938750711, DequeueBufferDuration=11437000, QueueBufferDuration=183000,
I/Choreographer( 5811): Skipped 52 frames! The application may be doing too much work on its main thread.
Syncing files to device Android SDK built for x86.
I/pawfect.pawfec( 5811): Background young concurrent copying GC freed 90128(9721KB) AllocSpace objects, 41(1508KB) LOS objects, 71% free, 2442KB/8586KB, paused 48.561ms total 529.452ms
D/eglCodecCommon( 5811): setVertexArrayObject: set vao to 0 (0) 1 0
D/EGL_emulation( 5811): eglMakeCurrent: 0xd788e4c0: ver 3 0 (tinfo 0xd78da8c0)
D/eglCodecCommon( 5811): setVertexArrayObject: set vao to 0 (0) 10 0
W/libc ( 5811): malloc(388011204) failed: returning null pointer
F/libc ( 5811): Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 5866 (pawfect.pawfect), pid 5811 (pawfect.pawfect)

Build fingerprint: ‘google/sdk_gphone_x86/generic_x86:10/QSR1.190920.001/5891938:user/release-keys’
Revision: ‘0’
ABI: ‘x86’
Timestamp: 2019-11-07 21:09:32+0530
pid: 5811, tid: 5866, name: pawfect.pawfect >>> xyz.pawfect.pawfect

The text was updated successfully, but these errors were encountered:

iapicca commented Nov 7, 2019

Hi @thecoffeehog
Fatal signal 6 SIGABRT it might means that your device hang at some point

the one you posted is the whole flutter build —verbose ?
if it isn’t could please you post the full extent
thank you

Источник

Fatal signal 6 (SIGABRT), code -6 #541

Comments

julianonunes commented Jan 11, 2019

I saw a few issues related to SIGABRT but no solution until now.

I’ve created a new Android project and built the .so and .java files using swig, however when I try to run the app I get «Fatal signal 6 (SIGABRT), code -6».

The text was updated successfully, but these errors were encountered:

abhishekkumardwivedi commented Jan 22, 2019

I am also getting same error. This is

julianonunes commented Jan 22, 2019

For me the solution was to switch to Linux to compile the Android project referencing the .so files.

abhishekkumardwivedi commented Jan 22, 2019

I am compiling in Ubuntu. I tried compiling the example application for android and it worked for me. But if I try to use same .so lib and swig generated JNI and other files in new application, I am getting JNI error.

julianonunes commented Jan 22, 2019 •

Did you keep this line on build.gradle?

I also got an error when I omitted this line.

abhishekkumardwivedi commented Jan 22, 2019

Yes, I had suspected the cause and had added encoding also but didn’t work. This is my build.gradle

Читайте также:  Телефоны сони xperia андроид

julianonunes commented Jan 22, 2019

It isn’t much different from mine. The steps I had to follow were:

  • Switch from Windows to Ubuntu 18.10
  • Install swig 3.0.12 (using apt install swig instead of apt install swig3.0) to generate .so files
  • Copy the .so files from jniLibs keeping the folders for each processor architecture
  • Copy the .java files (actually I copied the files from the sample project, instead of the versions generated by the make command)
  • Keep the encoding line

And sometimes uninstall the app from the device before trying to run it again.

abhishekkumardwivedi commented Jan 22, 2019

@julianonunes I will try it again tomorrow.

macy7 commented Mar 4, 2019 •

May I ask whether this problem has been solved

my error
——— beginning of crash
2019-03-04 17:30:45.207 4591-4591/com.tuya.smart.sdk.demo A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 4591 (.smart.sdk.demo), pid 4591 (.smart.sdk.demo)
2019-03-04 17:30:45.355 4721-4721/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2019-03-04 17:30:45.355 4721-4721/? A/DEBUG: Build fingerprint: ‘Android/msm8953_64/msm8953_64:8.1.0/OPM1.171019.011/SPARROWPRC_USRD_:userdebug/test-keys’
2019-03-04 17:30:45.355 4721-4721/? A/DEBUG: Revision: ‘0’
2019-03-04 17:30:45.356 4721-4721/? A/DEBUG: ABI: ‘arm64’
2019-03-04 17:30:45.356 4721-4721/? A/DEBUG: pid: 4591, tid: 4591, name: .smart.sdk.demo >>> com.tuya.smart.sdk.demo

marcodiaz commented Mar 6, 2019 •

I’m having the same issues, has any of you guys got any luck with this?

2019-03-05 19:11:08.332 24051-24051/? W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
2019-03-05 19:11:08.332 24051-24051/? A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 24051 //
2019-03-05 19:11:08.379 3658-3668/? I/art: Background partial concurrent mark sweep GC freed 53450(3MB) AllocSpace objects, 12(2MB) LOS objects, 20% free, 62MB/78MB, paused 6.078ms total 148.684ms
2019-03-05 19:11:08.408 24190-24190/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2019-03-05 19:11:08.408 24190-24190/? A/DEBUG: Build fingerprint: ‘samsung/zerofltedv/zeroflte:7.0/NRD90M/G920IDVU3FRB8:user/release-keys’
2019-03-05 19:11:08.408 24190-24190/? A/DEBUG: Revision: ’11’
2019-03-05 19:11:08.408 24190-24190/? A/DEBUG: ABI: ‘arm’
2019-03-05 19:11:08.408 24190-24190/? A/DEBUG: pid: 24051, tid: 24051, name: walmart.grocery
2019-03-05 19:11:08.408 24190-24190/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr ———
2019-03-05 19:11:08.408 24190-24190/? A/DEBUG: r0 00000000 r1 00005df3 r2 00000006 r3 00000008
2019-03-05 19:11:08.408 24190-24190/? A/DEBUG: r4 f6def58c r5 00000006 r6 f6def534 r7 0000010c
2019-03-05 19:11:08.408 24190-24190/? A/DEBUG: r8 d3828c80 r9 c05e2fe8 sl 00000000 fp c05eb574
2019-03-05 19:11:08.408 24190-24190/? A/DEBUG: ip 0000000d sp ffa7b9e0 lr f39599c7 pc f395c230 cpsr 600f0010
2019-03-05 19:11:08.410 24190-24190/? A/DEBUG: backtrace:
2019-03-05 19:11:08.410 24190-24190/? A/DEBUG: #0 pc 0004a230 /system/lib/libc.so (tgkill+12)
2019-03-05 19:11:08.410 24190-24190/? A/DEBUG: #1 pc 000479c3 /system/lib/libc.so (pthread_kill+34)
2019-03-05 19:11:08.410 24190-24190/? A/DEBUG: #2 pc 0001d9c5 /system/lib/libc.so (raise+10)
2019-03-05 19:11:08.410 24190-24190/? A/DEBUG: #3 pc 00019511 /system/lib/libc.so (__libc_android_abort+34)
2019-03-05 19:11:08.410 24190-24190/? A/DEBUG: #4 pc 00017150 /system/lib/libc.so (abort+4)
2019-03-05 19:11:08.410 24190-24190/? A/DEBUG: #5 pc 000c0c1b /data/app/com.walmart.grocery-1/lib/arm/libsnowboy-detect-android.so (_ZN9__gnu_cxx27__verbose_terminate_handlerEv+226)

macy7 commented Mar 7, 2019

I made a simple mistake. I wrote the name of the wake-up word file I trained wrong, so I made this mistake.now i solved .

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

Оцените статью