Bug 366146 - Plasma crashes when trying to add second panel
Summary: Plasma crashes when trying to add second panel
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Panel (show other bugs)
Version: master
Platform: ROSA RPMs Linux
: NOR crash
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-26 23:20 UTC by Pulfer
Modified: 2016-09-27 18:18 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pulfer 2016-07-26 23:20:38 UTC
Plasma crashes when trying to add second panel.

1. Download the ISO from here: https://abf.rosalinux.ru/platforms/rosa2014.1/products/137/product_build_lists/15748
2. Install it (or boot in live mode)
3. Try to add second panel

Plasma will crash, then restart with second panel added and crash BT info provided. 

Reproducible: Always
Comment 1 Pulfer 2016-07-27 10:42:36 UTC
BT seems to loop forever until it eats all system memory. Maybe it's a Qt 5.6.1 bug and Plasma only triggers it.

-----------------------------------------------------------
#0  0xb7745be0 in __kernel_vsyscall ()
#1  0xb4dd4296 in nanosleep () from /lib/i686/libc.so.6
#2  0xb4dd404e in sleep () from /lib/i686/libc.so.6
#3  0xb772123e in ?? () from /usr/lib/libKF5Crash.so.5
#4  0xb77216ce in KCrash::defaultCrashHandler(int) () from /usr/lib/libKF5Crash.so.5
#5  <signal handler called>
#6  0xa6107152 in QVector<QQuickItem*>::reallocData (this=0xa4656c8, asize=84213, aalloc=131068, options=...) at /usr/include/qt5/QtCore/qvector.h:540
#7  0xa61072ba in QVector<QQuickItem*>::append (this=0xa4656c8, t=@0xbf575014: 0xa4657c8) at /usr/include/qt5/QtCore/qvector.h:633
#8  0xa6101897 in operator<< (t=<optimized out>, this=<optimized out>) at /usr/include/qt5/QtCore/qvector.h:273
#9  QQuickGridLayoutBase::invalidate (this=0xa4654b0, childItem=0xa4657c8) at qquicklinearlayout.cpp:392
#10 0xa60fecc7 in QQuickLayout::invalidateSenderItem (this=0xa4654b0) at qquicklayout.cpp:794
#11 0xa6109734 in QQuickLayout::qt_static_metacall (_o=0xa4654b0, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0xbf575098) at .moc/moc_qquicklayout_p.cpp:69
#12 0xb520c4c8 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/libQt5Core.so.5
#13 0xb520ce9d in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQt5Core.so.5
#14 0xb6d082e2 in QQuickItem::implicitWidthChanged() () from /usr/lib/libQt5Quick.so.5
#15 0xb6d084a9 in QQuickItemPrivate::implicitWidthChanged() () from /usr/lib/libQt5Quick.so.5
#16 0xb6d0d052 in QQuickItem::setImplicitSize(double, double) () from /usr/lib/libQt5Quick.so.5
#17 0xa6101841 in QQuickGridLayoutBase::invalidate (this=0xa4657c8, childItem=0x0) at qquicklinearlayout.cpp:426
#18 0xa6100afe in QQuickGridLayoutBase::updateLayoutItems (this=0xa4657c8) at qquicklinearlayout.cpp:444
#19 0xa610186d in QQuickGridLayoutBase::invalidate (this=0xa4657c8, childItem=0xa465ae0) at qquicklinearlayout.cpp:402
#20 0xa610144a in QQuickGridLayoutBase::rearrange (this=0xa4657c8, size=...) at qquicklinearlayout.cpp:532
#21 0xa60ff9eb in QQuickLayout::geometryChanged (this=0xa4657c8, newGeometry=..., oldGeometry=...) at qquicklayout.cpp:785
#22 0xb6d0d224 in QQuickItem::setSize(QSizeF const&) () from /usr/lib/libQt5Quick.so.5
#23 0xa6101d22 in QQuickGridLayoutItem::setGeometry (this=0xa482420, rect=...) at qquickgridlayoutengine_p.h:117
#24 0xb577db5f in QGridLayoutEngine::setGeometries(QRectF const&, QAbstractLayoutStyleInfo const*) () from /usr/lib/libQt5Gui.so.5
#25 0xa61013e8 in QQuickGridLayoutBase::rearrange (this=0xa4654b0, size=...) at qquicklinearlayout.cpp:528
#26 0xa60ff9eb in QQuickLayout::geometryChanged (this=0xa4654b0, newGeometry=..., oldGeometry=...) at qquicklayout.cpp:785
#27 0xb6d0cf04 in QQuickItem::setImplicitSize(double, double) () from /usr/lib/libQt5Quick.so.5
#28 0xa6101841 in QQuickGridLayoutBase::invalidate (this=0xa4654b0, childItem=0xa4657c8) at qquicklinearlayout.cpp:426
#29 0xa610144a in QQuickGridLayoutBase::rearrange (this=0xa4654b0, size=...) at qquicklinearlayout.cpp:532
#30 0xa60ff9eb in QQuickLayout::geometryChanged (this=0xa4654b0, newGeometry=..., oldGeometry=...) at qquicklayout.cpp:785
#31 0xb6d0cf04 in QQuickItem::setImplicitSize(double, double) () from /usr/lib/libQt5Quick.so.5
#32 0xa6101841 in QQuickGridLayoutBase::invalidate (this=0xa4654b0, childItem=0xa4657c8) at qquicklinearlayout.cpp:426
#33 0xa610144a in QQuickGridLayoutBase::rearrange (this=0xa4654b0, size=...) at qquicklinearlayout.cpp:532
#34 0xa60ff9eb in QQuickLayout::geometryChanged (this=0xa4654b0, newGeometry=..., oldGeometry=...) at qquicklayout.cpp:785
#35 0xb6d0cf04 in QQuickItem::setImplicitSize(double, double) () from /usr/lib/libQt5Quick.so.5
#36 0xa6101841 in QQuickGridLayoutBase::invalidate (this=0xa4654b0, childItem=0xa4657c8) at qquicklinearlayout.cpp:426
#37 0xa610144a in QQuickGridLayoutBase::rearrange (this=0xa4654b0, size=...) at qquicklinearlayout.cpp:532
#38 0xa60ff9eb in QQuickLayout::geometryChanged (this=0xa4654b0, newGeometry=..., oldGeometry=...) at qquicklayout.cpp:785
#39 0xb6d0cf04 in QQuickItem::setImplicitSize(double, double) () from /usr/lib/libQt5Quick.so.5
#40 0xa6101841 in QQuickGridLayoutBase::invalidate (this=0xa4654b0, childItem=0xa4657c8) at qquicklinearlayout.cpp:426
#41 0xa610144a in QQuickGridLayoutBase::rearrange (this=0xa4654b0, size=...) at qquicklinearlayout.cpp:532
#42 0xa60ff9eb in QQuickLayout::geometryChanged (this=0xa4654b0, newGeometry=..., oldGeometry=...) at qquicklayout.cpp:785
#43 0xb6d0cf04 in QQuickItem::setImplicitSize(double, double) () from /usr/lib/libQt5Quick.so.5
#44 0xa6101841 in QQuickGridLayoutBase::invalidate (this=0xa4654b0, childItem=0xa4657c8) at qquicklinearlayout.cpp:426
#45 0xa610144a in QQuickGridLayoutBase::rearrange (this=0xa4654b0, size=...) at qquicklinearlayout.cpp:532
#46 0xa60ff9eb in QQuickLayout::geometryChanged (this=0xa4654b0, newGeometry=..., oldGeometry=...) at qquicklayout.cpp:785
#47 0xb6d0cf04 in QQuickItem::setImplicitSize(double, double) () from /usr/lib/libQt5Quick.so.5
#48 0xa6101841 in QQuickGridLayoutBase::invalidate (this=0xa4654b0, childItem=0xa4657c8) at qquicklinearlayout.cpp:426
#49 0xa610144a in QQuickGridLayoutBase::rearrange (this=0xa4654b0, size=...) at qquicklinearlayout.cpp:532
-----------------------------------------------------------
etc
Comment 2 Pulfer 2016-07-27 11:04:00 UTC
This BT should be more helpful (I installed more debuginfo packages):

