mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-09-15 18:13:29 +02:00
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 code in ggml-cpu.c always uses the fallback 64. The mismatch undersizes the rope work buffer by (CACHE_LINE_SIZE/4 - 16) * n_threads * 4 bytes, causing a heap-buffer-overflow that corrupts the heap and later crashes in ggml_compute_forward_rope_flt. Disabling the ggml-cpu PCH restores the natural include order so ops.h is processed before <new>, keeping CACHE_LINE_SIZE consistent. Removing the std::hardware_destructive_interference_size branch makes the value deterministic and include-order independent. ref: https://github.com/ggml-org/llama.cpp/issues/28858 Assisted-by: pi:llama.cpp/DeepSeek-V4-Flash-Vision-Exp