Closed theGreatWhiteShark closed 9 months ago
Another problem: Occassionally upstream JACK code used in our JackAudioDriver
gets trapped in a deadlock when stopping the driver (see https://github.com/jackaudio/jack2/issues/395).
This does not occur as often as the crashes on my machine. But is still annoying.
Probably due to some upstream JACK bugs (not sure) Hydrogen does occassionally segfault when stopping the
JackAudioDriver
. Turns out JACK has a number of issues with thread joining. During teardown of the driver we must ensure it does not do any communication, like locking theAudioEngine
or enqueuing a message in ourLogger
. Otherwise the thread callingjack_client_close
might segfault.Now, the callback of the
AudioEngine
checks its state twice. Once without locking (in order toreturn
when it is not ready yet/anymore) and another time while locked to properly check the state. It is a little dirty. But I do not see what else we can do from within the Hydrogen code baseFixes #1929
Previous text:
Lately we have quite a number of reports of Hydrogen crashing during shutdown or song export all related to our
JackAudioDriver
(#1902, #1907, #1867).I have to admit I have seen those for quite a while now on my device. But since they are occurring very rarely (like one out of 20) and neither my Hydrogen nor JACK are in a "production" setup, I didn't bothered after giving it a first, inconclusive shot. But the JACK version I use (
1.9.21
) seems to tickle down the package repos and more and more users get the same issues as well.I wrote a
Go
-based integration test starting up Hydrogen hundreds of times and killing it via OSC right away. This way I'm now able to reproduce the issue.So far it looks like this is an upstream problem and code of JACK crashes when attempting to tear down the
JackAudioDriver
. We might need a way to protect against crashing driver code. But I'm far from understand what is going on and still need to check and read into a couple of things first.