Skip to content

Commit 95056af

Browse files
author
Charles
committed
linux-alsa: stop reopen thread before destroying abort_event
This was found by inspecting a crash backtrace that aborted in glibc's __pthread_mutex_cond_lock from os_event_timedwait in the ALSA plugin's reopen thread. alsa_destroy was destroying abort_event without first stopping and joining the thread, which also waits on that event. If destruction wins the race, the waiter can wake and try to relock a mutex belonging to an event that has already been destroyed. Stop the reopen thread first so abort_event stays valid for the lifetime of the wait.
1 parent d412d64 commit 95056af

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

plugins/linux-alsa/alsa-input.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ void alsa_destroy(void *vptr)
154154
{
155155
struct alsa_data *data = vptr;
156156

157+
_alsa_stop_reopen(data);
158+
157159
if (data->handle)
158160
_alsa_close(data);
159161

0 commit comments

Comments
 (0)