-----------------------------------------------------------
#0  0xb77a5be0 in __kernel_vsyscall ()
#1  0xb4e34296 in nanosleep () from /lib/i686/libc.so.6
#2  0xb4e3404e in sleep () from /lib/i686/libc.so.6
#3  0xb778123e in ?? () from /usr/lib/libKF5Crash.so.5
#4  0xb77816ce in KCrash::defaultCrashHandler(int) () from /usr/lib/libKF5Crash.so.5
#5  <signal handler called>
#6  0xa6162152 in QVector<QQuickItem*>::reallocData (this=0xb5d85d8, asize=84021, aalloc=131068, options=...) at /usr/include/qt5/QtCore/qvector.h:540
#7  0xa61622ba in QVector<QQuickItem*>::append (this=0xb5d85d8, t=@0xbf386354: 0xb5d86c0) at /usr/include/qt5/QtCore/qvector.h:633
#8  0xa615c897 in operator<< (t=<optimized out>, this=<optimized out>) at /usr/include/qt5/QtCore/qvector.h:273
#9  QQuickGridLayoutBase::invalidate (this=0xb5d83c0, childItem=0xb5d86c0) at qquicklinearlayout.cpp:392
#10 0xa6159cc7 in QQuickLayout::invalidateSenderItem (this=0xb5d83c0) at qquicklayout.cpp:794
#11 0xa6164734 in QQuickLayout::qt_static_metacall (_o=0xb5d83c0, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0xbf3863d8) at .moc/moc_qquicklayout_p.cpp:69
#12 0xb526c4c8 in QMetaObject::activate (sender=0xb5d86c0, signalOffset=3, local_signal_index=24, argv=0x0) at kernel/qobject.cpp:3730
#13 0xb526ce9d in QMetaObject::activate (sender=0xb5d86c0, m=0xb705559c <QQuickItem::staticMetaObject>, local_signal_index=24, argv=0x0)
    at kernel/qobject.cpp:3595
