fix(media): skip Gst.DeviceMonitor.stop() on macOS to avoid segfault#1074
Closed
tfrere wants to merge 1 commit into
Closed
fix(media): skip Gst.DeviceMonitor.stop() on macOS to avoid segfault#1074tfrere wants to merge 1 commit into
tfrere wants to merge 1 commit into
Conversation
On macOS 26 ("Tahoe"), calling Gst.DeviceMonitor.stop() can segfault
inside gst_device_provider_stop -> avfdeviceprovider, which kills the
whole Python daemon with SIGSEGV before any Python traceback can be
emitted. The parent process only sees "exit code 1" with no clue.
The monitor is short-lived (one enumeration at boot per source type)
so skipping the explicit stop on darwin is acceptable: the underlying
providers are reclaimed when the Python object is garbage collected
and when the process exits.
Other platforms keep the original behavior, wrapped in a defensive
try/except so an unexpected stop() failure logs instead of propagating.
Tested on macOS 14 (Sonoma) and macOS 26 (Tahoe) with the Reachy Mini
daemon in USB mode.
Made-with: Cursor
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.
Summary
Stacked on top of #1069 (
mobile-app-integration-light). Carve-out from the umbrella draft #1070.On macOS 26 ("Tahoe"), calling
Gst.DeviceMonitor.stop()can segfault insidegst_device_provider_stop->avfdeviceprovider, which kills the whole Python daemon with SIGSEGV before any Python traceback can be emitted. The parent process only sees "exit code 1" with no clue.The monitor is short-lived (one enumeration at boot per source type) so skipping the explicit stop on darwin is acceptable: the underlying providers are reclaimed when the Python object is garbage collected and when the process exits. Other platforms keep the original behavior, wrapped in a defensive try/except so an unexpected
stop()failure logs instead of propagating.Tested on macOS 14 (Sonoma) and macOS 26 (Tahoe) with the Reachy Mini daemon in USB mode.
Files
src/reachy_mini/media/device_detection.py(+18 / -1)Notes
mainand is stale (~80 commits behind).mobile-app-integration-lightinstead, so the fix lands on the active mobile-app branch without waiting formainto catch up.35a188a8ondev/mobile-app-integration.Test plan
stop()path is exercised and that any unexpected failure is logged but does not propagate.Made with Cursor