]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
whisper : catch C++ exceptions in whisper_init_with_params_no_state (#3831)
authordanscMax <redacted>
Tue, 2 Jun 2026 11:25:29 +0000 (14:25 +0300)
committerGitHub <redacted>
Tue, 2 Jun 2026 11:25:29 +0000 (13:25 +0200)
commit610e664ba7cfe3af46125ed1b5a1184fccb51bcd
treeeccaa6519ec0e4cdc47a3895b445a050c7c67656
parente5d44125788a69cca621c85c4d022e83162ac113
whisper : catch C++ exceptions in whisper_init_with_params_no_state (#3831)

whisper_model_load() can throw instead of returning false: std::runtime_error
from this file (failed ggml context / no compatible buffer type), or
vk::SystemError / vk::OutOfDeviceMemoryError from the ggml-vulkan backend during
device/buffer allocation.

whisper_init_* are extern "C", so a C++ exception unwinding across that boundary
aborts non-C++ callers (Rust via whisper-rs, Go via cgo) -- on Windows
STATUS_STACK_BUFFER_OVERRUN (0xC0000409) -- even though the function already
returns NULL on failure. Wrap whisper_model_load() in try/catch and route any
throw into the existing NULL-return path.

Co-authored-by: Claude Opus 4.7 <redacted>
src/whisper.cpp