#14 0xb6d682e2 in QQuickItem::implicitWidthChanged (this=0xb5d86c0) at .moc/moc_qquickitem.cpp:1148
#15 0xb6d684a9 in QQuickItemPrivate::implicitWidthChanged (this=0xb5d86e0) at items/qquickitem.cpp:6312
#16 0xb6d6d052 in QQuickItem::setImplicitSize (this=0xb5d86c0, w=237, h=42) at items/qquickitem.cpp:6531
#17 0xa615c841 in QQuickGridLayoutBase::invalidate (this=0xb5d86c0, childItem=0x0) at qquicklinearlayout.cpp:426
#18 0xa615bafe in QQuickGridLayoutBase::updateLayoutItems (this=0xb5d86c0) at qquicklinearlayout.cpp:444
#19 0xa615c86d in QQuickGridLayoutBase::invalidate (this=0xb5d86c0, childItem=0xb5d8970) at qquicklinearlayout.cpp:402
#20 0xa615c44a in QQuickGridLayoutBase::rearrange (this=0xb5d86c0, size=...) at qquicklinearlayout.cpp:532
#21 0xa615a9eb in QQuickLayout::geometryChanged (this=0xb5d86c0, newGeometry=..., oldGeometry=...) at qquicklayout.cpp:785
#22 0xb6d6d224 in QQuickItem::setSize (this=0xb5d86c0, size=...) at items/qquickitem.cpp:6591
#23 0xa615cd22 in QQuickGridLayoutItem::setGeometry (this=0xb5ee278, rect=...) at qquickgridlayoutengine_p.h:117
#24 0xb57ddb5f in QGridLayoutEngine::setGeometries (this=0xb5d84b4, contentsGeometry=..., styleInfo=0xb5d7ac0) at util/qgridlayoutengine.cpp:1034
#25 0xa615c3e8 in QQuickGridLayoutBase::rearrange (this=0xb5d83c0, size=...) at qquicklinearlayout.cpp:528
#26 0xa615a9eb in QQuickLayout::geometryChanged (this=0xb5d83c0, newGeometry=..., oldGeometry=...) at qquicklayout.cpp:785
#27 0xb6d6cf04 in QQuickItem::setImplicitSize (this=0xb5d83c0, w=234, h=35) at items/qquickitem.cpp:6554
#28 0xa615c841 in QQuickGridLayoutBase::invalidate (this=0xb5d83c0, childItem=0xb5d86c0) at qquicklinearlayout.cpp:426
#29 0xa615c44a in QQuickGridLayoutBase::rearrange (this=0xb5d83c0, size=...) at qquicklinearlayout.cpp:532
#30 0xa615a9eb in QQuickLayout::geometryChanged (this=0xb5d83c0, newGeometry=..., oldGeometry=...) at qquicklayout.cpp:785
#31 0xb6d6cf04 in QQuickItem::setImplicitSize (this=0xb5d83c0, w=237, h=42) at items/qquickitem.cpp:6554
#32 0xa615c841 in QQuickGridLayoutBase::invalidate (this=0xb5d83c0, childItem=0xb5d86c0) at qquicklinearlayout.cpp:426
#33 0xa615c44a in QQuickGridLayoutBase::rearrange (this=0xb5d83c0, size=...) at qquicklinearlayout.cpp:532
#34 0xa615a9eb in QQuickLayout::geometryChanged (this=0xb5d83c0, newGeometry=..., oldGeometry=...) at qquicklayout.cpp:785
#35 0xb6d6cf04 in QQuickItem::setImplicitSize (this=0xb5d83c0, w=234, h=35) at items/qquickitem.cpp:6554
#36 0xa615c841 in QQuickGridLayoutBase::invalidate (this=0xb5d83c0, childItem=0xb5d86c0) at qquicklinearlayout.cpp:426
#37 0xa615c44a in QQuickGridLayoutBase::rearrange (this=0xb5d83c0, size=...) at qquicklinearlayout.cpp:532
#38 0xa615a9eb in QQuickLayout::geometryChanged (this=0xb5d83c0, newGeometry=..., oldGeometry=...) at qquicklayout.cpp:785
#39 0xb6d6cf04 in QQuickItem::setImplicitSize (this=0xb5d83c0, w=237, h=42) at items/qquickitem.cpp:6554
#40 0xa615c841 in QQuickGridLayoutBase::invalidate (this=0xb5d83c0, childItem=0xb5d86c0) at qquicklinearlayout.cpp:426
#41 0xa615c44a in QQuickGridLayoutBase::rearrange (this=0xb5d83c0, size=...) at qquicklinearlayout.cpp:532
#42 0xa615a9eb in QQuickLayout::geometryChanged (this=0xb5d83c0, newGeometry=..., oldGeometry=...) at qquicklayout.cpp:785
#43 0xb6d6cf04 in QQuickItem::setImplicitSize (this=0xb5d83c0, w=234, h=35) at items/qquickitem.cpp:6554
#44 0xa615c841 in QQuickGridLayoutBase::invalidate (this=0xb5d83c0, childItem=0xb5d86c0) at qquicklinearlayout.cpp:426
#45 0xa615c44a in QQuickGridLayoutBase::rearrange (this=0xb5d83c0, size=...) at qquicklinearlayout.cpp:532
#46 0xa615a9eb in QQuickLayout::geometryChanged (this=0xb5d83c0, newGeometry=..., oldGeometry=...) at qquicklayout.cpp:785
#47 0xb6d6cf04 in QQuickItem::setImplicitSize (this=0xb5d83c0, w=237, h=42) at items/qquickitem.cpp:6554
#48 0xa615c841 in QQuickGridLayoutBase::invalidate (this=0xb5d83c0, childItem=0xb5d86c0) at qquicklinearlayout.cpp:426
-----------------------------------------------------------
Comment 3 David Edmundson 2016-08-02 21:31:33 UTC
This is caused by some plasmoid having some looping code. 

