Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

部分手机loadPluginLoader发生RuntimeException #828

Closed
SkywardSky opened this issue Feb 24, 2022 · 2 comments · Fixed by #829
Closed

部分手机loadPluginLoader发生RuntimeException #828

SkywardSky opened this issue Feb 24, 2022 · 2 comments · Fixed by #829

Comments

@SkywardSky
Copy link

代码是直接下载github的,未更改任何代码,直接运行,但在一些手机运行就会崩溃,奔溃的堆栈是这样的:

2022-02-24 19:37:10.948 742-742/? I/: power log dlsym ok
2022-02-24 19:37:10.951 742-742/? I/zygote64: Late-enabling -Xcheck:jni
2022-02-24 19:37:10.969 742-742/com.tencent.shadow.sample.host I/zygote64: Reinit property: dalvik.vm.checkjni= false
2022-02-24 19:37:10.980 742-742/com.tencent.shadow.sample.host D/ActivityThread: ActivityThread,attachApplication
2022-02-24 19:37:11.013 742-742/com.tencent.shadow.sample.host D/HwFLClassLoader: get used feature list :/feature/used-list failed!
2022-02-24 19:37:11.014 742-742/com.tencent.shadow.sample.host D/HwFLClassLoader: USE_FEATURE_LIST had not init!
2022-02-24 19:37:11.014 742-793/com.tencent.shadow.sample.host I/HwApiCacheMangerEx: apicache mCurPackageName=com.tencent.shadow.sample.host uptimes=3651546
2022-02-24 19:37:11.015 742-793/com.tencent.shadow.sample.host I/HwApiCacheMangerEx: apicache oUid null
2022-02-24 19:37:11.016 742-793/com.tencent.shadow.sample.host I/HwApiCacheMangerEx: apicache volumes null
2022-02-24 19:37:11.019 742-793/com.tencent.shadow.sample.host I/HwApiCacheMangerEx: apicache path=/storage/emulated/0 state=mounted key=com.tencent.shadow.sample.host#10063#256
2022-02-24 19:37:11.021 742-793/com.tencent.shadow.sample.host I/HwApiCacheMangerEx: apicache oUid 10063
2022-02-24 19:37:11.021 742-793/com.tencent.shadow.sample.host I/HwApiCacheMangerEx: apicache volumes null
2022-02-24 19:37:11.022 742-793/com.tencent.shadow.sample.host I/HwApiCacheMangerEx: apicache path=/storage/emulated/0 state=mounted key=com.tencent.shadow.sample.host#10063#0
2022-02-24 19:37:11.022 742-793/com.tencent.shadow.sample.host I/HwApiCacheMangerEx: apicache async read begin packageName=com.tencent.shadow.sample.host userid=0
2022-02-24 19:37:11.022 742-793/com.tencent.shadow.sample.host I/HwApiCacheMangerEx: apicache pi null
2022-02-24 19:37:11.026 742-793/com.tencent.shadow.sample.host I/chatty: uid=10063(u0_a63) queued-work-loo identical 1 line
2022-02-24 19:37:11.027 742-793/com.tencent.shadow.sample.host I/HwApiCacheMangerEx: apicache pi null
2022-02-24 19:37:11.029 742-793/com.tencent.shadow.sample.host I/HwApiCacheMangerEx: apicache oUid null
2022-02-24 19:37:11.030 742-793/com.tencent.shadow.sample.host I/HwApiCacheMangerEx: apicache async read finished packageName=com.tencent.shadow.sample.host userid=0 totalus=7414
2022-02-24 19:37:11.031 742-742/com.tencent.shadow.sample.host I/HwApiCacheMangerEx: apicache pi null
2022-02-24 19:37:11.057 742-742/com.tencent.shadow.sample.host W/zygote64: Skipping duplicate class check due to unrecognized classloader
2022-02-24 19:37:11.071 742-793/com.tencent.shadow.sample.host E/MemoryLeakMonitorManager: MemoryLeakMonitor.jar is not exist!
2022-02-24 19:37:11.072 742-742/com.tencent.shadow.sample.host E/Minikin: Could not get cmap table size!
2022-02-24 19:37:11.076 742-742/com.tencent.shadow.sample.host I/com.tencent.shadow.sample.host.PluginProcessPPS: onCreate:com.tencent.shadow.sample.host.PluginProcessPPS@b58d480
2022-02-24 19:37:11.077 742-742/com.tencent.shadow.sample.host I/com.tencent.shadow.sample.host.PluginProcessPPS: onBind:com.tencent.shadow.sample.host.PluginProcessPPS@b58d480
2022-02-24 19:37:11.082 742-787/com.tencent.shadow.sample.host I/com.tencent.shadow.sample.host.PluginProcessPPS: setUuidManager uuidManager==com.tencent.shadow.dynamic.host.BinderUuidManager@4203efe
2022-02-24 19:37:11.085 742-787/com.tencent.shadow.sample.host I/com.tencent.shadow.sample.host.PluginProcessPPS: loadRuntime uuid:F24DCD01-FE2D-4A1A-9462-0B80B566612E
2022-02-24 19:37:11.087 742-787/com.tencent.shadow.sample.host I/com.tencent.shadow.dynamic.host.DynamicRuntime: last apkPath:/data/user/0/com.tencent.shadow.sample.host/files/ShadowPluginManager/UnpackedPlugin/test-dynamic-manager/6778412260b31a649a2373adc2c62272/plugin-debug.zip/sample-runtime-debug.apk new apkPath:/data/user/0/com.tencent.shadow.sample.host/files/ShadowPluginManager/UnpackedPlugin/test-dynamic-manager/c31be271dabaa649d65d39d54c46c5c1/plugin-debug.zip/sample-runtime-debug.apk
2022-02-24 19:37:11.087 742-787/com.tencent.shadow.sample.host I/com.tencent.shadow.dynamic.host.DynamicRuntime: 加载不相同apkPath的runtime了,先恢复classLoader树结构
2022-02-24 19:37:11.241 742-787/com.tencent.shadow.sample.host W/zygote64: Skipping duplicate class check due to unrecognized classloader
2022-02-24 19:37:11.267 742-787/com.tencent.shadow.sample.host I/com.tencent.shadow.sample.host.PluginProcessPPS: loadPluginLoader uuid:F24DCD01-FE2D-4A1A-9462-0B80B566612E mPluginLoader:null
2022-02-24 19:37:11.275 742-787/com.tencent.shadow.sample.host I/com.tencent.shadow.sample.host.PluginProcessPPS: 取出uuid==F24DCD01-FE2D-4A1A-9462-0B80B566612E的Loader apk:/data/user/0/com.tencent.shadow.sample.host/files/ShadowPluginManager/UnpackedPlugin/test-dynamic-manager/c31be271dabaa649d65d39d54c46c5c1/plugin-debug.zip/sample-loader-debug.apk
2022-02-24 19:37:11.281 742-787/com.tencent.shadow.sample.host E/com.tencent.shadow.sample.host.PluginProcessPPS: loadPluginLoader发生RuntimeException
java.lang.NullPointerException
at java.io.File.(File.java:282)
at dalvik.system.DexClassLoader.(DexClassLoader.java:57)
at com.tencent.shadow.dynamic.apk.ImplLoader.loadWhiteList(ImplLoader.java:42)
at com.tencent.shadow.dynamic.apk.ImplLoader.loadWhiteList(ImplLoader.java:34)
at com.tencent.shadow.dynamic.host.LoaderImplLoader.load(LoaderImplLoader.java:47)
at com.tencent.shadow.dynamic.host.PluginProcessService.loadPluginLoader(PluginProcessService.java:150)
at com.tencent.shadow.dynamic.host.PpsBinder.onTransact(PpsBinder.java:70)
at android.os.Binder.execTransact(Binder.java:675)

