android librt.so,Android 7 Native Crash: libc.so tgkill

博客作者遇到了一个只在Android 7.0和7.1上发生的原生应用崩溃问题。崩溃日志显示可能与动态链接的NDK库有关,但作者并未使用NDK。已尝试购买受影响设备进行复现,但未成功。同时,应用已进行了内存使用优化,但崩溃仍在继续。作者列出了一组依赖库,希望能与其他遇到相同问题的人共享,共同找出问题所在。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.

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: 2561f70499bf5c75df6b6cffc16662ae.png

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

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.

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值