已合并
[Profiling]修复aclgraph场景下,多卡运行时偶现的core dump问题 #1098
[Profiling]修复aclgraph场景下,多卡运行时偶现的core dump问题 #1098
已合并
zhengkai创建于 3月23日
1 个文件变更+7-1
@@ -477,7 +477,13 @@ int32_t ProfCannPlugin::ProfReportAdditionalInfo(uint32_t agingFlag, const VOID_
477 if (info->level == MSPROF_REPORT_AICPU_LEVEL) {477 if (info->level == MSPROF_REPORT_AICPU_LEVEL) {
478 return batchAdditionalBuffer_.BatchPush(info, length);478 return batchAdditionalBuffer_.BatchPush(info, length);
479 } else {479 } else {
480- return additionalBuffer_.TryPush(agingFlag, *info);480+ MsprofAdditionalInfo tempInfo = {};
Z
Zzhuliangying3月26日

按问题定位原因, data的length不可信,那所有data强转前都需要先判断长度是否足够,另外, 数据是其他组件上报的,约定好的数据类型,为什么会出现data 长度不够的情况?

likedislike
481+ errno_t err = memcpy_s(&tempInfo, length, data, length);
482+ if (err != EOK) {
483+ MSPROF_LOGE("Memcpy failed in ProfReportAdditionalInfo, err=%d.", err);
484+ return PROFILING_FAILED;
485+ }
486+ return additionalBuffer_.TryPush(agingFlag, tempInfo);
481 }487 }
482 }488 }
483}489}