Fix crashes and deadlocks with previewing preset#3905
Conversation
|
Bug confirmed and proposed fix working. Approved |
|
I can't reproduce the bug on my machine. Linuxmint 17.3 at fbfcb43 |
|
@zonkmachine I clarified the "steps to reproduce" section. I can confirm the issue with the same revision. Could you please test that again? |
|
Ah, got it! Bug verified. Testing the fix but it doesn't appear to shut down completely. Alt + F4. |
|
Okay. There is a releated bug #3456. I'll add a fix for that. It would help fixing new issue. |
|
@PhysSong Also double-click in the file browser. The second click happens outside the previewing and so add the controller. I fixed that too. |
Both bugs and their fixes confirmed. |
|
This PR seems to work good. However, I will add some commits to remove potential chances to generate errors because I've changed some lock-related parts. I think using atomic pointers can be a solution. |
Done by bdf4884. |
|
I've retested this PR and it still works like a charm. I also retested the bug in question and it seem the crash on exit doesn't happen if the project is playing, only when previewing and the song is stopped. |
|
Merge? |
|
Totally... |
|
Okay. I'll merge it soon. 😄 |
* Fix crash when closing while previewing preset * Fix deadlock on previewing presets while playing arpeggio
While investigating #3897, I found another bug.
Steps to reproduce:
Edit: clarified steps to reproduce.
Here's a part of a backtrace:
So I added
PlayHandle::TypePresetPreviewHandleinInstrumentTrack::silenceAllNotes(). I also add simple safety check code inPresetPreviewPlayHandle::isFromTrack().Note:
PresetPreviewPlayHandle::play()does nothing since #2586, so the code below is no longer needed. However, leaving it as-is looks fine for me.lmms/src/gui/FileBrowser.cpp
Lines 448 to 455 in fbfcb43
Edit: I added a commit which fixes #3456, per #3905 (comment).