programing tip

Android 7 네이티브 크래시 : libc.so tgkill

itbloger 2020. 8. 31. 07:32
반응형

Android 7 네이티브 크래시 : libc.so tgkill


다음 스택 추적에서이 기본 충돌이 발생합니다.

이는 Android 7.0 및 7.1에서만 발생합니다. 몇 년 동안 제작 된 앱에 새로운 기능이 추가되지 않았지만, 더 많은 기기가 Nougat로 업데이트됨에 따라이 충돌이 자주 발생하고 성가신 일이되고 있습니다.

조언을 주시면 감사하겠습니다.

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)

영향을받는 장치 목록은 다음과 같습니다. 여기에 이미지 설명 입력

7/18 업데이트 :

여전히 이것의 근원에 도달 할 수 없었기 때문에 나는 가장 많이 발생하고 합리적인 가격의 기기를 구입하기로 결정했는데, 이는 Android 7.0이 설치된 Samsung Galaxy J3 2017 버전으로 판명되었습니다. 그러나 불행히도 여전히 충돌을 재현 할 수 없습니다.

또한 프로덕션에서 앱의 메모리 사용량을 개선했지만 여전히 충돌이 발생하고 있습니다.

모든 의견과 내 자신의 연구에서 동적으로 연결된 NDK와 관련된 것 같지만 종속성이 있는지 확인하기가 어렵습니다.

나는 내 의존성을 공유하고 싶습니다. 같은 문제에 직면 한 다른 사람들이 같은 의존성 중 하나를 사용하고 있는지 호출 할 수 있다면 좋을 것입니다. 아마도 우리는이 방법으로 범인을 찾을 수 있습니다.

// 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; }

동일한 충돌에 직면 한 사람들의 경우 이러한 종속성 / 버전을 사용하는 경우 주석으로 응답하십시오. 아마도 우리는 문제의 의존성을 골라 낼 수있을 것입니다.


제공 한 덤프를 살펴보면 몇 가지 단서가 제공됩니다.

_ZN7android10uirenderer12renderthread12RenderThread10threadLoopEv

이는 UI 스레드에서 오류가 발생했음을 나타냅니다.

libhwui.so x 6

이것은 일부 그래픽 / UI 관련 코드 중간에서 발생하고 있음을 나타냅니다.

libcutils.so-__android_log_assert

This is an assert handler, so most likely some kind of assert was violated in libwhui.

abort:

This is the application telling the O/S to shut down "abnormally".

raise + pthread_kill + tgkill: This is the O/S (Android) shutting down the app.

You can see some documentation for debugging these kinds of crashes here.

Anyway, I am afraid it is really difficult to speculate beyond this coarse and imprecise interpretation of the data you presented.

Maybe if you caught the bug while it was attached to the Android log viewer, you would have more application specific data (or even an error message which the assert function usually puts out).

My tip is to use something like AGRA to track down all the details pertaining to the error, or get hold of an affected device and actually reproduce it while attached to a debugger.

Good luck!

EDIT 2017-06-16: I just want to add some extra info courtesy comment by Fco P. Apparently Google has decided to make some changes to what native libraries are allowed to run in latest versions of Android (7.x). More details are in this link.


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

To reproduce: Get an affected mode, enable developer mode, and set background activities to 0. Also enable "show background crashes".

Then open the app, and close it again: You will see the crash.


Not in comments (insufficient rep).

Of the dependencies you have 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 strong suspection that play-services-maps contains the bug.

Perhaps you use map fragment in viewpager as we do and many people in issue already mentioned by Koji Matsubara (https://issuetracker.google.com/issues/37123764)


I had the same issue in google play console for the same devices as you.

In my case the issue was in TextureView with animation in separate thread with lock and unlock canvas.

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


I don't know, maybe this problem like ours, maybe different, because I see in dependencies have including carview. Share here hope useful for someone in future

I also faced issue on Android 7.0 and 7.1 bellow

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)

저렴한 비용으로 Google에 대한 연구 및 검색 후, 나는 대체 cardview에 의해 Framelayout이 문제가 해결 된 후,


Android 8.0을 실행하는 한 사용자의 기기 인 'Huawei Honor 7X (HWBND-H)'의 충돌 보고서에서이 문제가 표시됩니다. 다른 장치 / OS 버전의 경우 현장에서 발생하지 않기 때문에 OS 업데이트에서 이미 수정되었을 수 있습니다 (이 사용자가 선택하지 않았거나 Huawei가 제공하지 않았을 수 있음).

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)

참고 URL : https://stackoverflow.com/questions/44080809/android-7-native-crash-libc-so-tgkill

반응형