--------- beginning of crash

2022-02-24 19:37:11.501 742-742/com.tencent.shadow.sample.host I/com.tencent.shadow.sample.host.PluginProcessPPS: onUnbind:com.tencent.shadow.sample.host.PluginProcessPPS@b58d480
2022-02-24 19:37:11.502 742-742/com.tencent.shadow.sample.host I/com.tencent.shadow.sample.host.PluginProcessPPS: onDestroy:com.tencent.shadow.sample.host.PluginProcessPPS@b58d480

请问这是什么导致的,谢谢

@shifujun
Copy link
Collaborator

Crash的代码应该是
https://cs.android.com/android/_/android/platform/libcore/+/58a831874786b0cc599bcd61cefcd6f4b3f9fc8f
提交之前的Android版本为odex目录new File时遇到NPE。

前些天,Shadow新增了提交
f777cae
在API 26以上跳过odex逻辑。

因此你遇到问题的手机应该是API 26以上的,但是DexClassLoader还保有new File逻辑的代码。

@SkywardSky
Copy link
Author

手机就是8.0的,是华为荣耀青春版的,而且是部分手机,比这个版本高的手机没崩溃,同型号的,但是系统是10的,却没有崩溃,我今晚重新拉一下Shadow代码再试试。

shifujun added a commit to shifujun/Shadow that referenced this issue Feb 25, 2022
从AOSP源码和API 26虚拟机测试来看,DexClassLoader中new File的逻辑是API 27才去掉的。API 26的odex实际可能不生效。

fix Tencent#828
shifujun added a commit that referenced this issue Feb 25, 2022
从AOSP源码和API 26虚拟机测试来看,DexClassLoader中new File的逻辑是API 27才去掉的。API 26的odex实际可能不生效。

fix #828
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants