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

获取的堆栈中多了一些runtimeMethod方法 #5

Open
liuhangb opened this issue Apr 23, 2024 · 6 comments
Open

获取的堆栈中多了一些runtimeMethod方法 #5

liuhangb opened this issue Apr 23, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@liuhangb
Copy link

获取的堆栈中多了一些runtimeMethod方法:

<runtime method>.<runtime internal callee-save reference and argument registers method>

bool FetchStackVisitor::VisitFrame() {
  void *method = ArtHelper::GetCurMethodOfVisitor(this);
  auto *artMethod = static_cast<ArtMethod *>(method);
// 按照我的理解, 应该是在这里会过滤runtime Method, 不过目前没有生效
  if (artMethod == nullptr || artMethod->IsRuntimeMethod()) {
    return true;
  }
        at android.graphics.HardwareRenderer.nSyncAndDrawFrame
        at android.graphics.HardwareRenderer.syncAndDrawFrame
        at android.view.ThreadedRenderer.draw
        at android.view.ViewRootImpl.draw
        at android.view.ViewRootImpl.performDraw
        at android.view.ViewRootImpl.performTraversals
        at android.view.ViewRootImpl.doTraversal
        at android.view.ViewRootImpl$TraversalRunnable.run
        at android.view.Choreographer$CallbackRecord.run
        at android.view.Choreographer.doCallbacks
        at android.view.Choreographer.doFrame
        at android.view.Choreographer$FrameDisplayEventReceiver.run
        at android.os.Handler.handleCallback
        at android.os.Handler.dispatchMessage
        at android.os.Looper.loop
        at android.app.ActivityThread.main
        at <runtime method>.<runtime internal callee-save reference and argument registers method>
        at java.lang.reflect.Method.invoke
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run
        at <runtime method>.<runtime internal callee-save reference and argument registers method>
        at com.android.internal.os.ZygoteInit.main
@Knight-ZXW
Copy link
Owner

什么系统及版本

@liuhangb
Copy link
Author

什么系统及版本

@Knight-ZXW 应该是Android 10系统的问题, 其他高版本测了几台都没问题
Android 10测试机型: 华为P40 Pro Android 10、Oppo FindX Android 10

@Knight-ZXW
Copy link
Owner

什么系统及版本

@Knight-ZXW 应该是Android 10系统的问题, 其他高版本测了几台都没问题 Android 10测试机型: 华为P40 Pro Android 10、Oppo FindX Android 10

原因是 Android 10 和Android 11 art_method 结构 不一样,可以自己改下

@liuhangb
Copy link
Author

@Knight-ZXW 我对比了两个版本的代码, 没发现数据结构有差异, 大佬能否截图示意下?

@Knight-ZXW
Copy link
Owner

Knight-ZXW commented Apr 25, 2024

@Knight-ZXW 我对比了两个版本的代码, 没发现数据结构有差异, 大佬能否截图示意下?
image

image

我说错了, 是android 12 相比之前的版本,删去了 uint32_t dex_code_item_offset_; 字段。

@liuhangb
Copy link
Author

@Knight-ZXW 感谢,现在可以了

@Knight-ZXW Knight-ZXW added the bug Something isn't working label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants