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

加固模式补丁合成、加载都成功,但很多用户报出了大量 SIGABRT 异常,初步怀疑是 art 内联方法导致的。 #1262

Open
hy2012 opened this issue Oct 22, 2019 · 2 comments

Comments

@hy2012
Copy link

hy2012 commented Oct 22, 2019

异常类型:app运行时异常

手机型号:如:vivo x21A  vivo NEX 

手机系统版本:如:Android 8.0, 9.0

tinker版本:如:1.9.14

gradle版本:如:3.3.2

是否使用热更新SDK: 否

系统:如:Mac

bugly 抓取的日志如下:
堆栈/日志:

#00 pc 0001d076 /system/lib/libc.so (abort+61) [armeabi-v7a]
#01 pc 0034b263 /system/lib/libart.so (art::Runtime::Abort(char const*)+798) [armeabi-v7a]
#02 pc 0000740d /system/lib/libbase.so (android::base::LogMessage::~LogMessage()+500) [armeabi-v7a]
#03 pc 00361589 /system/lib/libart.so (art::Runtime::ResetStats(int)+104) [armeabi-v7a]
#04 pc 0035fdb7 /system/lib/libart.so (art::StackVisitor::GetMethod() const+366) [armeabi-v7a]
#05 pc 0037a06f /system/lib/libart.so (art::Thread::RequestSynchronousCheckpoint(art::Closure*, art::ThreadState)+2074) [armeabi-v7a]
#06 pc 0035f03d /system/lib/libart.so (void art::StackVisitor::WalkStack<(art::StackVisitor::CountTransitions)0>(bool)+1088) [armeabi-v7a]
#07 pc 0036cb1b /system/lib/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const+186) [armeabi-v7a]
#08 pc 0036914f /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const+34) [armeabi-v7a]
#09 pc 0038250f /system/lib/libart.so (art::Thread::VerifyStackImpl()+66) [armeabi-v7a]
#10 pc 0037c6f1 /system/lib/libart.so (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*)+320) [armeabi-v7a]
#11 pc 0037bbbf /system/lib/libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool)+406) [armeabi-v7a]
#12 pc 0034b09f /system/lib/libart.so (art::Runtime::Abort(char const*)+346) [armeabi-v7a]
#13 pc 0000740d /system/lib/libbase.so (android::base::LogMessage::~LogMessage()+500) [armeabi-v7a]
#14 pc 00361589 /system/lib/libart.so (art::Runtime::ResetStats(int)+104) [armeabi-v7a]
#15 pc 003be001 /system/lib/libart.so (art::verifier::VerifierDeps::Dump(art::VariableIndentationOutputStream*) const+1756) [armeabi-v7a]
#16 pc 003d3c9d /system/lib/libart.so (artQuickToInterpreterBridge+1076) [armeabi-v7a]
#17 pc 004100ff /system/lib/libart.so [armeabi-v7a]
#18 pc 0037338f /data/app/com.zhihu.android--e15yLjCvTx1FKeOk3IJ_g==/oat/arm/base.odex [armeabi]

查看 bugly 的跟踪日志有一些原因是

  • Andoid 9.0 错误日志如下:
    image
  • Android 8.0 错误日志如下:
    Could not find an inlined method from an .oat file
    image
  • 还有一些其他因补丁加载引起的错误日志:

AndroidRuntime: java.lang.NoClassDefFoundError: Invalid descriptor: ex
AndroidRuntime: 035.
AndroidRuntime: at com.zhihu.android.answer.module.pager.AnswerPagerContentPresenter.getSearchQuery(AnswerPagerContentPresenter.java:1829)
因为 9.0 的内联检验改动,出错是正常。但是 8.0 为什么还有内联方法导致异常的情况呢?

结论:初步怀疑是在加载补丁,因为内联方法导致了一些地址错乱,从而引起了大量的异常

同时有一些疑问:

  1. 应用是使用了梆梆加固,在加固模式下,补丁 dex 并不是全量合成 。但通过该文章看ART下的方法内联策略及其对Android热修复方案的影响分析 全量合成补丁解决了 art 内联的问题。那么加固模式是怎么解决内联问题的呢?
  2. 通过 Android_N混合编译与对热补丁影响解析 了解到创建 AndroidNClassLoader 解决了 app image 的问题。但是通过源码
    image 发现在加固应用并没有使用 AndroidNClassLoader, 那么加固模式怎么解决 app image 的问题呢?
@xjy2061
Copy link

xjy2061 commented May 11, 2020

遇到同样问题,使用的tinker版本是1.9.14.5,集中在oppo和vivo上。 @hy2012 这个问题解决了吗?

同样有上面提到的疑问, @tomystang 可以解答下吗?

@mrliul
Copy link

mrliul commented Feb 2, 2021

遇到同样问题,使用的tinker版本是1.9.14.10 ,集中在华为10,求解答

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

No branches or pull requests

3 participants