

Pull Request has been successfully merged by CANN-robot.
(Thank you for W4termy's contribution.)变更摘要
此 PR 修复了 KernelBundleDevCache 析构函数中错误的设备内存释放逻辑。由于静态对象 DevMemoryPool 的析构顺序在 KernelBundleDevCache 之前,其 DestroyPool() 已先行释放所有内存块;析构函数中再次调用 Free 将命中空的 addrToBlock_ 并触发 FREE_FAILED。修复方案是移除 ~KernelBundleDevCache() 中对 cache_ 和 cellMatchCache_ 的显式 Free 调用,仅保留 clear() 清空映射表,设备内存的实际释放完全交由 DevMemoryPool 在进程退出时统一处理。
主要改动
- 移除析构函数中的
devMem.Free()调用:在~KernelBundleDevCache()中删除了对cache_各值以及cellMatchCache_各addr字段的Free操作,仅保留两个map的clear(),避免因DevMemoryPool已先析构而导致的重复释放错误。 - 更新析构函数注释:新增注释说明不在此处释放的原因——
DevMemoryPool作为静态对象先于当前对象销毁,其DestroyPool()已释放所有块,再次释放会命中空addrToBlock_并报FREE_FAILED。 - 更新头文件生命周期注释:将
GetOrCopy和GetOrAllocCellMatch的返回指针生命周期描述从"Freed only in the destructor at exit"改为"Held until process exit",并更新类级注释,明确设备内存缓存在整个进程生命周期内有效,由DevMemoryPool在 teardown 时统一释放。


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
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/pypto | ✅ jason_yuan_ye, gaoxingwang (2/2) | ✅ jason_yuan_ye (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
W4termy, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


流水线任务触发成功
任务链接 [e312521643344226b2e2089a88b4a2e2][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| UT_Test_Py3_ninja_simulation | ✅ SUCCESS | ||
| UT_Test_Py3_ninja | ✅ SUCCESS | ||
| UT_Test_Cpp_make_gnu_part_1 | ✅ SUCCESS | ||
| UT_Test_Cpp_make_gnu_part_2 | ✅ SUCCESS | ||
| UT_Test_Cpp_make_gnu_part_3 | ✅ SUCCESS | ||
| UT_Test_Cpp_make_clang_part1 | ✅ SUCCESS | ||
| UT_Test_Cpp_make_clang_part2 | ✅ SUCCESS | ||
| UT_Test_Cpp_make_clang_part3 | ✅ SUCCESS | ||
| UT_Test_kirinx90 | ✅ SUCCESS | ||
| UT_Test_kirin9030 | ✅ SUCCESS | ||
| UT_Test_report | ✅ SUCCESS | >>>>> | |
| PreSmoke_A900 | ✅ SUCCESS | >>>>> |
[2026-08-11 17:23:31] CI执行结束


流水线任务触发成功
任务链接 [64b4b6d9bcb547e9842460763e238de0][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| SCA | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_Pr | ✅ SUCCESS | ||
| StaticCheck_codespell | ✅ SUCCESS | ||
| StaticCheck_link_validity | ✅ SUCCESS | ||
| StaticCheck_resource_existence | ✅ SUCCESS | ||
| StaticCheck_tag_closed | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_codestyle | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ✅ SUCCESS | >>>>> | |
| StaticCheck_md | ✅ SUCCESS |
[2026-08-11 16:57:00] CI执行结束


流水线任务触发成功
任务链接 [0b65cd9a5f3b4d5597900516aede25c4][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| get_pr_file | ✅ SUCCESS | ||
| static-check | ✅ SUCCESS | ||
| compile | ✅ SUCCESS |
[2026-08-11 17:24:08] CI执行结束


/approve


/lgtm

