我是靠谱客的博主 温柔菠萝,最近开发中收集的这篇文章主要介绍硬件加速hardwareAccelerated和旋转监听器OrientationEventListener引发的RenderThread崩溃现象解决方案思考,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

文章目录

  • 现象
  • 解决方案
  • 思考

现象

Native层崩溃:

F/DEBUG
( 9546): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
F/DEBUG
( 9546): Build fingerprint: 'Xiaomi/venus/venus:12/SKQ1.211006.001/V13.0.5.0.SKBCNXM:user/release-keys'
F/DEBUG
( 9546): Revision: '0'
F/DEBUG
( 9546): ABI: 'arm64'
F/DEBUG
( 9546): Timestamp: 2022-03-28 11:24:19.745921800+0800
F/DEBUG
( 9546): Process uptime: 0s
F/DEBUG
( 9546): Cmdline: com.xxx.xxx
F/DEBUG
( 9546): pid: 28654, tid: 28782, name: RenderThread
>>> com.xxx.xxx <<<
F/DEBUG
( 9546): uid: 10372
F/DEBUG
( 9546): signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
F/DEBUG
( 9546): Abort message: 'exiting due to SIG_DFL handler for signal 11'
F/DEBUG
( 9546):
x0
0000000000000000
x1
000000000000706e
x2
0000000000000006
x3
00000074ad49ec60
F/DEBUG
( 9546):
x4
0000000080808080
x5
0000000080808080
x6
0000000080808080
x7
8080808080808080
F/DEBUG
( 9546):
x8
00000000000000f0
x9
04a0bbe8354a4d5b
x10 0000000000000000
x11 ffffff80fffffbdf
F/DEBUG
( 9546):
x12 0000000000000001
x13 00001493d1d15bbe
x14 0022da5e804d9ad2
x15 0000000000000028
F/DEBUG
( 9546):
x16 00000074a57d6d30
x17 00000074a57b0650
x18 0000007352600000
x19 0000000000006fee
F/DEBUG
( 9546):
x20 000000000000706e
x21 00000000ffffffff
x22 00000074ad49ee48
x23 00000074ad7f2708
F/DEBUG
( 9546):
x24 0000000000000040
x25 00000073527f6000
x26 000000000000000b
x27 00000074ad7f2328
F/DEBUG
( 9546):
x28 0000000000000000
x29 00000074ad49ece0
F/DEBUG
( 9546):
lr
00000074a57609fc
sp
00000074ad49ec40
pc
00000074a5760a28
pst 0000000000001000
F/DEBUG
( 9546): backtrace:
F/DEBUG
( 9546):
#00 pc 000000000008aa28
/apex/com.android.runtime/lib64/bionic/libc.so (abort+168) (BuildId: 94065bf91428f6ae9fb310c478171302)
F/DEBUG
( 9546):
#01 pc 0000000000002540
/apex/com.android.art/lib64/libsigchain.so (art::SignalChain::Handler(int, siginfo*, void*)+1184) (BuildId: 161c53f67386ada92922750b03eafb01)
F/DEBUG
( 9546):
#02 pc 00000000000005c0
[vdso] (__kernel_rt_sigreturn+0)
F/DEBUG
( 9546):
#03 pc 000000000000eddc
/system/lib64/libutils.so (android::RefBase::incStrong(void const*) const+8) (BuildId: 16796d84bdcf185b2112267dbd820c19)
F/DEBUG
( 9546):
#04 pc 000000000012f62c
/system/lib64/libandroid_runtime.so (android::nativeSetFlags(_JNIEnv*, _jclass*, long, long, int, int)+88) (BuildId: a5083b66961fff465289f8b6e4a455bd)
F/DEBUG
( 9546):
#05 pc 00000000001983f8
/system/framework/arm64/boot-framework.oat (art_jni_trampoline+120) (BuildId: 68ab7b2bce89e5f1bca3dd69f3bdb76d49ddc9ea)
F/DEBUG
( 9546):
#06 pc 00000000006f1b88
/system/framework/arm64/boot-framework.oat (android.view.SurfaceControl$Transaction.hide+200) (BuildId: 68ab7b2bce89e5f1bca3dd69f3bdb76d49ddc9ea)
F/DEBUG
( 9546):
#07 pc 0000000000212520
/apex/com.android.art/lib64/libart.so (nterp_helper+4016) (BuildId: fe3937ecd54810f2c0342e5633a5d7a7)
F/DEBUG
( 9546):
#08 pc 000000000033105a
/system/framework/framework.jar
F/DEBUG
( 9546):
#09 pc 0000000000393074
/system/framework/arm64/boot-framework.oat (android.graphics.RenderNode$CompositePositionUpdateListener.positionLost+116) (BuildId: 68ab7b2bce89e5f1bca3dd69f3bdb76d49ddc9ea)
F/DEBUG
( 9546):
#10 pc 0000000000218964
/apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: fe3937ecd54810f2c0342e5633a5d7a7)
F/DEBUG
( 9546):
#11 pc 0000000000285ff0
/apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+192) (BuildId: fe3937ecd54810f2c0342e5633a5d7a7)
F/DEBUG
( 9546):
#12 pc 000000000062e394
/apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithVarArgs<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, std::__va_list)+472) (BuildId: fe3937ecd54810f2c0342e5633a5d7a7)
F/DEBUG
( 9546):
#13 pc 000000000062e53c
/apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+96) (BuildId: fe3937ecd54810f2c0342e5633a5d7a7)
F/DEBUG
( 9546):
#14 pc 000000000047d8ac
/apex/com.android.art/lib64/libart.so (art::JNI<false>::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+624) (BuildId: fe3937ecd54810f2c0342e5633a5d7a7)
F/DEBUG
( 9546):
#15 pc 0000000000497424
/system/lib64/libhwui.so (_JNIEnv::CallVoidMethod(_jobject*, _jmethodID*, ...)+124) (BuildId: 2e2637f133ef8150686ad4819553cb73)
F/DEBUG
( 9546):
#16 pc 000000000049ce38
/system/lib64/libhwui.so (_ZZN7androidL46android_view_RenderNode_requestPositionUpdatesEP7_JNIEnvP8_jobjectlS3_EN26PositionListenerTrampoline14onPositionLostERNS_10uirenderer10RenderNodeEPKNS5_8TreeInfoE$e08e5be7d6b9d462d36dec99da9de1de+200) (BuildId: 2e2637f133ef8150686ad4819553cb73)
F/DEBUG
( 9546):
#17 pc 00000000003f84a4
/system/lib64/libhwui.so (android::uirenderer::RenderNode::deleteDisplayList(android::uirenderer::TreeObserver&, android::uirenderer::TreeInfo*)+356) (BuildId: 2e2637f133ef8150686ad4819553cb73)
F/DEBUG
( 9546):
#18 pc 00000000003f82b0
/system/lib64/libhwui.so (android::uirenderer::RenderNode::destroyHardwareResources(android::uirenderer::TreeInfo*)+96) (BuildId: 2e2637f133ef8150686ad4819553cb73)
F/DEBUG
( 9546):
#19 pc 000000000020abc4
/system/lib64/libhwui.so (_ZNSt3__110__function6__funcIZN7android10uirenderer10RenderNode17deleteDisplayListERNS3_12TreeObserverEPNS3_8TreeInfoEE3$_4NS_9allocatorIS9_EEFvPS4_EEclEOSC_$e57263280ae2783a7a89a2e0f9451ccb+80) (BuildId: 2e2637f133ef8150686ad4819553cb73)
F/DEBUG
( 9546):
#20 pc 00000000003f84a4
/system/lib64/libhwui.so (android::uirenderer::RenderNode::deleteDisplayList(android::uirenderer::TreeObserver&, android::uirenderer::TreeInfo*)+356) (BuildId: 2e2637f133ef8150686ad4819553cb73)
F/DEBUG
( 9546):
#21 pc 00000000003f82b0
/system/lib64/libhwui.so (android::uirenderer::RenderNode::destroyHardwareResources(android::uirenderer::TreeInfo*)+96) (BuildId: 2e2637f133ef8150686ad4819553cb73)
F/DEBUG
( 9546):
#22 pc 00000000003d6114
/system/lib64/libhwui.so (android::uirenderer::MarkAndSweepRemoved::~MarkAndSweepRemoved()+300) (BuildId: 2e2637f133ef8150686ad4819553cb73)
F/DEBUG
( 9546):
#23 pc 00000000003d5f60
/system/lib64/libhwui.so (android::uirenderer::RenderNode::prepareTree(android::uirenderer::TreeInfo&)+172) (BuildId: 2e2637f133ef8150686ad4819553cb73)
F/DEBUG
( 9546):
#24 pc 00000000004dc594
/system/lib64/libhwui.so (android::uirenderer::RootRenderNode::prepareTree(android::uirenderer::TreeInfo&)+180) (BuildId: 2e2637f133ef8150686ad4819553cb73)
F/DEBUG
( 9546):
#25 pc 00000000003c0ea4
/system/lib64/libhwui.so (android::uirenderer::renderthread::CanvasContext::prepareTree(android::uirenderer::TreeInfo&, long*, long, android::uirenderer::RenderNode*)+340) (BuildId: 2e2637f133ef8150686ad4819553cb73)
F/DEBUG
( 9546):
#26 pc 00000000003c0464
/system/lib64/libhwui.so (_ZNSt3__110__function6__funcIZN7android10uirenderer12renderthread13DrawFrameTask11postAndWaitEvE3$_0NS_9allocatorIS6_EEFvvEEclEv$c1671e787f244890c877724752face20+420) (BuildId: 2e2637f133ef8150686ad4819553cb73)
F/DEBUG
( 9546):
#27 pc 00000000003d4914
/system/lib64/libhwui.so (android::uirenderer::WorkQueue::process()+160) (BuildId: 2e2637f133ef8150686ad4819553cb73)
F/DEBUG
( 9546):
#28 pc 00000000003d4674
/system/lib64/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+88) (BuildId: 2e2637f133ef8150686ad4819553cb73)
F/DEBUG
( 9546):
#29 pc 000000000001358c
/system/lib64/libutils.so (android::Thread::_threadLoop(void*)+264) (BuildId: 16796d84bdcf185b2112267dbd820c19)
F/DEBUG
( 9546):
#30 pc 0000000000012de8
/system/lib64/libutils.so (thread_data_t::trampoline(thread_data_t const*)+408) (BuildId: 16796d84bdcf185b2112267dbd820c19)
F/DEBUG
( 9546):
#31 pc 00000000000efb14
/apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+264) (BuildId: 94065bf91428f6ae9fb310c478171302)
F/DEBUG
( 9546):
#32 pc 000000000008c35c
/apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+68) (BuildId: 94065bf91428f6ae9fb310c478171302)

不是必现,但是几率有的,越是性能好的手机越是出,每次都是一样的backtrace。

解决方案

考虑到是RenderThread,首先关闭硬件加速,确实有效,但不是最终解决方案。

通过长时间的尝试,发现在屏幕旋转的时候出。于是发现有使用OrientationEventListener#enable()和OrientationEventListener#disable(),删除后问题解决。

思考

OrientationEventListener和硬件加速为何使RenderThread崩溃尚不清楚。

最后

以上就是温柔菠萝为你收集整理的硬件加速hardwareAccelerated和旋转监听器OrientationEventListener引发的RenderThread崩溃现象解决方案思考的全部内容,希望文章能够帮你解决硬件加速hardwareAccelerated和旋转监听器OrientationEventListener引发的RenderThread崩溃现象解决方案思考所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(39)

评论列表共有 0 条评论

立即
投稿
返回
顶部