stablediffusion-ggml backend segfaults instead of returning an error when a Metal pipeline fails to compile, and its stderr never reaches the LocalAI log
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Lĩnh vực
- backend, observability
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện lỗi thông qua một yêu cầu /video và kiểm tra đường dẫn tạo pipeline stablediffusion-ggml cùng với launcher trong run.sh. Xác nhận rằng một pipeline Metal bị lỗi trả về lỗi thay vì được sử dụng, và stderr của backend hoặc nguyên nhân của nó được ghi vào log của LocalAI; chạy lại việc tái hiện để xác minh rằng không có segfault.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
When a Metal pipeline fails to compile, the backend logs the failure and then
uses the pipeline anyway. The null dereference takes SIGSEGV inside cgo and the
process dies. LocalAI sees only exitCode=2 and rpc error: EOF.
Compounding it, the backend's stderr is not attached to anything LocalAI logs, so
the underlying Metal error is invisible from the server side. Between the two,
a precise and well-reported error from Metal reaches the operator as an opaque
crash.
Environment
- LocalAI 4.7.1
- Backend
metal-stablediffusion-ggml, digest
sha256:9cafbf0956c55791cac472f20c73f55f425eeaefeb9d9a9bb22c9c5b8e8d7258 - macOS 26.5.2 (build 25F84), Apple M3 Ultra, 256 GB unified memory
What the operator sees
Nothing useful. A /video request fails, and the LocalAI log contains only:
exitCode=2
rpc error: code = Unavailable desc = error reading from server: EOF
No Metal error, no kernel name, no indication that anything compiled or failed to
compile. Two earlier attempts against this backend produced exactly this and were
abandoned undiagnosed, because there was nothing to go on.
What is actually happening
Metal reports the failure correctly and precisely:
compiling pipeline: kernel_mul_mv_ext_bf16_f32_r1_5
[ERROR] MTLLibraryErrorDomain Code=5 "Function kernel_mul_mv_ext_bf16_f32_r1_5
was not found in the library"
SIGSEGV: segmentation violation, signal arrived during cgo execution
The [ERROR] line shows the failure is detected and logged. The SIGSEGV
immediately after shows the result is then used without a nil check. A returned
error at that point would have made this a one-line diagnosis.
How to see it at all, which is the second half of the report
The backend's stderr does not reach LocalAI's log. To capture it we had to edit
the backend's own launcher, appending a redirect to the exec line in
run.sh:
exec "$CURDIR"/stablediffusion-ggml "$@" 2>>/tmp/sd-ggml-stderr.log
then reproduce, then restore the file. That is not a reasonable diagnostic path
for an operator, and it is the only reason the missing kernel in the companion
report was ever identified (companion issue: #AAA).
What would help
- Check the pipeline before using it. A failed
newComputePipelineState(or
equivalent) should propagate an error rather than being dereferenced. This is
the fix that matters; it converts an opaque crash into an actionable message
for every future missing-kernel case, not just this one. - Surface backend stderr in the LocalAI log, or document how to capture it.
A backend that dies withexitCode=2and no output leaves the operator with
nothing. - Optionally, include the Metal error text in the gRPC error returned to
LocalAI, sorpc error: EOFcarries a cause.
Why this is worth fixing independently of the missing kernel
The companion report is one absent kernel in one build, and a rebuild will fix
it. This defect turns any future pipeline-compile failure, from any cause,
into an uninformative segfault with no log output. The next occurrence will cost
the next person the same days.
Notes
Happy to run diagnostics or test a patched build on request. The model and
hardware stay available specifically to re-test.
- Ngôn ngữ chính
- Go
- Star
- 49.8k
- Fork
- 4.5k
- Merge trung bình
- 19 giờ 42 phút
- Pull request đã merge (30 ngày)
- 354
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của mudler/LocalAI
-
[Bug] Qwen3.8-27b Uncensored Fails to Download due to 404Có thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởbug unconfirmed
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Realtime: ASR EOU language tags leak into the LLM conversation (unintended reply-language switching)Có thể đã có người làm @nexxtmobile đã nhận 9 ngày trước. Đang mởarea/api bug unconfirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Open Responses API doesn't accept "output_text" as an input ItemCó thể đã có người làm @localai-org-maint-bot đã nhận 28 ngày trước. Đang mởbug unconfirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
mudler/LocalAI#12337 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Gallery model audio-cpp-sortformer-diarization fails to install: SHA mismatch, reproducible across retriesCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
mudler/LocalAI#11995 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Agent pool Postgres DSN is logged in cleartext, including the password, while the auth DSN is redactedCó thể đã có người làm @localai-org-maint-bot đã nhận 44 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
mudler/LocalAI#11991 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của mudler/LocalAI
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area/frontend/library-panels automated-triage type/bug type/ux
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
microsoft/azure-linux-image-tools#954 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
panic "time: missing Location in call to Time.In" on MySQL via aws_rds since v0.8.0Có thể đã có người làm @tylertechgraves đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
open-policy-agent/opa-control-plane#452 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[bug bash] Actor logs are controlled by Kubernetes RBAC on the pool namespace, not atespace rolesĐang mởarea/cli area/security bug-bash kind/docs
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 80/100
agent-substrate/substrate#3242 ·
Maintainer thường phản hồi trong vòng 1 ngày