-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a few segfaults in the PulseAudio driver upon shutdown (#22)
A few segfaults were discovered in the PulseAudio driver during application shutdown. While it's hard to say for certain whether these changes resolve the discovered segfaults, they seem to greatly reduce their incidence rate, at a minimum. The fixes involve: * Implementing `Drop` for `StreamReadFuture`, `PulseFuture`, and `InitializingFuture`, all of of which pass a `Waker` instance into a PulseAudio callback. If `libpulse` attempts to run the callback after the futures/tasks have been dropped, this results in a segfault. * This segfault was only observed with `StreamReadFuture`, however it was fixed for all three future types since they all follow the same pattern. * Unsetting the read callback on the audio stream when closing a `StreamReadNotifier`. The exact cause isn't clear, but there appears to be some condition where `libpulse` attempting to call the read callback during application shutdown would result in a segfault (that is distinct from the `Waker` issue described above)
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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