-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
work around skin change crash on Linux #3144
Conversation
Hopefully this brings us closer to releasing 2.3. |
It's good that we're narrowing this down, but I wonder if this hints at the root cause, which is probably some mis-ordering in the destructors? |
@foss- Did this branch fix the crash for you on macOS, as well? |
@ywwg Please check #3148 for simple steps that would also fix in Deere. Maybe those help debugging the issue. |
cd3ebb7
to
14d8126
Compare
Ah, I see what you are saying. Yes if we're just exposing a bug in QT then we shouldn't work too hard around it. |
…ion/loading of Spinny singletons
14d8126
to
cd1eff5
Compare
I'm really at a loss here: |
Have you triesd adding debug prints to the destructors of the relevant skin widgets, starting with the singleton class? That would help you get a more fine-grained picture of where the crash is actually coming from. The backtrace is useless because it's a response to some sort of X event, but that event is getting triggered by something... And the singletons use a tricksy model of storing pointers it doesn't own, which could be a problem. (Maybe converting those to shared_ptr instead of bare pointer would help?) |
ah, it seems the whole skin system assumes bare pointers. welp. |
I experience the crash after the new skin is loaded / same skin is reloaded. I added debug output for each Singleton that is added to the SingletonMap, and it's empty when the new skin is loaded. All goes fine until the skin is about to be displayed. Any more hints are welcome! |
weird. maybe we're not releasing a context somewhere? if we didn't clean up properly during skin destruction, we could be in a bad state. Then again, if this only affects a single version of QT, can we blocklist that version? do we know if ubuntu is going to update their version? |
Looks just like it. |
It is definitely related to WSpinny: if -in originally crashing Deere- I replace Spinny with CoverArt and leave everything else as is... |
IIRC they didn't update Qt in the last Ubuntu LTS releases I used, so I wouldn't count on it |
In the QT discord chat, someone says: " in Krita we provide appimages with our own Qt patches (five right now, if this page is up to date - https://phabricator.kde.org/T10838) which solves the biggest issues we had |
if you want to talk to them directly I can invite you |
this is good to know -- so it's not the singleton code, it's the spinny. Next I would try disabling different elements of the spinny -- the vinyl visualizer, the background, the indicator, etc |
Can you find a piece of the spinny that makes it crash vs not |
I can try that. what definitely makes a difference is how the skin is structured / where&when the spinny is displayed. thus my previous report of success. (btw found another way to fix it by restructuring the skin) |
even if this is only a crasher in one version of QT, it does seem like we might be doing something wrong if it's that fragile |
re documentation the assumed cause of the crash: the difference to other skins is that Deere had nested singletons per deck with multiple GL widgets with complicated 'visible' connnections:
Additionally, from watching how some complex templates show/hide widgets (like the LateNight mixer) I think it may be that some singletons may be visible twice for an instant. re: tsan/asan |
I meant @ywwg :D |
Still crashes on exit. But I have a backtrace!
|
this is a different bug so no need to fix it in this PR |
Please open a bug report then :D |
while you were runnig this branch / 2.3? |
This branch. But the issue affects 2.3 and master. I filed #3236 |
(with this type of bad destruction, the memory corruption could cause random issues on some builds and not on others.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if this PR is only an improvement and does not finally fix the crashes I propose to merge it now.
Since I am not able to assess all the changes in detail I would like to get confirmation from another reviewer.
If this is confirmed to fix the crash on macOS I'll polish it, move some structure out of skin.xml. |
Crashes on macOS 10.15.7 with mixxx master and beta persisting |
renamed to specify this workaround is for Linux only. Ready for merge. |
I'd appreciate if someone could test this, should take like a minute. To test:
Deere
|
I cannot reproduce the crashes anymore (I think some past mesa updates fixed them, but don't quote me on that). Neither this branch nor the current 2.3 crash for me. If it works for you, we can merge IMHO. |
my request was rathe rabout someone double-checking nothing broke. |
in the end the skin change bug on Linux (at least ~ubuntu 20.04 with Qt 5.12.8) was caused by the way we use Singletons.
I did look into the skin engine briefly a few times but -with my limited knowledge- I did not find the cause.
Tbh it's still a mystery to me why it failed with Deere since LateNight uses many more Singletons and nests them way more complicated.
Someone else may investigate this following the clues I'll post below.
Shade
fixed by removing the useless waveforms Singleton which were each loaded only ONCE in the skin.
Deere
fixed by replacing
two Spinny Singletons (with/without cover art) which were loaded in a heavily nested structure to accomodate
show_paralel_waveforms
,show_coverart
,show_4decks
with
3 Spinnies in one Singleton: 1 for stacked waveforms, 2/3 for split waveforms (with/without cover art). I don't notice any mentionable memory impact, if at all.Along the way I accumulated all deck Singletons in one common template (visual row, cover art, overview).
separate Spinny instances.
After almost a day of testing endless variations of how to instatiate, nest and recall Spinny singletons I ended up with this solution.
I could switch through all skins multiple times with 2 decks playing, Spinnies and CoverArt enabled without crashing.
I can also cycle through all overview renderer types (which reloads the skin instantly).
(though it did crash once when shutting down in --dev mode! idk why)
Please test!