修复移植GSI时surfaceflinger报错

(原文链接:点此跳转 翻译:九面相柳。转载必须附上原文信息及本文链接)

Log信息如下:

F DEBUG  : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
F DEBUG  : Build fingerprint: 'Lenovo/jd2019/jd2019:9/PKQ1.180929.001/10.5.222_181213:user/release-keys'
F DEBUG  : Revision: '0'
F DEBUG  : ABI: 'arm64'
F DEBUG  : pid: 741, tid: 741, name: surfaceflinger  >>> /system/bin/surfaceflinger <<<
F DEBUG  : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x896600000000
F DEBUG  :  x0  000000762dfab510  x1  0000000000000000  x2  0000000000000000  x3  0000000000000001
F DEBUG  :  x4  0000000c0a005181  x5  0000000c0a005181  x6  000000763142bae8  x7  0000000000000000
F DEBUG  :  x8  0000896600000000  x9  0000000000000002  x10 0000000000000001  x11 0000000000000000
F DEBUG  :  x12 0000000000000002  x13 0000000000000002  x14 0000000000000000  x15 0000000000000001
F DEBUG  :  x16 00000076b1ea6c40  x17 00000076b20ccb74  x18 0000000000000000  x19 000000762dc74000
F DEBUG  :  x20 0000007fc1e6b180  x21 0000007fc1e6b1b0  x22 0000000000000000  x23 0000000000000001
F DEBUG  :  x24 0000000000000000  x25 0000007631491820  x26 00000076b4fa95e0  x27 00000076b1cf5120
F DEBUG  :  x28 00000076b1cf5060  x29 0000007fc1e6af60
F DEBUG  :  sp  0000007fc1e6af50  lr  00000076b1df45fc  pc  00000076b1df4610
F DEBUG  :
F DEBUG  : backtrace:
F DEBUG  :  #00 pc 00000000000ef610  /system/lib64/libsurfaceflinger.so (android::ExBufferLayer::isHDRLayer() const+48)
F DEBUG  :  #01 pc 000000000006a31c  /system/lib64/libsurfaceflinger.so (android::BufferLayer::onDraw(android::RenderArea const&, android::Region const&, bool) const+200)
F DEBUG  :  #02 pc 00000000000bff1c  /system/lib64/libsurfaceflinger.so (android::SurfaceFlinger::doComposeSurfaces(android::sp<android::DisplayDevice const> const&)+1632)
F DEBUG  :  #03 pc 00000000000bd0e0  /system/lib64/libsurfaceflinger.so (android::SurfaceFlinger::handleMessageRefresh()+2832)
F DEBUG  :  #04 pc 00000000000ee9d0  /system/lib64/libsurfaceflinger.so (android::ExSurfaceFlinger::handleMessageRefresh()+16)
F DEBUG  :  #05 pc 00000000000bc51c  /system/lib64/libsurfaceflinger.so (android::SurfaceFlinger::onMessageReceived(int)+3784)
F DEBUG  :  #06 pc 0000000000014e04  /system/lib64/libutils.so (android::Looper::pollInner(int)+336)
F DEBUG  :  #07 pc 0000000000014c18  /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+60)
F DEBUG  :  #08 pc 00000000000ab710  /system/lib64/libsurfaceflinger.so (android::impl::MessageQueue::waitMessage()+84)
F DEBUG  :  #09 pc 00000000000bacf4  /system/lib64/libsurfaceflinger.so (android::SurfaceFlinger::run()+20)
F DEBUG  :  #10 pc 00000000000031f0  /system/bin/surfaceflinger (main+932)
F DEBUG  :  #11 pc 00000000000ca784  /system/lib64/libc.so (__libc_init+88)

工具

  • Hopper disassembler
  1. 用Hopper打开libsurfaceflinger.so;
  2. 从log报错中找到isHDRLayer的偏移,并在Hopper找到它;
    F DEBUG : #00 pc 00000000000ef610 /system/lib64/libsurfaceflinger.so (android::ExBufferLayer::isHDRLayer() const+48)

    (此处偏移为:00000000000ef610)

  3. 在这个函数中找到第一个cbz并选中它(例如此处,第一个cbz的偏移为0xef5f4)
  4. 切换到16进制编辑模式,双击,把“B4”改为“B5”(这样会吧cbz改为cbnz,如下图)
  5. 保存文件:“file——produce new executable”
  6. 完成

声明: 本文由(九面相柳)原创编译,转载请保留链接: 修复移植GSI时surfaceflinger报错

修复移植GSI时surfaceflinger报错:等您坐沙发呢!

发表评论