Android 7 Native Crash: libc.so tgkill

I see this native crash with the next stack trace.

This only happens on Android 7.0 and 7.1. Nothing new was added to the application, which worked for several years, but with the increase in the number of device updates to Nougat, this failure often occurs and becomes unpleasant.

Any advice would be appreciated.

native: pc 000000000007a6c4 /system/lib64/libc.so (tgkill+8) native: pc 0000000000077920 /system/lib64/libc.so (pthread_kill+64) native: pc 000000000002538c /system/lib64/libc.so (raise+24) native: pc 000000000001d24c /system/lib64/libc.so (abort+52) native: pc 000000000001225c /system/lib64/libcutils.so (__android_log_assert+224) native: pc 00000000000610e0 /system/lib64/libhwui.so native: pc 000000000003908c /system/lib64/libhwui.so native: pc 000000000003609c /system/lib64/libhwui.so native: pc 000000000003b4fc /system/lib64/libhwui.so native: pc 000000000003c520 /system/lib64/libhwui.so native: pc 000000000003e694 /system/lib64/libhwui.so (_ZN7android10uirenderer12renderthread12RenderThread10threadLoopEv+152) native: pc 00000000000127f0 /system/lib64/libutils.so (_ZN7android6Thread11_threadLoopEPv+336) native: pc 00000000000a50b0 /system/lib64/libandroid_runtime.so (_ZN7android14AndroidRuntime15javaThreadShellEPv+116) native: pc 00000000000770f4 /system/lib64/libc.so (_ZL15__pthread_startPv+204) native: pc 000000000001e7d0 /system/lib64/libc.so (__start_thread+16) 

Here is a list of devices that are manufactured: enter image description here

UPDATE 7/18:

I still could not understand the essence of the problem, so I decided to buy a device that took place in most cases and at a reasonable price, it turned out Samsung Galaxy J3 2017 version with Android 7.0. But, unfortunately, the failure has not yet been reproduced.

I also made some improvements to the memory usage of the application at work, but the crash is still happening.

Judging by all the comments and my own research, this is related to dynamically related NDKs, but I do not use them, and it is difficult to determine if there is any of the dependencies.

I would like to share my dependencies, it would be great if other people facing the same problem could cause, if they use the same dependency - maybe we can identify the culprit in this way.

 // App Compat compile 'com.android.support:support-v4:23.0.1' compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.android.support:cardview-v7:23.0.1' compile 'com.android.support:recyclerview-v7:23.0.1' // Play Services compile 'com.google.android.gms:play-services-location:8.3.0' compile 'com.google.android.gms:play-services-maps:8.3.0' compile 'com.google.android.gms:play-services-analytics:8.3.0' compile 'com.google.android.gms:play-services-appindexing:8.3.0' compile 'com.google.android.gms:play-services-ads:8.3.0' // Misc Libraries compile 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar' compile files('app/libs/htmlcleaner-2.7.jar') compile files('app/libs/protobuf-java-2.6.0.jar') compile files('app/libs/nineoldandroids-2.4.0.jar') // Fabric compile('com.twitter.sdk.android:twitter:1.13.0@aar') { transitive = true; } compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') { transitive = true; } 

For people facing the same crash, please respond in the comments if you are using any of these dependencies / versions. Maybe we can highlight the problem of dependence.

+83
android android-7.0-nougat android-7.1-nougat native crash
May 20 '17 at a.m.
source share
6 answers

Looking at the dump you provided gives some tips:

_ZN7android10uirenderer12renderthread12RenderThread10threadLoopEv

This indicates that an error has occurred in the user interface thread.

libhwui.so x 6

This indicates that this is happening in the middle of some code related to the graphics / user interface.

libcutils.so - __android_log_assert

This is a statement handler, so most likely some statement was broken in libwhui .

abort:

This is an application that tells O / S to turn off "abnormally."

boost + pthread_kill + tgkill: this is O / S (Android) closing the application.

You can see some documentation on resolving such failures here .

