Corrupt parakeet-ctc-110m cache passes validation: missing model.mil makes CoreML segfault on every launch
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
- 1-2 ngày
- Mức phù hợp với người mới
- 56/100
Hướng nghiên cứu
Read ModelCache.validateCompiledModelLayout, ModelHub.loadModelsOnce, and CtcModels.modelsExist to trace how cache completeness is decided; start by checking whether the validator rejects the reported bundle with model.mil and other files missing. Compare cache checks in both paths, then confirm a corrupt cache is rejected and triggers a fresh download before CoreML loads it.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Environment
- FluidAudio 0.17.7 (
503b4bd), used by Voz 0.3.1 throughCtcModels.downloadAndLoad()for vocabulary boosting - macOS 27.0 (26A428), Apple Silicon (arm64)
- Cache:
~/Library/Application Support/FluidAudio/Models/parakeet-ctc-110m-coreml/
What happened
After the first download the CTC cache was incomplete. There was no *.partial file and no revision marker:
parakeet-ctc-110m-coreml/
├── AudioEncoder.mlmodelc/
│ ├── analytics/coremldata.bin
│ ├── coremldata.bin
│ ├── metadata.json
│ ├── model.mil (1060924 bytes, correct)
│ └── weights/weight.bin (109805537 bytes; HF: 100778304, sha256 does not match)
└── MelSpectrogram.mlmodelc/
├── analytics/coremldata.bin
├── coremldata.bin
└── weights/weight.bin (567712 bytes, correct)
# model.mil and metadata.json are missing
# vocab.json, config.json and the tokenizer files are missing
From then on the host app crashed on every launch (7 crash reports in a row):
EXC_BAD_ACCESS (SIGSEGV), KERN_INVALID_ADDRESS at 0x0000000000000000
CoreML (anonymous namespace)::makeProgramWithMemoryLayout(...)
CoreML -[MLE5ProgramLibraryOnDeviceAOTCompilationImpl createProgramLibraryHandleWithRespecialization:error:]
CoreML -[MLE5ProgramLibrary prepareAndReturnError:]
CoreML -[MLE5Engine initWithContainer:configuration:error:]
...
CoreML +[MLModel modelWithContentsOfURL:configuration:error:]
Just before each crash, the system log shows:
[com.apple.coreml] Failed to parse ML Program. It is likely an invalid or broken model.
[com.apple.coreml] Not adding memory layout to program because the source program is null.
CoreML segfaults here instead of throwing. Since the process dies instead of getting an error, the purge-and-redownload fallback in ModelHub.loadModels never runs.
Why the cache is never repaired (0.17.7)
CtcModels.modelsExistreturnsfalsebecausevocab.jsonis missing, soCtcModels.downloadruns.downloadcallsModelHub.loadModels(repo, modelNames: ["MelSpectrogram.mlmodelc"]).- In
loadModelsOnce,matchesRevisionistrue: there is no marker, and the revision ismain.allModelsExistis alsotrue, because it only checks that the two.mlmodelcdirectories exist. So nothing is downloaded. ModelCache.validateCompiledModelLayoutchecks only for the directory andcoremldata.bin, so it passes.MLModel(contentsOf:)crashes the process. The next launch repeats steps 1–5.
From reading current main (a31f151), incompleteFiles now also rejects bundles that contain *.partial files (#819). But a bundle with coremldata.bin present, model.mil missing and no .partial file still counts as complete, so I believe this still reproduces there. I did not run main.
Suggested fixes
- Have
validateCompiledModelLayoutrequiremodel.milandweights/weight.binfor ML Program bundles, or compare every file against the HF tree listing. - Run the size/content-ID check (
hasMatchingContent) when deciding whether the cache is valid, not only during download. This would also catch the oversizedweight.bin. - Write the revision marker, or a separate "download complete" sentinel, only after every file has been verified. Treat a cache without it as incomplete.
- Use one completeness check for both
CtcModels.modelsExistandModelHub, so they cannot disagree the way they did here.
Workaround
Delete parakeet-ctc-110m-coreml/. On the next launch the models download again, complete and correct, and the app starts normally.
Notes
- I don't know how the oversized
AudioEncoderweight.bincame about. The first launch, which ran the download, was probably interrupted, so a resume/append problem inFileDownloaderis possible, but I have not confirmed it. - The SIGSEGV on a broken ML Program is arguably also a CoreML bug that Apple should fix. Either way, FluidAudio cannot catch it, so the cache check needs to catch the broken bundle before it reaches CoreML.
Downstream report: https://github.com/Joelheile/voz/issues/89
- Ngôn ngữ chính
- Swift
- Star
- 3k
- Fork
- 451
- Merge trung bình
- 1 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 93
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 FluidInference/FluidAudio
-
ASR long-form: sentence-final period lost when a window ends inside the pause before the next sentence (both paths)Có thể đã có người làm @maboa đã nhận 5 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
FluidInference/FluidAudio#1110 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Full-duplex recognition researchĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
FluidInference/FluidAudio#1007 · 7 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Model Support RequestsCó thể đã có người làm @BrandonWeng đã nhận 467 ngày trước. Đang mởenhancement question
FluidInference/FluidAudio#49 · 92 bình luận · 6 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của FluidInference/FluidAudio
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ls1intum/artemis-ios#571 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ml-explore/mlx-swift-lm#791 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
a: plugins d: docs/ fyi-macos P2 platform-ios platform-macos team-ios
Độ 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
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
swiftlang/github-workflows#352 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày