Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

resize! frees its new buffer with free instead of release

未关闭 适合新手
#667 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
julia
领域
backend

调研方向

阅读 src/array.jl:659-661 中 resize! 的终结器,并将其与 src/array.jl:129-131 中数组构造函数的终结器以及 src/pool.jl 中的 release 进行比较。检查相关的终结器或内存管理测试,然后运行这些测试;当调整大小后的缓冲区通过 release(buf) 释放,从而应用其记账和同步行为时,即为完成。

由索引模型根据 Issue 内容生成。

描述

The buffer that resize! allocates is freed by a finalizer that calls free(buf) (src/array.jl:659-661 at 0c02df0), whereas the array constructor's finalizer calls release(buf) (src/array.jl:129-131). That skips everything release does (src/pool.jl):

  • _allocated_bytes is never decremented for resized device and shared buffers, so the proactive-GC thresholds see memory that was freed long ago as still allocated;
  • on the LTS stack, the queues that may still reference the buffer aren't synchronized before freeing, which is the workaround for NEO 25.18 unmapping memory with work in flight (a GPU page fault that bans the context);
  • the free doesn't use ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_BLOCKING_FREE.

So a vector that was resize!d and then becomes garbage while its last kernel is still running can take down the context on LTS. Using release(buf) in that finalizer, like the constructor does, should fix all three.

主要语言
Julia
星标
217
派生
37
平均合并
18 小时 12 分钟
30 天内合并 PR
26

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

JuliaGPU/oneAPI.jl 的其他 Issue

查看 JuliaGPU/oneAPI.jl 的全部 Issue

相似的 Issue

更多 Julia Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。