You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
libobs: pthread init failures are checked with < 0 and never caught #2152
Three pthread initializations check for failure with < 0. The pthread functions return a positive error number on failure, never a negative one, so these failures are never caught:
libobs/obs.c.h: obs_context_data_init_wrap() checks pthread_mutex_init(&context->rename_cache_mutex, NULL) < 0. If the init fails, the context carries on with an uninitialized mutex.
libobs/util/threading-posix.c: os_event_init() checks pthread_mutex_init(...) < 0 and pthread_cond_init(...) < 0. On failure it returns 0 and hands back an event whose mutex or condition variable is uninitialized.
These inits almost never fail on Linux or macOS, so this is a robustness fix: under resource exhaustion, a failed init should fail the creation cleanly instead of leaving a lock that isn't valid. Upstream has the same code; the first dates from 2014. Found while fixing #2141.
Activity
rdoupe commentedon Oct 24, 2026
Claiming: #2152.
libobs: Check pthread init and thread start results with != 0 (obs-ru…