bytedance / btrace

🔥🔥 btrace(AKA RheaTrace) is a high performance Android trace tool which is based on Perfetto, it support to define custom events automatically during building apk and using bhook to provider more native events like Render/Binder/IO etc.
Other
1.93k stars 273 forks source link

Cause: invalid entry size (expected 3004218347 but got 720397 bytes) #80

Open moranhen opened 1 year ago

moranhen commented 1 year ago

java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.util.zip.ZipException: invalid entry size (expected 3004218347 but got 720397 bytes)

尝试在本地运行,但是报了这个错误。可以请教您们一下是否遇见过吗?或者有什么建议吗?

mzule commented 1 year ago

这是编译的问题?还是脚本执行的问题?

moranhen commented 1 year ago

编译问题,错误在locator.kt的 139行 zipEntry = zin.nextEntry 出现了push back buffer 满了 image

mzule commented 1 year ago

预计本周我们会发布一个不再依赖bytex的版本,回头再测试下。

moranhen commented 1 year ago

好的 感谢!

moranhen commented 1 year ago

最新版本不存在 以上问题了感谢,但是我在执行最后脚本收集trace数据时出现了问题。 java -jar rhea-trace-processor-2.0.3-Test.jar -a com.sankuai.meituan -t 10 -o output.pb -r sched -fullClassName 07-26 17:17:16.735 I RheaTrace : workspace clear: xxxx/rheatrace.workspace 07-26 17:17:17.439 I RheaTrace : os version is 33. default capture is PerfettoCapture 07-26 17:17:19.444 RheaTrace : start tracing... 07-26 17:17:29.883 RheaTrace : stop tracing... 07-26 17:17:38.417 E RheaTrace : Error: download file trace error 07-26 17:17:38.417 E RheaTrace : Tips: check your app is integrated with btrace2.0 and is running.

请问是什么问题吗? 我是以本地maven库形式导入的依赖,因为存在AGP版本的不一致。

moranhen commented 1 year ago

定位大概是Http Class 无法获取到对应 "http://localhost:" + arg.port + path 的数据

mzule commented 1 year ago

定位大概是Http Class 无法获取到对应 "http://localhost:" + arg.port + path 的数据

这个其实是在app启动时启动了一个http的服务器,将数据通过http暴露给java脚本。如果你遇到了download file trace error,说明可能是 file trace 文件不存在,或者http服务器没有启动成功。其实都可能是因为未成功集成btrace。你可以将apk拖到android studio里面看下dex的字节码,看下方法的开始与结束有没有 TraceStub 相关的插桩。