In any case, I am afraid that it is really difficult to speculate outside this crude and inaccurate interpretation of the data you presented.

Perhaps if you understand the error when it was attached to the Android log viewer, you will have more specific data for the application (or even the error message that the assert function usually gives).

My advice is to use something like AGRA to track all the details related to the error, or to get a vulnerable device and actually play it when it is connected to the debugger.

Good luck

EDIT 2017-06-16 : I just want to add some more kind information from Fco P. Obviously, Google decided to make some changes to which native libraries can work in the latest versions of Android (7.x). More information is available at this link .

+22
Jun 10 '17 at 23:41
source share

This is reported here: https://issuetracker.google.com/issues/37123764

Playback: get vulnerable mode, enable developer mode and set background actions to 0. Also enable β€œshow background crashes”.

Then open the application and close it again: you will see a failure.

+7
Aug 01 '17 at 9:18 on
source share

Not in the comments (insufficient reputation).

Of the dependencies you listed, we use:

 compile 'com.android.support:cardview-v7:25.3.1' compile 'com.android.support:appcompat-v7:25.3.1' compile 'com.android.support:support-v4:25.3.1' compile 'com.google.android.gms:play-services-maps:10.2.1' compile 'com.google.android.gms:play-services-location:10.2.1' 

different versions than yours. I have a strong suspicion that there is a mistake in the game service cards.

