[Bugfix] Handle libsndfile sf_error(NULL) race condition in audio fallback#37782
Merged
Isotr0py merged 2 commits intovllm-project:mainfrom Mar 22, 2026
Merged
Conversation
…lback Signed-off-by: Andreas Karatzas <akaratza@amd.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request addresses a race condition in libsndfile error handling by including 0 as a recognized error code. The fix is correct and the explanation in the comments is clear. My review includes one suggestion to improve code robustness by making the set of error codes immutable.
RhizoNymph
pushed a commit
to RhizoNymph/vllm
that referenced
this pull request
Mar 26, 2026
…lback (vllm-project#37782) Signed-off-by: Andreas Karatzas <akaratza@amd.com>
SouthWest7
pushed a commit
to SouthWest7/vllm
that referenced
this pull request
Mar 27, 2026
…lback (vllm-project#37782) Signed-off-by: Andreas Karatzas <akaratza@amd.com>
khairulkabir1661
pushed a commit
to khairulkabir1661/vllm
that referenced
this pull request
Mar 27, 2026
…lback (vllm-project#37782) Signed-off-by: Andreas Karatzas <akaratza@amd.com>
nithinvc
pushed a commit
to nithinvc/vllm
that referenced
this pull request
Mar 27, 2026
…lback (vllm-project#37782) Signed-off-by: Andreas Karatzas <akaratza@amd.com> Signed-off-by: Nithin Chalapathi <nithin.ch10@gmail.com>
JiantaoXu
pushed a commit
to JiantaoXu/vllm
that referenced
this pull request
Mar 28, 2026
…lback (vllm-project#37782) Signed-off-by: Andreas Karatzas <akaratza@amd.com>
mtparet
pushed a commit
to blackfuel-ai/vllm
that referenced
this pull request
Apr 9, 2026
…lback (vllm-project#37782) Signed-off-by: Andreas Karatzas <akaratza@amd.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes regression after: #37058
When multiple threads concurrently fail sf_open_virtual() on unsupported formats (e.g. MP4 bytes passed as audio), sf_error(NULL) may return 0 instead of the actual error code due to a global-state race in libsndfile. This caused code=0 LibsndfileError ("Garbled error message from libsndfile") to bypass the pyav fallback in load_audio(), crashing requests that send video bytes as audio_url (e.g. audio-in-video). In this PR, 0 is added to _BAD_SF_CODES so the pyav fallback triggers for this case.
There is also an upstream soundfile issue: bastibe/python-soundfile#479
Testing
pytest -s -v tests/entrypoints/openai/chat_completion/test_audio_in_video.py::test_online_audio_in_video_interleavedcc @kenroche