llama.cpp b10955 修复 ggml-cpu 堆损坏问题
原标题:b10955
AI 摘要
llama.cpp 发布 b10955 版本,修复了 ggml-cpu 中因预编译头(PCH)导致的 CACHE_LINE_SIZE 不一致问题。PCH 强制在 ops.h 之前包含 ggml-impl.h,使 C++ 内核使用 256 字节的硬件破坏性干扰大小,而 C 工作缓冲区代码仍用 64,导致 rope 工作缓冲区偏小并引发堆缓冲区溢出,最终在 ggml_compute_forward_rope_flt 中崩溃。修复方式是禁用 ggml-cpu 的 PCH 并移除 std::hardware_destructive_interference_size 分支,使 CACHE_LINE_SIZE 确定且与包含顺序无关。
正文节选
<details open> ggml-cpu : disable PCH and fix CACHE_LINE_SIZE ambiguity to fix heap corruption (#28882) Disable the ggml-cpu precompiled header and remove the std::hardware_destructive_interference_size branch from CACHE_LINE_SIZE. The PCH force-includes ggml-impl.h before ops.h, which pulls in <new> via <array>/<vector> and defines __cpp_lib_hardware_interference_size. This makes the C++ kernels use CACHE_LINE_SIZE = 256 (hardware destructive interference size) while the C work-buffer sizing