OpenFDE技术解析(三):如何在linux电脑上成功跑通安卓原神

背景

自从原神 4.3版本在2023年12月20日左右升级之后,对于amd gpu并没有专门的支持,amd gpu 运行时会崩溃在libgallium库(mesa提出的全新的3D引擎框架)中。

解决过程

查看waydroid上的issue,可以看到有很多大神尝试了不同的原神版本,都会崩溃。​编辑[BUG] Genshin Impact 4.3.0 crashed · Issue #1206 · waydroid/waydroid

以上代码包含了pc值,这就可以通过addr2line命令查看进入到aosp源代码的out/target/product/fde_arm64/symbols/vendor/lib64/dri目录下,可以看到有一个libgallimu_dri.so。使用addrline命令查看pc指针000000000099e844对应的源代码。可以看到代码在src/mesa/main/texobj.c 的620行。

openfde/out/target/product/fde_arm64/symbols/vendor/lib64/dri$ addr2line  000000000099e844 -e  libgallium_dri.so 
openfde/external/mesa/src/mesa/main/texobj.c:620
#打开该文件看到:
 609 /**
 610  * Reference (or unreference) a texture object.
 611  * If '*ptr', decrement *ptr's refcount (and delete if it becomes zero).
 612  * If 'tex' is non-null, increment its refcount.
 613  * This is normally only called from the _mesa_reference_texobj() macro
 614  * when there's a real pointer change.
 615  */
 616 void
 617 _mesa_reference_texobj_(struct gl_texture_object **ptr,
 618                         struct gl_texture_object *tex)
 619 {
 620    assert(ptr);
 621 
 622    if (*ptr) {
 623       /* Unreference the old texture */
 624       struct gl_texture_object *oldTex = *ptr;
 625 
 626       assert(valid_texture_object(oldTex));
 627       (void) valid_texture_object; /* silence warning in release builds */
 628 
 629       assert(oldTex->RefCount > 0);
 630 
 631       if (p_atomic_dec_zero(&oldTex->RefCount)) {

看倒620行是assert(ptr)。这是一个断言,说明ptr是不合法的指针。针对这个crash找不到更多线索。想着打开mesa的调试开关试试能不能找到其他有用的信息,打开调试开关,重新编译mesa,运行发现崩溃的地方变了,崩溃在external/mes

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值