alibaba / AndFix

AndFix is a library that offer hot-fix for Android App.
Other
6.97k stars 1.6k forks source link

兼容测试发现 4.0.4 全跪了 其他基本正常 #40

Open 6a209 opened 9 years ago

6a209 commented 9 years ago

堆栈是这样的~

#2043   09-30 16:15:43.223  26643   E   Posix    [CDS]Libcore_io_Posix-throwErrnoException, functionName: remove; errno: No such file or directory
#2044   09-30 16:15:43.246  26643   E   AndFix   setup error: dexProtoGetParameterCount_fnPtr
#2045   09-30 16:15:43.246  26643   E   Posix    [CDS]Libcore_io_Posix-throwErrnoException, functionName: access; errno: No such file or directory
#2046   09-30 16:15:43.247  26643   E   Posix    [CDS]Libcore_io_Posix-throwErrnoException, functionName: access; errno: No such file or directory```

主要错误都是这句 =》 #2044 09-30 16:15:43.246  26643   E   AndFix  
**setup error: dexProtoGetParameterCount_fnPtr**  
应该就是拿不到这货的函数指针~

然后跟了一下源码   
    dexProtoGetParameterCount_fnPtr = dvm_dlsym(dvm_hand,
            apilevel > 10 ?
                        "_Z25dexProtoGetParameterCountPK8DexProto" :
                    "dexProtoGetParameterCount");


4.0.4 取的应该是 _Z25dexProtoGetParameterCountPK8DexProto  查阅了aosp源码 里面只有 dexProtoGetParameterCount 这个方法的定义,没有找到_Z25dexProtoGetParameterCountPK8DexProto
在setup 里面有大量这种类似的代码,都是判断apilevel > 10 则用一个看起来比较奇怪的方法名(是链接后的函数名么?)     为什么要这么使用呢?
6a209 commented 9 years ago

这是在testin上的测试结果~ 然后出事的基本上都是4.0.4 log 就是上面我发的~

2015-09-30 6 05 08 2015-09-30 6 04 06
zhy1905 commented 9 years ago

@6a209 我的系统4.0.4的为何没有跪?不要太相信testin,自己动手测试

6a209 commented 9 years ago

@gdgm123 问题是我手里没有4.0.4的手机 ~ 我也不确定是不是所有的 4.0.4 都会挂,我想找一台会挂的机子,然后导出里面 的libdvm.so 然后用 ndk > toolchains 下的 arm-objdump dump 一下这个so包 如果里面有 _Z25dexProtoGetParameterCountPK8DexProto 这个就不会挂~ 如果不一致 肯定会挂~; 我猜测有些机型,这个值可能不长这样~