Do you have any custom plasmoids in the default Rosa panel?
Comment 4 Pulfer 2016-08-04 03:55:22 UTC
(In reply to David Edmundson from comment #3)
> Do you have any custom plasmoids in the default Rosa panel?

There's only one custom plasmoid there: https://git.reviewboard.kde.org/r/127651/

Here's our layout.js: https://abf.rosalinux.ru/import/plasma5-config-fresh/blob/rosa2014.1/default-panel-layout.js

> This is caused by some plasmoid having some looping code. 

Looks like it's caused by system tray plasmoid. Without it adding second panel works fine.
Comment 5 Tony 2016-08-10 11:40:51 UTC
I have the same issue. When i try to add a new "default panel" the desktop will crash, no restart no errors pop up, i have to logout and log in again. Afterwards the desktop have been reset to its default settings and the new "default panel" is present.  I tried to remove "System Tray" and repeat, same crash.
If you select "Empty System Tray" the desktop will crash as well.

This happens on KDE Neon Dev Edition Unstable.
Comment 6 Tony 2016-09-27 17:26:42 UTC
This one is fixed on Neon, for X and Wayland session. I can fill all corners of the dekstop with "empty" and "default" panels with no crashes.

Plasma 5.8.90
Frameworks 5.27
Qt 5.7
Comment 7 David Edmundson 2016-09-27 17:44:15 UTC
thanks for reporting back.
Comment 8 muzuiget 2016-09-27 18:18:08 UTC
Oh, I am using dual monitors, this bug annoy me almost a year, finally I found out what cause this problem, and know which keyword to search then go into this issue.

The reason is "You can't add second system tray after plamsashell started".

After you click "Add Panel -> Default Panel" to add second panel, plamsashell will eat all your memory in a few seconds, then your desktop nearly freezing.

Test on Fedora 24, with package "plasma-desktop.x86_64", version 5.7.5-1.fc24.

After so many times to run "sleep 15 && killall -s KILL plasmashell" then testing. I found out the reason which I said above;

When you click the menuitem, plasmashell will execute the file /usr/share/plasma/layout-templates/org.kde.plasma.desktop.defaultPanel/contents/layout.js, after comment out the line

    panel.addWidget('org.kde.plasma.systemtray');

The new panel added normally without the system tray;

Then I do more digging, and found out a file /usr/share/plasma/plasmoids/org.kde.plasma.systemtray/contents/ui/main.qml 

    Item {
        id: root

        Layout.minimumWidth: internalSystray.Layout.minimumWidth
        Layout.minimumHeight: internalSystray.Layout.minimumHeight

        Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation
        property Item internalSystray

        Component.onCompleted: {
            root.internalSystray = plasmoid.nativeInterface.internalSystray;

            if (root.internalSystray == null) {
                return;
            }
            root.internalSystray.parent = root;
            root.internalSystray.anchors.fill = root;
        }

        Connections {
            target: plasmoid.nativeInterface
            onInternalSystrayChanged: {
                root.internalSystray = plasmoid.nativeInterface.internalSystray;
                root.internalSystray.parent = root;
                root.internalSystray.anchors.fill = root;
            }
        }
    }

I am not know qml programming, but I guess "org.kde.plasma.private.systemtray" is really system tray widget and it's a singltion, and "org.kde.plasma.systemtray" just a "proxy/container type" widget, the latter share the same former instance.  When add second system tray, that will be two "org.kde.plasma.private.systemtray" instance. It look like there are a recursive call between `onCompleted` and `onInternalSystrayChanged`. After delete the two methods body, The new panel added normally without the system tray too.

As I said I don't kown qml, So, I don't konw how to fix it. 

Luckily I konw JavaScript, after reading

https://userbase.kde.org/KDE_System_Administration/PlasmaDesktopScripting#Update_scripts

Here is my workaround, to edit the layout.js, avoid to add system tray in new panel.

replace the line

    panel.addWidget('org.kde.plasma.systemtray');

to 

    (function() {
        for (var i = 0; i < panelIds.length; i++) {
            var tmpPanel = panelById(panelIds[i]);
            if (tmpPanel.id === panel.id) {
                continue;
            }
            var trays = tmpPanel.widgets('org.kde.plasma.systemtray');
            if (trays.length > 0) {
                return;
            }
        }
        panel.addWidget('org.kde.plasma.systemtray');
    })();