已关闭
[Bug-Report|缺陷反馈]: [Adump] 修复AI静态扫描复核接受的4项问题 #918
Lujialiang创建于 12 天前关闭于 9 天前
12 天前 添加了label:bug-report
Lujialiang
12 天前 评论:
12 天前 评论:
/assign


12 天前 将 Lujialiang 设为负责人
12 天前 关联了pull request:fix: resolve adump static analysis findings (#918)
ykl999
9 天前 评论:
9 天前 评论:
Bug已修复,此issue关闭


9 天前 issue状态由 进行中 改变为 已解决
9 天前 关闭了 issue
8 天前 添加了label:resolved
Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
Describe the current behavior / 问题描述 (Mandatory / 必填)
在 CANN runtime 的 Adump 模块中,静态扫描复核确认以下 4 项问题需要处理:
src/dfx/adump/adump/adx_dump_record.cpp的RecordDumpDataToDisk()中,while (FileUtils::IsDiskFull(...))循环体无条件return false,循环实际最多执行一次(扫描报告原始位置::308,当前源码对应:329)。StatsDataParsing()中存在相同的 while + unconditional return 结构(扫描报告原始位置::630,当前源码对应:659)。src/dfx/adump/adump/operator/operator_dumper.cpp的OperatorDumper(const DumpSetting&)仅初始化setting_,未初始化成员stream_;另一个构造函数已将其初始化为nullptr(扫描报告位置::40)。src/dfx/adump/adump/printf/dump_printf/dump_printf.cpp中存在冗余条件A || (!A && B),可等价化简为A || B(扫描报告原始位置::817-818,当前源码对应:782-783)。Environment / 环境信息 (Mandatory / 必填)
cann/runtime(GitCode)src/dfx/adumpruntime-dev_result_20260825_reassessment.xlsxSteps to reproduce the issue / 重现步骤 (Mandatory / 必填)
Describe the expected behavior / 预期结果 (Mandatory / 必填)
if,若设计为重试则应具备明确的等待、状态变化和重试上限。stream_初始化为nullptr,避免未初始化句柄传入运行时接口。Related log / screenshot / 日志 / 截图 (Mandatory / 必填)
TscanCode 报告:
(adx_dump_record.cpp:308) (Warning) An unconditional 'break/return/goto' within a loop. It may be a mistake.(adx_dump_record.cpp:630) (Warning) An unconditional 'break/return/goto' within a loop. It may be a mistake.(operator_dumper.cpp:40) (Warning) Member variable 'OperatorDumper::stream_,' is not initialized in the constructor.(dump_printf.cpp:817) (Information) Redundant condition: dumpHead.type==AdxDumpType::DUMP_TIMESTAMP. 'A || (!A && B)' is equivalent to 'A || B'Special notes for this issue/备注 (Optional / 选填)
本 Issue 合并跟踪 reassessment 表中“复核处置动作”为“接受问题”的 4 项:2、3、4、7。建议先将两个单次磁盘检查循环改为
if,再补齐stream_初始化,最后简化打印条件;修改后执行 Adump 相关 UT、编译和静态扫描回归。