已关闭
hidumper --mem-heap --native --leakobj 某些情况下产生额外换行 #586
denganliang创建于  5月22日关闭于  5月25日
denganliang
5月22日 创建

问题描述

使用 hidumper --mem-heap --native pid --leakobj 时,当IPC成功但目标进程无法返回leakobj数据时,输出中会产生额外空行。

根因:dumpResult_ 为空字符串,AfterExecute 无条件推入 dumpDatas_,经 FDOutput::NewLineMethod 给空字符串加换行符产生额外空行。

修改方案

  1. hiviewdfx_hidumper:在 heap_memory_dumper.cpp AfterExecute 增加 !dumpResult_.empty() 判断,空时输出提示信息而非空行
  2. ability_ability_runtime:在 GetDumpResult 增加 *buf!=空字符 判断作为源头防御

关联PR

  • openharmony/hiviewdfx_hidumper!767
  • openharmony/ability_ability_runtime!19413
likedislike
openharmony_ci
openharmony_ci成员
5月22日 评论:

感谢提交Issue!关于Issue的交互操作,请访问OpenHarmony社区支持命令清单。如果有问题,请联系 [@mzyan](https://gitcode.com/mzyan) [@Lutao98](https://gitcode.com/Lutao98) 。如果需要调整订阅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.

likedislike
openharmony_ciopenharmony_ci成员
5月22日 添加了label:waiting_for_assign
Ddenganliang
5月22日 关联了pull request:fix: 修复--leakobj空结果导致额外换行的问题
denganliang
5月22日 评论:

static-check

likedislike
Ddenganliang
5月22日 修改了issue 的描述
Ddenganliang
5月22日 修改了issue 的描述
openharmony_ciopenharmony_ci成员
5月25日 关闭了 issue
openharmony_ciopenharmony_ci成员
5月25日 issue状态由 待办的 改变为 已完成