已合并
fix: 修复 LLT 测试插件和日志桩依赖 #4735
fix: 修复 LLT 测试插件和日志桩依赖 #4735
已合并
yelongjian创建于 15 天前
yelongjian成员
15 天前

描述

修复新 CANN 环境下 GE LLT 测试对真实 toolkit 插件和日志生命周期的隐式依赖,所有修改仅位于 tests/ 目录。

变更类型

关联的Issue

如何测试

  1. 在新 CANN 镜像中执行 ge_common UT,14/14 测试通过。
  2. 验证 FE 日志桩不再触发退出阶段 heap-use-after-free。
  3. 执行 pre-commit 检查,全部 hooks 通过。

核对清单

其他信息

测试侧过滤 liboptf_plugin_hccl.so 的加载,并将日志级别映射改为无静态析构对象的 switch 实现。

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 yelongjian 的贡献)
Yyelongjian成员
15 天前 创建了 pull request,commit 533c9b48
atomgit-bot
atomgit-bot
15 天前 评论:

变更摘要

本 PR 修复了新 CANN 环境下 GE LLT 测试对真实 toolkit 插件和日志生命周期的隐式依赖,所有改动仅位于 tests/ 目录。核心改动有两处:一是在测试桩 mmDlopen 中过滤 liboptf_plugin_hccl.so 的加载;二是将日志桩中的静态 std::map 日志级别映射改为无静态析构对象的 switch 实现,消除退出阶段的 heap-use-after-free

主要改动

  • 过滤真实插件加载:在 tests/depends/mmpa/src/mmpa_stub.ccmmDlopen 中,当 so_name 包含 liboptf_plugin_hccl.so 时直接返回 nullptr,使 LLT 测试不再依赖真实 toolkit 插件。
  • 去除日志级别静态映射:在 tests/engines/nn_engine/depends/slog/slog_stub.cc 中删除静态 LOG_LEVEL_STR_MAPstd::map<int, std::string>)及其 <map> 头文件引用,避免静态析构对象带来的生命周期问题。
  • 改用 switch 映射日志级别:在 DlogRecord 中将原先基于 map 查找的日志级别转换改为 switch 语句(覆盖 DLOG_DEBUGDLOG_INFODLOG_WARNDLOG_ERROR),不再产生静态析构对象,修复 FE 日志桩退出阶段的 heap-use-after-free
likedislike
不准确?
atomgit-bot
atomgit-bot
15 天前 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
CANN-robotCANN-robot成员
15 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
15 天前 评论:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.


PR Approval Progress

Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
repo-cann/ge yangyongqiang0606, kobemini (2/2) yangyongqiang0606 (1/1)
tests/engines/nn_engine yangyongqiang0606, kobemini (2/2) yangyongqiang0606 (1/1)
tests/engines/te_fusion kobemini, yangyongqiang0606 (2/2) yangyongqiang0606 (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

yelongjian, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
此处折叠了86条消息 查看更多
GengChao
GengChao成员
15 天前 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
15 天前 添加了label:lgtm
yangyongqiang
yangyongqiang成员
15 天前 评论:

/approve

likedislike
CANN-robotCANN-robot成员
15 天前 添加了label:approved
CANN-robotCANN-robot成员
15 天前 合入了pull request