-
-
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
Crash when clicking on "Remove Channel" #1679
Comments
Upon some research I've found this: http://stackoverflow.com/questions/17943486/removing-itself-from-layout-using-context-menu. However it should work just with subclasses of |
But you're not removing it from FxChannel, you're removing it from its |
Well, I tried changing: // From this
delete m_fxChannels[index];
// To this
m_fxChannels[index]->deleteLater(); But as I said, |
@badosu sorry that's what I get for speculating on the code rather than reading it. Can you show me the stack trace that causes this? We may need to mark them for deletion via a signal, but I'm having a hard time finding the stack of events inside the code that causes this. -Tres |
Sure, just a sec.
As I said, this is a somewhat apparently random segfault, somewhat the processing time of the function + the alignment of the stars make it delete the variable before returning to the event that originated it's deletion. Maybe this can not even happen on some machines. I suspect this may even be the cause of segfaults @DanWin experienced when he developed the "Remove unused channel" feature. |
In this case at least I was able to point what is the cause of the crash and how to fix it. If you are able to pinpoint how to reproduce the crash and even find what's the deallocation (the most frequent cause) that's causing it we have higher possibilities of fixing it. The issue with these kind of crashes is that they are utterly difficult to trace, some people experience them, some people not. Some people experience them frequently, some not. It's a developer's hell. |
@Spekular Please don't delete! Every bit of information on crashes is important, I just tried to offer you our perspective. If your bug report is not a duplicate of one that is already filed this help us a lot tracking how the software is stable. |
@badosu I was just trying to avoid sidetracking this issue (I failed). I posted here as a replacement for messaging you/tres. I'll create a new issue for this crash I suppose, but I don't think our conversation here is necessarily relevant, so by deleting it this issue convo is neater. Will you delete your messages too? If you reallywant to document this I guess here's a summary: |
Yes, it is indeed the same issue I had when implementing the "remove unused channels" function. It relies on this function and I can reproduce it just by creating a few (20 or more) channels and holding the delete key or using my new function. At some random point deletion of the channel will cause a segfault. |
Ok... I'm starting to see this (again) thanks for the information. Can we cast it back to QVector element and delete later then? -Tres |
Sometimes the application could crash when deleting a channel because it would still be used when the method returned. This commit makes the channel be deleted only after the stack returns to the event loop. Fixes LMMS#1679
Sometimes the application could crash when deleting a channel because it would still be used when the method returned. This commit makes the channel be deleted only after the stack returns to the event loop. Fixes LMMS#1679
Sometimes the application could crash when deleting a channel because it would still be used when the method returned. This commit makes the channel be deleted only after the stack returns to the event loop. Fixes LMMS#1679
Sometimes the application could crash when deleting a channel because it would still be used when the method returned. This commit makes the channel be deleted only after the stack returns to the event loop. Fixes LMMS#1679
Was this fixed in master branch? |
@midi-pascal This PR fixes it: #1707 However, this solution relies on QObject, a better approach needs to be implemented. |
@badosu Thanks for the hint! |
@midi-pascal I just took a look, and actually that PR contains the new approach that should fix this issue without introducing QObject inheritance, but I couldn't make it work. |
Btw this doesn't appear to fix all issues. The "remove unused channels" feature still results in memory access errors, though many seem to be due to synchronization errors. Here's one example (valgrind):
In this case, the Fx Channel has already had a render job scheduled, but the actual FxChannel gets deleted while the job is still in the queue, resulting in an error once the job is processed. Then you get another error after all that:
This one appears to be because we lack any synchronization mechanism for the actual |
@Wallacoloo You're right, that's why I said I was not able to make this work. This PR still has some convo from the |
I'm going to assign myself to this one, as I just ran into it on my make-music-with-master-bug-hunt. This really should be fixed before releasing. I just hope I'll be able to find an acceptable solution where others have failed 😅 |
PR to fix this available at #2675, testing welcome! |
@Fastigium @badosu is this fixed by #2675? |
@Umcaruje I'm gonna go with "yes", unless you know of anyone who's been able to produce a channel removal crash after that PR was merged 😊 |
Not sure if useful, but I had the exact same Problem but didn't say it because the issue was already there, that PR fixed it for me. |
K 👍 Closing. |
Congrats @Fastigium! |
If you click on "remove channel" when right clicking a FX Channel, sometimes it segfaults.
This is a bug of the same class than #1584, i.e. the object that creates the context menu is the same that is deleted before the internal method returns. Sometimes it deletes before, sometimes later, what causes this seemingly random segfault.
See #1678 and #1625 for details on a bug of the same class.
The text was updated successfully, but these errors were encountered: