Summary: | Plasmashell crashes whenever I close VLC | ||
---|---|---|---|
Product: | [Plasma] plasmashell | Reporter: | Adam Fontenot <adam.m.fontenot+kde> |
Component: | general | Assignee: | David Edmundson <kde> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | bhush94, kde, mvourlakos, notmart, plasma-bugs, rdieter |
Priority: | NOR | Keywords: | drkonqi |
Version: | 5.9.3 | ||
Target Milestone: | 1.0 | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/plasma-framework/1387b5efe31e330777c8ffd9029f79063cc7a7a9 | Version Fixed In: |
Description
Adam Fontenot
2017-03-01 08:31:47 UTC
Loks like it crashes here, no idea why _plasma_graphicObject is already gone here, though. Could be Media Controller applet (which is unloaded when MPRIS goes away). Can't reproduce, though. void ContainmentInterface::appletRemovedForward(Plasma::Applet *applet) { AppletInterface *appletGraphicObject = applet->property("_plasma_graphicObject").value<AppletInterface *>(); m_appletInterfaces.removeAll(appletGraphicObject); appletGraphicObject->m_positionBeforeRemoval = appletGraphicObject->mapToItem(this, QPointF()); <<<<<<<<<<< emit appletRemoved(appletGraphicObject); emit appletsChanged(); } bt is not 100% complete, but the crash is likely in ContainmentInterface::appletRemovedForward (In reply to Kai Uwe Broulik from comment #1) > Loks like it crashes here, no idea why _plasma_graphicObject is already gone > here, though. Could be Media Controller applet (which is unloaded when MPRIS > goes away). Can't reproduce, though. yeah, at that point applet* and its _graphicsobject are supposed to be guaranteed to still exist :/ This occurs also with Latte Dock, more information with the backtrace can be found here: https://github.com/psifidotos/Latte-Dock/issues/234 What I can not understand is why removing vlc window calls an applet removal! The user reported this uses a master version vlc that is of the version 3 branch... In my system that I use vlc 2.2 I can not reproduce this behavior... the user confirms: "as soon as I disable the media player in the systray plasmashell crash !!!!", meaning without closing vlc "Once the media player in systray is disabled... VLC works fine and can be shut down without crashing the system... Thus, the problem seems to be confined to the media player applet..." from my understanding removing the media player from systray creates the crash in some systems... user also added that tried the following players: DragonPlayer Amarok MPV MPlayer and the crash does not occur... For the record I am using VLC 2.2.4. Happy to help debug if there's anything I can do. >What I can not understand is why removing vlc window calls an applet removal!
There's a "now playing" applet, it get added/removed whenever something implementing mpris comes along.
> There's a "now playing" applet, it get added/removed whenever something
> implementing mpris comes along.
Thanks for the reply, David!
The user of Latte confirmed that this occured because of the "now playing" applet in the systray. By disabling it plasma does not crash any more...
Just to add my thought in it...
Isnt there a chance because of vlc faulty behavior the "now playing" applet to be added while it is removed?
So the crash of the applet removal is of the second removal not the first one occuring..
Update: I still get a crash with the latest packages. Application: plasmashell (5.9.4) Qt Version: 5.8.0 Frameworks Version: 5.32.0 Operating System: Linux 4.10.8-1-ARCH x86_64 Distribution: "Arch Linux" Found it! Interestingly nothing to do with media controller. If system tray adds an Applet which is incredibly broken (such as missing metadta) it will still get created. For some reason that I don't know yet Containmnet::createApplet isn't returning null ContainmentInterface guards against an invalid graphic object when an applet is added forward. However, nothing really bad happens. So .. we then add a media player, and then later delete it: We then get into this code in the system tray: void SystemTray::cleanupTask(const QString &task) { foreach (Plasma::Applet *applet, applets()) { if (!applet->pluginMetaData().isValid() || task == applet->pluginMetaData().pluginId()) { applet->deleteLater(); So when we try and clean up VLC we end up also cleaning our broken applet. (whatever that is) This then gets removed. ContainmentInterface doesn't guard against the graphics object on applet removal, and we get our cras. So 3 bits of code, and they're all bad. Containment::createApplet : should be failing properly ContainmentInterface::appletAdded / appletRemoved: should be consistent with guards. I don't think there should be any. It's a bad habbit to just blindly guard pointers that should be there. It would have made diagnosing this a million times faster. SystemTray::cleanupTask : why is it checking applet metadata now??? Git commit 1387b5efe31e330777c8ffd9029f79063cc7a7a9 by David Edmundson. Committed on 13/04/2017 at 09:49. Pushed by davidedmundson into branch 'master'. Guard against Applet not loading AppletInterface Summary: This can happen if an applet has invalid metadata, it doesn't have a script engine set (X-Plasma-API) so it won't load the DeclarativeAppletScripts Having invalid metadata could come from the applet, or from the fallback applet created in Containment::Private::createApplet. We guard against it in appletAdded but not in appletRemoved, which is inconsistent. We also apparently must have guards elsewhere otherwise we'd see the crash more. Test Plan: Had corrupt applet, used to crash, now doesn't Reviewers: #plasma Subscribers: plasma-devel, #frameworks Tags: #plasma, #frameworks Differential Revision: https://phabricator.kde.org/D5423 M +6 -3 src/scriptengines/qml/plasmoid/containmentinterface.cpp https://commits.kde.org/plasma-framework/1387b5efe31e330777c8ffd9029f79063cc7a7a9 Git commit 4421cc3041b9d172378ba5774241f7079f802073 by David Edmundson. Committed on 20/04/2017 at 10:56. Pushed by davidedmundson into branch 'Plasma/5.9'. Don't remove other applets in SystemTray::cleanupTask Summary: We can get into a state where we have applets with broken metadata. (which is a different bug) Someone clearly wrote this code to try and guard against accessing an invalid metadata when checking names, but instead made it so that when we try to remove a specific task in the system tray we accidentally also remove up any of these applets as well, which doesn't make much sense. Reviewers: #plasma, mart Reviewed By: mart Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D5422 M +1 -1 applets/systemtray/systemtray.cpp https://commits.kde.org/plasma-workspace/4421cc3041b9d172378ba5774241f7079f802073 |