Perhaps you are using a map fragment in the viewpager, like we, and many people that Koji Matsubara already mentioned ( https://issuetracker.google.com/issues/37123764 )

+3
Jul 19 '17 at 13:59 on
source share

I had the same issue in the Google Play console for the same devices as you.

In my case, the problem was in TextureView with animation in a separate thread with locking and unlocking the canvas.

I changed the TextureView animation to invalidate-onDraw animation for Android 7 and 7.1, and that helped.

+2
Mar 27 '18 at 9:33
source share

I don’t know, maybe this problem, like ours, maybe is different, because I see in dependencies, including carview . Share hope here that is useful to someone in the future

I also ran into a problem on Android 7.0 and 7.1 below

 03-04 23:44:51.489 2173-2173/? A/DEBUG: Abort message: 'Error: Ambient Vertex Buffer overflow!!! used 420, total 284' 03-04 23:44:51.489 2173-2173/? A/DEBUG: eax 00000000 ebx 0000083b ecx 00000857 edx 00000006 03-04 23:44:51.489 2173-2173/? A/DEBUG: esi d19ff978 edi d19ff920 03-04 23:44:51.489 2173-2173/? A/DEBUG: xcs 00000023 xds 0000002b xes 0000002b xfs 0000006b xss 0000002b 03-04 23:44:51.489 2173-2173/? A/DEBUG: eip f00a6bb9 ebp d19fee68 esp d19fee0c flags 00000292 03-04 23:44:51.555 2173-2173/? A/DEBUG: backtrace: 03-04 23:44:51.555 2173-2173/? A/DEBUG: #00 pc 00000bb9 [vdso:f00a6000] (__kernel_vsyscall+9) 03-04 23:44:51.555 2173-2173/? A/DEBUG: #01 pc 0007a2ec /system/lib/libc.so (tgkill+28) 03-04 23:44:51.555 2173-2173/? A/DEBUG: #02 pc 00075b35 /system/lib/libc.so (pthread_kill+85) 03-04 23:44:51.555 2173-2173/? A/DEBUG: #03 pc 0002784a /system/lib/libc.so (raise+42) 03-04 23:44:51.555 2173-2173/? A/DEBUG: #04 pc 0001ee26 /system/lib/libc.so (abort+86) 03-04 23:44:51.555 2173-2173/? A/DEBUG: #05 pc 0000fa65 /system/lib/libcutils.so (__android_log_assert+245) 03-04 23:44:51.555 2173-2173/? A/DEBUG: #06 pc 00084356 /system/lib/libhwui.so 03-04 23:44:51.555 2173-2173/? A/DEBUG: #07 pc 0003a5ba /system/lib/libhwui.so 03-04 23:44:51.555 2173-2173/? A/DEBUG: #08 pc 00083d04 /system/lib/libhwui.so 03-04 23:44:51.555 2173-2173/? A/DEBUG: #09 pc 0008c5df /system/lib/libhwui.so 03-04 23:44:51.555 2173-2173/? A/DEBUG: #10 pc 0008e6d8 /system/lib/libhwui.so 03-04 23:44:51.555 2173-2173/? A/DEBUG: #11 pc 0008e5d2 /system/lib/libhwui.so 03-04 23:44:51.555 2173-2173/? A/DEBUG: #12 pc 000350fe /system/lib/libhwui.so 03-04 23:44:51.555 2173-2173/? A/DEBUG: #13 pc 0001201f /system/lib/libutils.so (_ZN7android6Thread11_threadLoopEPv+207) 03-04 23:44:51.555 2173-2173/? A/DEBUG: #14 pc 0006e53b /system/lib/libandroid_runtime.so (_ZN7android14AndroidRuntime15javaThreadShellEPv+111) 03-04 23:44:51.555 2173-2173/? A/DEBUG: #15 pc 00011873 /system/lib/libutils.so (_ZN13thread_data_t10trampolineEPKS_+259) 03-04 23:44:51.555 2173-2173/? A/DEBUG: #16 pc 00075292 /system/lib/libc.so (_ZL15__pthread_startPv+210) 03-04 23:44:51.555 2173-2173/? A/DEBUG: #17 pc 0002028e /system/lib/libc.so (__start_thread+30) 03-04 23:44:51.555 2173-2173/? A/DEBUG: #18 pc 0001e066 /system/lib/libc.so (__bionic_clone+70) 

After researching and searching on gooogle, I replaced cardview with Framelayout after which this problem was resolved

+1
Mar 06 '18 at 6:28
source share

I see this problem in the crash report on one user device - "Huawei Honor 7X (HWBND-H)" - running Android 8.0. Since this does not happen in the field for other versions of devices / OS, I think that it may have already been fixed in OS updates (that this user did not raise, or perhaps Huawei did not provide).

 backtrace: #00 pc 000000000006a808 /system/lib64/libc.so (tgkill+8) #01 pc 000000000001db50 /system/lib64/libc.so (abort+88) #02 pc 0000000000007f4c /system/lib64/liblog.so (__android_log_assert+304) #03 pc 000000000004e314 /system/lib64/libhwui.so (_ZN7android10uirenderer12renderthread10EglManager13createSurfaceEP13ANativeWindow+192) #04 pc 000000000004c790 /system/lib64/libhwui.so (_ZN7android10uirenderer12renderthread14OpenGLPipeline10setSurfaceEPNS_7SurfaceENS1_12SwapBehaviorE+64) #05 pc 00000000000492b4 /system/lib64/libhwui.so (_ZN7android10uirenderer12renderthread13CanvasContext10setSurfaceEPNS_7SurfaceE+140) #06 pc 000000000005123c /system/lib64/libhwui.so (_ZN7android10uirenderer12renderthreadL17Bridge_initializeEPNS1_14initializeArgsE+16) #07 pc 0000000000052fc4 /system/lib64/libhwui.so (_ZN7android10uirenderer12renderthread22MethodInvokeRenderTask3runEv+24) #08 pc 0000000000053f1c /system/lib64/libhwui.so (_ZN7android10uirenderer12renderthread12RenderThread10threadLoopEv+348) #09 pc 0000000000011670 /system/lib64/libutils.so (_ZN7android6Thread11_threadLoopEPv+280) #10 pc 00000000000be1e8 /system/lib64/libandroid_runtime.so (_ZN7android14AndroidRuntime15javaThreadShellEPv+136) #11 pc 00000000000671b8 /system/lib64/libc.so (_ZL15__pthread_startPv+36) #12 pc 000000000001eee4 /system/lib64/libc.so (__start_thread+68) 
0
Feb 07 '19 at 7:15
source share



All Articles