已关闭
【缺陷报告】空指针解引用 - 文件acosh.cpp - 函数l0op::Acos - 行号60 #2766
zhangjunkai9创建于 17 天前关闭于 13 天前
陈思
17 天前 评论:
17 天前 评论:
zhangqijia1
17 天前 评论:
17 天前 评论:
/assign


17 天前 将 gcw_SUaZx3UQ 设为负责人
zhangjunkai9
16 天前 评论:
16 天前 评论:
根因确认
已核对当前
master。Issue 中的文件名应为math/acos/op_api/acos.cpp,不是acosh.cpp。l0op::Acos调用executor->AllocTensor(...)后未检查返回值,就把output传给 AiCore/AiCpu launcher;同类实现已有CHECK_RET(output != nullptr, nullptr)防护,告警成立。修复时应在分支选择前校验分配结果,并补充分配失败路径测试。后续由责任人安排修复和验证。
你说得对,确实是math/acos/op_api/acos.cpp,而不是acosh.cpp,在此修正


14 天前 关联了pull request:fix(acos): 修复 AllocTensor 空指针解引用
13 天前 关闭了 issue
13 天前 添加了label:resolved
缺陷信息
缺陷描述
executor->AllocTensor()返回值output未做空指针校验即在第62-66行被使用(AcosAiCore/AcosAiCpu均解引用output)。同模块acosh.cpp:63-64对同样场景有CHECK_RET(output != nullptr, nullptr)校验,此处缺少该保护,若AllocTensor内存不足返回nullptr则AcosAiCore/AcosAiCpu中解引用output将崩溃。
事实核查
数据流证据
传播路径:
修复建议
auto output = executor->AllocTensor(input->GetViewShape(), input->GetDataType()); CHECK_RET(output != nullptr, nullptr);