已关闭
aptool dump在ABC文件不匹配时静默失败或崩溃 #10437
zhu_heng创建于 3月17日关闭于 6月15日
openharmony_ci
3月17日 评论:
3月17日 评论:
感谢提交Issue!关于Issue的交互操作,请访问OpenHarmony社区支持命令清单。如果有问题,请联系 [@weng-changcheng](https://gitcode.com/weng-changcheng) [@godmiaozi](https://gitcode.com/godmiaozi) [@liyiming13](https://gitcode.com/liyiming13) [@lijin1039](https://gitcode.com/lijin1039) [@Prof](https://gitcode.com/Prof) [@dingding5](https://gitcode.com/dingding5) [@vpukhov](https://gitcode.com/vpukhov) [@v-cherkashin](https://gitcode.com/v-cherkashin) 。如果需要调整订阅PR、Issue的变更状态,请访问链接。
Thanks for submitting the issue. For more commands, please visit OpenHarmony Command List. If you have any questions, please refer to committer gitcode for help. If you need to change the subscription of a Pull Request or Issue, please visit the link.


3月17日 添加了label:waiting_for_assign
3月17日 关联了pull request:fix(aptool): add defensive checks for ABC metadata lookup
6月15日 issue状态由 待办的 改变为 已完成
6月15日 关闭了 issue
问题描述
aptool dump 命令在使用
--abc-path参数时存在两个问题:问题1:ABC文件名不匹配时静默失败
当 profile 中记录的 panda 文件名与
--abc-path提供的 ABC 文件路径不匹配时(规范化路径和 basename 都对不上),FindRecordByName返回 nullptr,但没有任何日志输出。用户看到 dump 结果中缺少class_descriptor和method_signature,却不知道原因。问题2:错误的ABC文件导致崩溃(signal 11)
当用户提供了一个文件名匹配但内容不对应的 ABC 文件时(例如将 entry.abc 重命名为 modules.abc),
FindRecordByName通过 basename 匹配成功,但 profile 中的 method index 指向了错误文件中的非法位置,导致MethodDataAccessor/ProtoDataAccessor读取垃圾数据,引发 SIGSEGV 崩溃。根因分析
FindRecordByName在返回 nullptr 时缺少 WARNING 日志GetMethodInfo中ContainsMethod检查被注释为"允许不在索引中的方法",未起到防护作用BuildMethodSignature中对 nameId、protoId 缺少越界检查GetOrCreateMethodCodeView中同样缺少ContainsMethod防护和 codeId 越界检查