Unity 2020.3.41,出现问题的GPU机型有GE 8320、GE 8322和GE 8100,最容易崩溃的设备是小米Redmi 6A、Redmi 9 C、Redmi 9A、realme C21。
一些堆栈跟踪:
1(Google Play控制台):
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> com.fruitshake.fairyrpg <<<
backtrace:
#00 pc 0x0000000002691b1c /data/app/~~glJ5zj2YuTXCLtOwQQBW9Q==/com.google.android.trichromelibrary_530409130-5JNvmPvdeqWxll114AWxEQ==/base.apk!libmonochrome.so
#01 pc 0x0000000000dbe585 /data/app/~~glJ5zj2YuTXCLtOwQQBW9Q==/com.google.android.trichromelibrary_530409130-5JNvmPvdeqWxll114AWxEQ==/base.apk!libmonochrome.so
#02 pc 0x000000000327bfc5 /data/app/~~glJ5zj2YuTXCLtOwQQBW9Q==/com.google.android.trichromelibrary_530409130-5JNvmPvdeqWxll114AWxEQ==/base.apk!libmonochrome.so
#03 pc 0x0000000002e02caf /data/app/~~glJ5zj2YuTXCLtOwQQBW9Q==/com.google.android.trichromelibrary_530409130-5JNvmPvdeqWxll114AWxEQ==/base.apk!libmonochrome.so
#04 pc 0x0000000002e384ed /data/app/~~glJ5zj2YuTXCLtOwQQBW9Q==/com.google.android.trichromelibrary_530409130-5JNvmPvdeqWxll114AWxEQ==/base.apk!libmonochrome.so
#05 pc 0x0000000002e387c7 /data/app/~~glJ5zj2YuTXCLtOwQQBW9Q==/com.google.android.trichromelibrary_530409130-5JNvmPvdeqWxll114AWxEQ==/base.apk!libmonochrome.so
#06 pc 0x0000000002e4c1db /data/app/~~glJ5zj2YuTXCLtOwQQBW9Q==/com.google.android.trichromelibrary_530409130-5JNvmPvdeqWxll114AWxEQ==/base.apk!libmonochrome.so
#07 pc 0x0000000002e4c18d /data/app/~~glJ5zj2YuTXCLtOwQQBW9Q==/com.google.android.trichromelibrary_530409130-5JNvmPvdeqWxll114AWxEQ==/base.apk!libmonochrome.so
#08 pc 0x0000000002e4c147 /data/app/~~glJ5zj2YuTXCLtOwQQBW9Q==/com.google.android.trichromelibrary_530409130-5JNvmPvdeqWxll114AWxEQ==/base.apk!libmonochrome.so
#09 pc 0x0000000001db285f /data/app/~~glJ5zj2YuTXCLtOwQQBW9Q==/com.google.android.trichromelibrary_530409130-5JNvmPvdeqWxll114AWxEQ==/base.apk!libmonochrome.so
#10 pc 0x0000000000dc5969 /data/app/~~glJ5zj2YuTXCLtOwQQBW9Q==/com.google.android.trichromelibrary_530409130-5JNvmPvdeqWxll114AWxEQ==/base.apk!libmonochrome.so
#11 pc 0x0000000000dc5ab5 /data/app/~~glJ5zj2YuTXCLtOwQQBW9Q==/com.google.android.trichromelibrary_530409130-5JNvmPvdeqWxll114AWxEQ==/base.apk!libmonochrome.so
#12 pc 0x0000000001db285f /data/app/~~glJ5zj2YuTXCLtOwQQBW9Q==/com.google.android.trichromelibrary_530409130-5JNvmPvdeqWxll114AWxEQ==/base.apk!libmonochrome.so
#13 pc 0x0000000000dc5d87 /data/app/~~glJ5zj2YuTXCLtOwQQBW9Q==/com.google.android.trichromelibrary_530409130-5JNvmPvdeqWxll114AWxEQ==/base.apk!libmonochrome.so
#14 pc 0x0000000000dc61e7 /data/app/~~glJ5zj2YuTXCLtOwQQBW9Q==/com.google.android.trichromelibrary_530409130-5JNvmPvdeqWxll114AWxEQ==/base.apk!libmonochrome.so
#15 pc 0x0000000000dbd899 /data/app/~~glJ5zj2YuTXCLtOwQQBW9Q==/com.google.android.trichromelibrary_530409130-5JNvmPvdeqWxll114AWxEQ==/base.apk!libmonochrome.so
#16 pc 0x0000000000dbca73 /data/app/~~glJ5zj2YuTXCLtOwQQBW9Q==/com.google.android.trichromelibrary_530409130-5JNvmPvdeqWxll114AWxEQ==/base.apk!libmonochrome.so
#17 pc 0x0000000000dc267b /data/app/~~glJ5zj2YuTXCLtOwQQBW9Q==/com.google.android.trichromelibrary_530409130-5JNvmPvdeqWxll114AWxEQ==/base.apk!libmonochrome.so
#18 pc 0x0000000000db7983 /data/app/~~glJ5zj2YuTXCLtOwQQBW9Q==/com.google.android.trichromelibrary_530409130-5JNvmPvdeqWxll114AWxEQ==/base.apk!libmonochrome.so
#19 pc 0x00000000000024cd /system/lib/libwebviewchromium_plat_support.so (android::(anonymous namespace)::draw_gl(int, void*, android::uirenderer::DrawGlInfo const&)+228)
#20 pc 0x0000000000160b13 /system/lib/libhwui.so (android::uirenderer::WebViewFunctor::drawGl(android::uirenderer::DrawGlInfo const&)+34)
#21 pc 0x0000000000142539 /system/lib/libhwui.so (android::uirenderer::skiapipeline::GLFunctorDrawable::onDraw(SkCanvas*)+1720)
#22 pc 0x00000000001b8401 /system/lib/libhwui.so (SkDrawable::draw(SkCanvas*, SkMatrix const*)+44)
#23 pc 0x00000000003e0c2f /system/lib/libhwui.so (SkGpuDevice::drawDrawable(SkDrawable*, SkMatrix const*, SkCanvas*)+206)
#24 pc 0x0000000000113cb9 /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::drawContent(SkCanvas*) const+1020)
#25 pc 0x0000000000114523 /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+198)
#26 pc 0x000000000012a249 /system/lib/libhwui.so (android::uirenderer::$_24::__invoke(void const*, SkCanvas*, SkMatrix const&)+44)
#27 pc 0x0000000000113ced /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::drawContent(SkCanvas*) const+1072)
#28 pc 0x0000000000114523 /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+198)
#29 pc 0x000000000012a249 /system/lib/libhwui.so (android::uirenderer::$_24::__invoke(void const*, SkCanvas*, SkMatrix const&)+44)
#30 pc 0x0000000000113cd5 /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::drawContent(SkCanvas*) const+1048)
#31 pc 0x0000000000114523 /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+198)
#32 pc 0x000000000012a249 /system/lib/libhwui.so (android::uirenderer::$_24::__invoke(void const*, SkCanvas*, SkMatrix const&)+44)
#33 pc 0x0000000000113ced /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::drawContent(SkCanvas*) const+1072)
#34 pc 0x0000000000114523 /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+198)
#35 pc 0x000000000012a249 /system/lib/libhwui.so (android::uirenderer::$_24::__invoke(void const*, SkCanvas*, SkMatrix const&)+44)
#36 pc 0x0000000000113cd5 /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::drawContent(SkCanvas*) const+1048)
#37 pc 0x0000000000114523 /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+198)
#38 pc 0x000000000012a249 /system/lib/libhwui.so (android::uirenderer::$_24::__invoke(void const*, SkCanvas*, SkMatrix const&)+44)
#39 pc 0x0000000000113ced /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::drawContent(SkCanvas*) const+1072)
#40 pc 0x0000000000114523 /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+198)
#41 pc 0x000000000012a249 /system/lib/libhwui.so (android::uirenderer::$_24::__invoke(void const*, SkCanvas*, SkMatrix const&)+44)
#42 pc 0x0000000000113cd5 /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::drawContent(SkCanvas*) const+1048)
#43 pc 0x0000000000114523 /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+198)
#44 pc 0x00000000001475c7 /system/lib/libhwui.so (android::uirenderer::skiapipeline::SkiaPipeline::renderFrameImpl(SkRect const&, std::__1::vector<android::sp<android::uirenderer::RenderNode>, std::__1::allocator<android::sp<android::uirenderer::RenderNode> > > const&, bool, android::uirenderer::Rect const&, SkCanvas*, SkMatrix const&)+474)
#45 pc 0x00000000001472df /system/lib/libhwui.so (android::uirenderer::skiapipeline::SkiaPipeline::renderFrame(android::uirenderer::LayerUpdateQueue const&, SkRect const&, std::__1::vector<android::sp<android::uirenderer::RenderNode>, std::__1::allocator<android::sp<android::uirenderer::RenderNode> > > const&, bool, android::uirenderer::Rect const&, sk_sp<SkSurface>, SkMatrix const&)+94)
#46 pc 0x00000000001451bd /system/lib/libhwui.so (android::uirenderer::skiapipeline::SkiaOpenGLPipeline::draw(android::uirenderer::renderthread::Frame const&, SkRect const&, SkRect const&, android::uirenderer::LightGeometry const&, android::uirenderer::LayerUpdateQueue*, android::uirenderer::Rect const&, bool, android::uirenderer::LightInfo const&, std::__1::vector<android::sp<android::uirenderer::RenderNode>, std::__1::allocator<android::sp<android::uirenderer::RenderNode> > > const&, android::uirenderer::FrameInfoVisualizer*)+272)
#47 pc 0x000000000014bb11 /system/lib/libhwui.so (android::uirenderer::renderthread::CanvasContext::draw()+976)
#48 pc 0x000000000014d3db /system/lib/libhwui.so (_ZNSt3__110__function6__funcIZN7android10uirenderer12renderthread13DrawFrameTask11postAndWaitEvE3$_0NS_9allocatorIS6_EEFvvEEclEv$c303f2d2360db58ed70a2d0ac7ed911b+458)
#49 pc 0x000000000014059f /system/lib/libhwui.so (android::uirenderer::WorkQueue::process()+162)
#50 pc 0x00000000001573b9 /system/lib/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+72)
#51 pc 0x000000000000ee95 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+168)
#52 pc 0x000000000000e9dd /system/lib/libutils.so (thread_data_t::trampoline(thread_data_t const*)+256)
#53 pc 0x00000000000aacf3 /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40)
#54 pc 0x0000000000064063 /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)
2(火力基地):
Crashed: Thread: SIGSEGV 0x0000000000000000
#00 pc 0x142bb0 libGLESv2_mtk.so
#01 pc 0x854d5 libGLESv2_mtk.so
#02 pc 0x3222a libGLESv2_mtk.so
#03 pc 0x27a44 libGLESv2_mtk.so
#04 pc 0x2e861 libGLESv2_mtk.so
#05 pc 0xbb2b2 libc.so
我知道堆栈跟踪非常模糊,但我不知道如何使它们更可读。我已经上传了我的应用程序的符号到Firebase和Google Play。
在Unity的论坛上也有类似的thread。
如果您对如何解决或研究这个问题有任何想法,请帮助!
1条答案
按热度按时间2q5ifsrm1#
它可以通过绘制1x1px的矩形来解决(至少这对我有帮助),每帧都有不同的颜色。
弗洛里安·彭茨科弗:根本原因是PowerVR驱动程序中的一个错误,驱动程序优化的绘制调用泄漏了一些内存。该内存缓冲区的每个帧缓冲区(RenderTexture)有一个固定的大小,用完该内存会导致崩溃。未优化的单个绘制调用会回收泄漏的内存,因此只有当所有绘制到同一帧缓冲区(跨多个帧)的操作都是冗余的时,才会导致问题。
驱动程序无法优化每一帧的“随机”绘制调用。第二个选项是创建本地渲染插件,在Unity的repo中有示例插件。您需要剔除glFlush,如前一个答案所述:
在我们的实验中,大约每1000帧调用一次glFinish会有帮助(或者更频繁,但这会导致GPU停滞,因此成本很高)。您可以使用本地渲染插件尝试这样做。我们获得了一些关于受影响的驱动程序何时泄漏内存导致此问题的更多信息。我们将对此进行研究,以找到更好的解决方案。