ollama - 💡(How to fix) Fix minicpm-v:8b: SIGSEGV decoding a valid WebP image (mtmd_helper_bitmap_init_from_buf decode failure)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

minicpm-v:8b reproducibly crashes the Ollama runner when sent a particular valid WebP image. The same image is processed successfully by llama3.2-vision:11b on the same daemon, so the issue is specific to minicpm's multimodal tokenization path, not a general WebP problem.

Error Message

  1. The HTTP request returns 500: model runner has unexpectedly stopped, this may be due to resource limitations or an internal error.
  • The failed to decode image bytes log line suggests the WebP decode in the multimodal helper returns failure but the calling code dereferences a null/uninitialized pointer rather than returning an error.

Root Cause

minicpm-v:8b reproducibly crashes the Ollama runner when sent a particular valid WebP image. The same image is processed successfully by llama3.2-vision:11b on the same daemon, so the issue is specific to minicpm's multimodal tokenization path, not a general WebP problem.

Code Example

mtmd_helper_bitmap_init_from_buf: failed to decode image bytes
SIGSEGV: segmentation violation
PC=0x1031de5dc m=7 sigcode=2 addr=0x38
signal arrived during cgo execution

goroutine 39 gp=... m=7 mp=... [syscall]:
runtime.cgocall(0x102fd6410, ...)
github.com/ollama/ollama/llama._Cfunc_mtmd_tokenize(...)
github.com/ollama/ollama/llama.(*MtmdContext).MultimodalTokenize.func5(...)
github.com/ollama/ollama/llama.(*MtmdContext).MultimodalTokenize(...)
        /Users/runner/work/ollama/ollama/llama/llama.go:570 +0x1e8
github.com/ollama/ollama/runner/llamarunner.(*ImageContext).MultimodalTokenize(...)
        /Users/runner/work/ollama/ollama/runner/llamarunner/image.go:76 +0x118

---

ggml-metal-device.m:608: GGML_ASSERT([rsets->data count] == 0) failed
RAW_BUFFERClick to expand / collapse

Summary

minicpm-v:8b reproducibly crashes the Ollama runner when sent a particular valid WebP image. The same image is processed successfully by llama3.2-vision:11b on the same daemon, so the issue is specific to minicpm's multimodal tokenization path, not a general WebP problem.

Reproduction

  1. ollama pull minicpm-v:8b
  2. Send a chat request to /api/chat with model="minicpm-v:8b" and one image in messages[].images. The triggering image (described below) reproduces the crash on every attempt.
  3. The HTTP request returns 500: model runner has unexpectedly stopped, this may be due to resource limitations or an internal error.

The exact file is attached. — it's a 240 KB, 1080×1080 WebP, VP8 encoding, YUV color (file output: RIFF (little-endian) data, Web/P image, VP8 encoding, 1080x1080, Scaling: [none]x[none], YUV color, decoders should clamp). Other WebPs in the same directory (200–500 KB, similar dimensions) process fine on the same model, so the trigger appears to be something specific to this file's encoding.

Crash signature

From ~/.ollama/logs/server.log:

mtmd_helper_bitmap_init_from_buf: failed to decode image bytes
SIGSEGV: segmentation violation
PC=0x1031de5dc m=7 sigcode=2 addr=0x38
signal arrived during cgo execution

goroutine 39 gp=... m=7 mp=... [syscall]:
runtime.cgocall(0x102fd6410, ...)
github.com/ollama/ollama/llama._Cfunc_mtmd_tokenize(...)
github.com/ollama/ollama/llama.(*MtmdContext).MultimodalTokenize.func5(...)
github.com/ollama/ollama/llama.(*MtmdContext).MultimodalTokenize(...)
        /Users/runner/work/ollama/ollama/llama/llama.go:570 +0x1e8
github.com/ollama/ollama/runner/llamarunner.(*ImageContext).MultimodalTokenize(...)
        /Users/runner/work/ollama/ollama/runner/llamarunner/image.go:76 +0x118

A secondary Metal-backend assertion fires during cleanup after the SIGSEGV:

ggml-metal-device.m:608: GGML_ASSERT([rsets->data count] == 0) failed

…followed by panic during panic / SIGABRT. Full server-log excerpt available on request.

Environment

  • Ollama: 0.23.3
  • Model: minicpm-v:8b (ID c92bfad01205)
  • OS: macOS 26.5 (build 25F71)
  • Hardware: Apple M4, 24 GB unified memory
  • The daemon was not under memory pressure at crash time — ollama ps showed only minicpm loaded (~4.7 GB resident).

Notes

  • Reproduces deterministically across daemon restarts and across two separate sessions.
  • llama3.2-vision:11b (loaded against the same daemon, same image bytes) returns normally — so the byte stream is valid as far as another model's image decoder is concerned.
  • The failed to decode image bytes log line suggests the WebP decode in the multimodal helper returns failure but the calling code dereferences a null/uninitialized pointer rather than returning an error.

Happy to run additional diagnostics.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

ollama - 💡(How to fix) Fix minicpm-v:8b: SIGSEGV decoding a valid WebP image (mtmd_helper_bitmap_init_from_buf decode failure)