Android 7本机崩溃:libc。所以tgkill

时间:2022-04-27 06:17:07

I'm seeing this native crash with the following stack trace.

我看到这个本机崩溃与以下堆栈跟踪。

This happens in Android 7.0 & 7.1 only. Nothing new has been added to the app, which has been in production for a few years, but with more devices being updated to Nougat this crash happens frequently now and is becoming a nuisance.

这只发生在Android 7.0和7.1中。这款应用已经开发了好几年,没有什么新的东西被添加进来,但随着越来越多的设备被更新到Nougat上,这种崩溃现在经常发生,而且越来越令人讨厌。

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's a list of devices that are effected: Android 7本机崩溃:libc。所以tgkill

以下是受影响的设备列表:

UPDATE 7/18:

更新:7/18

Still unable to get to the root of this, so I decided to purchase a device which had most occurrences and was reasonably priced, which turned out to be Samsung Galaxy J3 2017 version with Android 7.0. But unfortunately still unable to reproduce the crash.

我仍然无法找到问题的根源,所以我决定购买一款出现次数最多、价格合理的设备,结果是三星Galaxy J3 2017版Android 7.0。但不幸的是仍然无法再现崩溃。

I've also made some memory usage improvements to the app in production, but the crash is still happening.

我还在产品中改进了应用程序的内存使用情况,但崩溃仍在发生。

From all the comments and my own research it seems to be related to dynamically linked NDKs, but I'm not using any and its hard to find out if any of the dependencies do.

从所有的评论和我自己的研究来看,它似乎与动态链接的NDKs有关,但我没有使用任何一种,也很难发现是否有任何依赖项。

I would like to share my dependencies, it would be great if other folks facing the same issue could call out if they are using one of the same dependencies - perhaps we can spot the culprit 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 folks facing the same crash, please respond in comments if you are using any of these dependencies / versions. Maybe we can single out the problem dependency.

如果您正在使用这些依赖项/版本,请在评论中回复遇到相同崩溃的用户。也许我们可以找出问题的依赖性。

5 个解决方案

#1


19  

Looking at the dump you provided gives some clues:

看看你提供的垃圾场就会发现一些线索:

_ZN7android10uirenderer12renderthread12RenderThread10threadLoopEv

_ZN7android10uirenderer12renderthread12RenderThread10threadLoopEv

This indicates that the error occurred in the UI thread.

这表明错误发生在UI线程中。

libhwui.so x 6

libhwui。所以x 6

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

这表明这发生在一些与图形/ui相关的代码中间。

libcutils.so - __android_log_assert

libcutils。所以,__android_log_assert

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

这是一个assert处理程序,因此在libwhui中很可能违反了某种断言。

abort:

终止:

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

这是应用程序告诉O/S关闭“异常”。

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

raise + pthread_kill + tgkill:这是O/S (Android)关闭应用程序。

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).

如果您在安装到Android日志查看器时发现了这个错误,您可能会得到更多特定于应用程序的数据(甚至是断言函数通常输出的错误消息)。

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.

我的建议是使用AGRA之类的工具来追踪与错误相关的所有细节,或者获取受影响的设备,并在附加到调试器时复制它。

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.

编辑2017-06-16:我只是想添加一些Fco p的额外信息,显然谷歌已经决定对本地库允许运行的最新版本的Android (7.x)做一些修改。更多细节在这个链接。

#2


5  

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

这里有报告: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".

复制:获取受影响的模式,启用开发人员模式,并将后台活动设置为0。还支持“显示背景崩溃”。

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

然后打开应用程序,再关闭它:你会看到崩溃。

#3


3  

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)

也许你可以像我们一样在viewpager中使用map fragment以及Koji Matsubara已经提到的很多人

#4


0  

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

我不知道,也许这个问题和我们的一样,可能不同,因为我在依赖项中看到包含carview。在这里分享希望,希望对未来的人有用

I also faced issue on Android 7.0 and 7.1 bellow

我还遇到了Android 7.0和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)

After research and search on gooogle, I replaced cardview by Framelayout then this issue was resolved

通过对gooogle的研究和搜索,我用Framelayout取代了cardview,从而解决了这个问题

#5


0  

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.

在我的例子中,问题出现在TextureView中,动画在单独的线程中,锁和解锁画布。

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

我把TextureView动画改成了7和7.1 android版的invalidate-onDraw动画,这对我很有帮助。

#1


19  

Looking at the dump you provided gives some clues:

看看你提供的垃圾场就会发现一些线索:

_ZN7android10uirenderer12renderthread12RenderThread10threadLoopEv

_ZN7android10uirenderer12renderthread12RenderThread10threadLoopEv

This indicates that the error occurred in the UI thread.

这表明错误发生在UI线程中。

libhwui.so x 6

libhwui。所以x 6

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

这表明这发生在一些与图形/ui相关的代码中间。

libcutils.so - __android_log_assert

libcutils。所以,__android_log_assert

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

这是一个assert处理程序,因此在libwhui中很可能违反了某种断言。

abort:

终止:

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

这是应用程序告诉O/S关闭“异常”。

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

raise + pthread_kill + tgkill:这是O/S (Android)关闭应用程序。

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).

如果您在安装到Android日志查看器时发现了这个错误,您可能会得到更多特定于应用程序的数据(甚至是断言函数通常输出的错误消息)。

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.

我的建议是使用AGRA之类的工具来追踪与错误相关的所有细节,或者获取受影响的设备,并在附加到调试器时复制它。

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.

编辑2017-06-16:我只是想添加一些Fco p的额外信息,显然谷歌已经决定对本地库允许运行的最新版本的Android (7.x)做一些修改。更多细节在这个链接。

#2


5  

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

这里有报告: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".

复制:获取受影响的模式,启用开发人员模式,并将后台活动设置为0。还支持“显示背景崩溃”。

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

然后打开应用程序,再关闭它:你会看到崩溃。

#3


3  

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)

也许你可以像我们一样在viewpager中使用map fragment以及Koji Matsubara已经提到的很多人

#4


0  

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

我不知道,也许这个问题和我们的一样,可能不同,因为我在依赖项中看到包含carview。在这里分享希望,希望对未来的人有用

I also faced issue on Android 7.0 and 7.1 bellow

我还遇到了Android 7.0和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)

After research and search on gooogle, I replaced cardview by Framelayout then this issue was resolved

通过对gooogle的研究和搜索,我用Framelayout取代了cardview,从而解决了这个问题

#5


0  

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.

在我的例子中,问题出现在TextureView中,动画在单独的线程中,锁和解锁画布。

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

我把TextureView动画改成了7和7.1 android版的invalidate-onDraw动画,这对我很有帮助。