已关闭
[Bug-Report|缺陷反馈]: [工具检测]ops-nn仓 loss/cross_entropy_loss 算子扫描出现异常内存告警,分析确认存在内存越界写风险 #5257
Goldfish_of_Siris创建于 13 天前关闭于 2 天前
yuning_chen
13 天前 评论:
13 天前 评论:
/assign @zhu-lei0614


CANN-robot
13 天前 评论:
13 天前 评论:
13 天前 将 yolic 设为负责人
yuning_chen
13 天前 评论:
13 天前 评论:
您好,问题已收到,目前 @zhu-lei0614 正在跟踪处理。


2 天前 关闭了 issue
2 天前 添加了label:resolved
Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
Describe the current behavior / 问题描述 (Mandatory / 必填)
使用检测工具扫描 loss/cross_entropy_loss 算子,扫描结果告警中存在异常内存写入告警:

经分析该告警为算子代码异常:
cross_entropy_loss_full_load.h:162中InitBuffer初始化了32B的内存,在895行inputQueue_.AllocTensor出来的有效内存只有32B,但在896行的DataCopyPad一共写入了196B的数据,有160B的越界写入
调用链:
请确认算子代码行为是否符合预期
Environment / 环境信息 (Mandatory / 必填)
环境:Ascend950PR
cann包版本:730商发
ops-nn代码仓:9.1.0分支
Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)
使用以下命令运行算子
bash build.sh --pkg --soc=ascend950 --ops=aipp -j96 --mssanitizer > test_result/9_aipp/compile.log 2>&1
./build_out/cann-ops-cv-custom-linux.x86_64.run --force
export LD_LIBRARY_PATH=/home/lishuo/cann/730/cann-9.1.0/opp/vendors/custom_cv/op_api/lib/😒{LD_LIBRARY_PATH}
bash build.sh --run_example aipp graph cust --soc=ascend950 > test_result/9_aipp/example.log 2>&1
time mssanitizer -t memcheck --log-level=error -- bash build.sh --run_example aipp graph cust --soc=ascend950 > test_result/9_aipp/memcheck.log 2>&1
time mssanitizer -t memcheck --log-level=error -- build/test_aclnn_cross_entropy_loss --soc=ascend950 > test_result/233_cross_entropy_loss/memcheck_ge.log 2>&1
随后可看到内存告警信息
Describe the expected behavior / 预期结果 (Mandatory / 必填)
预期算子运行正常无告警
Related log / screenshot / 日志 / 截图 (Mandatory / 必填)
见附件:
3309d61306c84923a742a4238398d80a.zip
Special notes for this issue/备注 (Optional / 选填)