Skip to content

ggml : check for allocation failures to prevent crashes - #28149

Merged
ggerganov merged 3 commits into
ggml-org:masterfrom
sanmai:fix/ggml_backend_sched_alloc_splits-re-reserve
Sep 18, 2026
Merged

ggerganov merged 3 commits into
ggml-org:masterfrom
sanmai:fix/ggml_backend_sched_alloc_splits-re-reserve

Conversation

@sanmai

@sanmai sanmai commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Overview

  • The result of ggml_gallocr_reserve_n wasn't considered so ggml_gallocr_alloc_graph crashed on buffers that weren't allocated
  • The return value from ggml_backend_sched_reserve wasn't considered either, caused SIGABRT

Related to #27817

Additional information

build/bin/llama-mtmd-cli -m qwen3.8-27b-q4_0.gguf --mmproj Qwen3.8-mmproj-BF16.gguf \
  --image apple.jpg --image tmp/big.jpg -p describe \
  --image-min-tokens 1024 -dev CUDA0 -mmdev Vulkan1 -fitt 1200

Here -fitt 1200 leaves us with 1200 MiB free for 888 MiB mmproj plus 123 MiB for the first image but not 480 MiB second image.

A command to create the second image:

magick -size 3000x3000 plasma:fractal -quality 90 tmp/big.jpg

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES, I used AI to debug and find the place for the fix.

@github-actions github-actions Bot added ggml changes relating to the ggml tensor library for machine learning mtmd Related to multimodal functionality (video/image/audio) labels Sep 1, 2026
@abra-code

Copy link
Copy Markdown

upvote

@ggerganov ggerganov added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Sep 18, 2026
@ggerganov
ggerganov merged commit 5b335f4 into ggml-org:master Sep 18, 2026
23 of 27 checks passed
fencerJP pushed a commit to fencerJP/llama-apu that referenced this pull request Sep 19, 2026
* ggml : check for allocation failures to prevent crashes

* wording
liquidspikes pushed a commit to liquidspikes/llama.cpp that referenced this pull request Sep 19, 2026
* ggml : check for allocation failures to prevent crashes

* wording
LadislavSopko pushed a commit to 0ics-srls/llama.cpp that referenced this pull request Oct 5, 2026
* ggml : check for allocation failures to prevent crashes

* wording
frostyautumnleaf pushed a commit to frostyautumnleaf/llama.cpp that referenced this pull request Oct 5, 2026
* ggml : check for allocation failures to prevent crashes

* wording
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. mtmd Related to multimodal functionality (video/image/audio)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ggml-backend: discarded ggml_gallocr_reserve_n return value turns an allocation failure into a segfault

3 participants