Environment
- llama.cpp version: b9140 (
libllama.0.0.9140.dylib)
- OS: macOS 26.4.1 (25E253)
- Hardware: Apple Silicon ARM64 (Mac15,7 / M3 Pro)
- Install: Homebrew
Model
Qwen/Qwen3-Embedding-0.6B GGUF, served with --embedding
Steps to Reproduce
llama-server --embedding --hf-repo Qwen/Qwen3-Embedding-0.6B-GGUF --hf-file <file>.gguf
# Send any embedding request to /v1/embeddings
What Happens
llama-server crashes immediately on the first embedding request with heap corruption detected by libsystem_malloc:
BUG IN CLIENT OF LIBMALLOC: memory corruption of free block
EXC_BREAKPOINT / SIGTRAP
Crash Callstack (faulting thread)
server_context_impl::update_slots()
llama_decode
llama_context::decode(llama_batch const&)
llama_kv_cache::init_batch(llama_batch_allocr&, unsigned int, bool)
llama_kv_cache::prepare(std::vector<llama_ubatch> const&)
std::vector<llama_kv_cache::slot_info>::push_back(...)
std::vector<llama_kv_cache::slot_info>::__emplace_back_slow_path(...)
std::allocator<llama_kv_cache::slot_info>::construct(...)
std::vector<std::vector<unsigned int>>::__init_with_size(...)
std::vector<unsigned int>::__init_with_size(...)
operator new(unsigned long)
_xzm_xzone_malloc_from_freelist_chunk ← crash
Analysis
The crash occurs in llama_kv_cache::prepare() when copying slot_info objects (which contain vector<vector<unsigned int>> for position sequences) into the cache. The heap corruption is detected at the operator new call inside the copy constructor, indicating a prior out-of-bounds write to a block that was already freed.
This may be related to the M-RoPE position buffer size mismatch described in #20093 (pos buffer allocated as n_tokens instead of n_tokens * n_pos_per_embd), which would cause an OOB write corrupting adjacent heap memory.
Note: this is distinct from #20085 (all-zero embeddings with --reranking). This is a hard crash on macOS with no --reranking flag involved. The libggml-metal.so backend is active (Metal GPU) at crash time.
Environment
libllama.0.0.9140.dylib)Model
Qwen/Qwen3-Embedding-0.6BGGUF, served with--embeddingSteps to Reproduce
What Happens
llama-server crashes immediately on the first embedding request with heap corruption detected by
libsystem_malloc:Crash Callstack (faulting thread)
Analysis
The crash occurs in
llama_kv_cache::prepare()when copyingslot_infoobjects (which containvector<vector<unsigned int>>for position sequences) into the cache. The heap corruption is detected at theoperator newcall inside the copy constructor, indicating a prior out-of-bounds write to a block that was already freed.This may be related to the M-RoPE position buffer size mismatch described in #20093 (
posbuffer allocated asn_tokensinstead ofn_tokens * n_pos_per_embd), which would cause an OOB write corrupting adjacent heap memory.Note: this is distinct from #20085 (all-zero embeddings with
--reranking). This is a hard crash on macOS with no--rerankingflag involved. Thelibggml-metal.sobackend is active (Metal GPU) at crash time.