-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix crashes on deleting an FX channel #2675
Conversation
DeRobyJ reported an issue with this PR, namely that changing the FX channel on an instrument doesn't actually change the channel it sends to. Looking into that now. |
c972a04
to
1e7c74e
Compare
Right, rebased to take care of that. More testing welcome! |
Test. No crash. Job well done! |
@Fastigium I have a carla-related error:
Though that's more related to #2669. |
We'll probably have to add |
I can confirm this fixes #2667. I'll do even more extensive crash testing tomorrow. |
@zonkmachine @Umcaruje Yay for the crashlessness (that's a word now 😁)!
Woops, I'll look into that. @tresf I guess Travis doesn't build the carla plugin at the moment? |
@Fastigium I did a stress test, managed to crash it again: I did a pretty serious bash with a LFO moving channels extremely fast and moving channels and removing channels. I needed to rebase this branch to carlacompile though. I'll do a fresh build and continue the stress testing tommorow.
My build may be stale though. |
@Umcaruje Thanks for taking the time for such a stress test! |
Well, who'da thunk! The copy constructor is still used on |
@Umcaruje The PR turned out to be so trivial that I went ahead and merged it after getting all greens from Travis. If you have time for another stress test, please update to the latest In general, there seem to be many uses of the copy constructor left in the code base. I think I may be able to automate the search for them, but I'm not sure if it's worth it. Getting rid of all of them is bound to be a pain in the backside; I/we would need to check for each individual use if the copy constructor isn't there for a reason. If users keep running into more |
If you do need to do a wide sweep of the copy constructor might want to Jonathan Aquilina On Wed, Mar 16, 2016 at 10:03 AM, Fastigium [email protected]
|
@eagles051387 Thanks for the pointer, I hadn't heard of
Again, you don't see it, but under the hood, it uses it. Foreach was easy to grep for, so that has been done, but grepping for functions like the example above is less practical. Plus, there are probably more code constructs that copy secretly. My plan for a sweep is therefore based on a different observation: if an object method is never referenced in the code, it is optimized out. After I got rid of the copy constructor that caused Umcaruje's latest crash, that copy constructor disappeared from the gdb breakpoint tab completion. So I plan to reverse that mechanism and somehow find out on which code lines the copy constructors that are still in the compiled code are invoked. It's not trivial, but it should be doable 😅, and it should eliminate the copy constructor entirely |
Im sure there is a way you can git grep for that particular string that you Jonathan Aquilina On Wed, Mar 16, 2016 at 7:38 PM, Fastigium [email protected] wrote:
|
@eagles051387 Thanks for trying to help, but I think I'll manage. This goes beyond what git grep is intended for. Besides, the way I propose does not involve going through files one at a time. |
Not a problem. Sorry if I potentially derailed the discussion of the Jonathan Aquilina On Thu, Mar 17, 2016 at 1:59 PM, Fastigium [email protected] wrote:
|
@eagles051387 No problem 😉 Anyway, to get back on-topic: this PR seems ready to merge to me with one exception. It now introduces a mixer lock in GUI code. That does not help the efforts to separate GUI and core. I'll see if the lock can be moved to core without reintroducing channel removal crashes. |
Lock the mixer before performing a channel delete to prevent any race conditions causing a crash. Also, update the audioport FX channel when an InstrumentTrack's FX channel is changed to prevent the audioport mixing to a nonexistent channel.
…crash In Qt, it is not safe to delete a QObject inside a signal emitted by that QObject. This happened with FxLine when removing an FX channel using the context menu. This commit changes that by using deleteLater() instead of delete on the FxLine. It also hides the FxLine to prevent a ghost of it being drawn when deleting the last non-master FX channel.
1e7c74e
to
82055a9
Compare
Rebased to move the mixer lock from |
I'll do another stress test once I get back home.
|
@Umcaruje Woah, you have time for that besides the mountain of BoL3 submissions? Respect 😁! And good luck with that mountain btw! |
Ok, I did an extencive stress test: I had 4 LFO's going at high speeds x 100 with different phases, hooked up to the FX channel selectors of 4 instruments in a random project file: Then I added around 80ish channels, and started moving them around, removing them, sending a channel to 10 other and then removing it, I also removed unused channels. I repeated the process a couple of times. It makes an interesting lightshow in the FX mixer: All this lasted around 5-10 mins. During all that time I haven't experienced a single crash or a hang. LMMS didn't even slow down and I was using SDL as my sound driver on Linux. So I have to thank you @Fastigium for the wonderful work you've done. I'm going to close #2192 cuz that seems to be fixed by your merged commits. |
Agreed, kudos @Fastigium. Sounds like we're getting ready for an RC2. 👍 |
And its gonna be really stable 👍 |
Awesome! Thanks for the testing and encouragement 😊! I'll leave this PR open a little while longer in case someone has remarks about the code. |
If a binary is made, i will test win32 |
You can make it yourself, its not rocket science. All you need is a VM and some good will: Just instead of cloning the main repo, clone Fastigium's repo. |
It's been more than a week without comments, so I'm merging this 😊. @tresf I think I'd prefer to complete the work on the export crashes before RC2 is released. I'm considering a slightly larger overhaul of the audio interfaces code, and if that happens it'd be nice to have it in an RC before it ends up in a stable release. |
👍 |
@Fastigium I read the explanation in the other thread and it makes perfect sense thanks. 👍 |
This PR fixes three crashes that would happen when deleting an FX channel. Now that #2669 has been merged, using LMMS with this PR should be pretty much random-crash-free. At least I can't produce any 😋. So go on, go wild, do everything crazy you can come up with concerning the FX mixer, and post what you did plus the backtrace if you still manage to make it crash