-
-
Notifications
You must be signed in to change notification settings - Fork 407
Description
Describe the bug
When I have an audio chaser and I press "next", I sometimes experience a hang of QLC+ - at this point the last playing audio keeps playing, but the rest of QLC+ is unresponsive. I can't even go back to design mode, the only way to recover is to kill QLC+ and restart.
This seems to be timing (race condition) issue.
To Reproduce
Steps to reproduce the behavior:
- Add, say, 5 mp3's as Audio functions
- Create a chaser, and add all of the mp3's into the chaser, save it
- In the virtual console, create a cue list for the chaser
- Start the virtual console
- Start the chaser
- Press "next" repeatedly as fast as you humanly can. It will wrap around a few times from last track to the first, but after whacking the mouse left button about 50 times, I can consistently reproduce the issue. That said, some factors seem to make it more or less likely to happen (like cpu usage. Higher usage makes it more likely, it seems)
Expected behavior
No hang
Screenshots
Not really applicable
Desktop (please complete the following information):
- OS: Windows 10
- QLC+ Version latest git (and latest release 4.14.3)
- This is just a Windows laptop with audio out jack. Realtek chip.
Additional context
I'm fairly proficient at C++ and have been debugging this last weekend. Looking at the GDB thread backtraces, I can see many threads stuck on locking the mutex in InputOutputMap::claimUniverses() (ie, hundred of threads all waiting there). So it seems that somehow, some thread has locked that, and never released it. I can also not see any other thread that is clearly holding that lock (ie, the backtrace showing some line number where the lock would be held). This seems to imply that one of the threads locked, and then did not unlock, and went to do something else (or exit). I traced any codepath to see how that could happen but it's not immediately clear to me - wherever we lock, we also unconditionally unlock (and we don't have exceptions in Qt). The only thing I can think of right now is that some thread took the lock, and then crashed (uncaught exception?) but I have no evidence of this and I would have expected some log event about it.
I added some logging around claimUniverses() to see if I could see it happening, but that didn't really help - all I see is a final LOCKED and then nothing (as expected).
So really I'm asking for maybe some hints on where to check next or whether you have a hunch on where this may lie. I can do the further debugging. If not, no problem, I'm going to continue debugging this soon.