Bug 467909 - Connecting external monitor and attempting to extend desktop caused plasma to crash in PlasmaQuick::ContainmentView::setContainment()
Summary: Connecting external monitor and attempting to extend desktop caused plasma to...
Status: RESOLVED UPSTREAM
Alias: None
Product: plasmashell
Classification: Plasma
Component: generic-multiscreen (show other bugs)
Version: 5.27.3
Platform: Neon Linux
: NOR crash
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2023-03-29 01:30 UTC by Michael Magyar
Modified: 2023-04-22 01:08 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: Qt 6.5.0


Attachments
New crash information added by DrKonqi (135.90 KB, text/plain)
2023-03-29 01:30 UTC, Michael Magyar
Details
crash information from issue reproduction (125.08 KB, text/vnd.kde.kcrash-report)
2023-04-04 02:48 UTC, Michael Magyar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Magyar 2023-03-29 01:30:37 UTC
Application: plasmashell (5.27.3)

Qt Version: 5.15.8
Frameworks Version: 5.104.0
Operating System: Linux 5.19.0-35-generic x86_64
Windowing System: X11
Distribution: KDE neon 5.27
DrKonqi: 5.27.3 [CoredumpBackend]

-- Information about the crash:
Initially only the internal display of my laptop was available. After connecting my external displays using a USB-C displayport connection I used the fn+F7 hot key to try to extend my desktop. After clicking 'extend to the right' plasma crashed.

The crash can be reproduced sometimes.

-- Backtrace (Reduced):
#6  0x00007f6dde65b0dd in QQuickItemPrivate::addToDirtyList() (this=this@entry=0x557add99cf70) at items/qquickitem.cpp:6258
#7  0x00007f6dde65fc9e in QQuickItemPrivate::dirty(QQuickItemPrivate::DirtyType) (this=this@entry=0x557add99cf70, type=type@entry=QQuickItemPrivate::Visible) at items/qquickitem.cpp:6242
#8  0x00007f6dde66185a in QQuickItemPrivate::setEffectiveVisibleRecur(bool) (this=0x557add99cf70, newEffectiveVisible=<optimized out>) at items/qquickitem.cpp:6105
#9  0x00007f6dde6618cb in QQuickItemPrivate::setEffectiveVisibleRecur(bool) (this=0x557add99cbb0, newEffectiveVisible=<optimized out>) at items/qquickitem.cpp:6115
#10 0x00007f6dde6618cb in QQuickItemPrivate::setEffectiveVisibleRecur(bool) (this=0x557addcf4190, newEffectiveVisible=<optimized out>) at items/qquickitem.cpp:6115


The reporter indicates this bug may be a duplicate of or related to bug 466629.

Reported using DrKonqi
Comment 1 Michael Magyar 2023-03-29 01:30:38 UTC
Created attachment 157677 [details]
New crash information added by DrKonqi

DrKonqi auto-attaching complete backtrace.
Comment 2 Nate Graham 2023-04-03 22:24:13 UTC
Is this 100% reproducible every time you do it? Or did it only happen once and you can't make it happen again?
Comment 3 Michael Magyar 2023-04-04 02:44:06 UTC
(In reply to Nate Graham from comment #2)
> Is this 100% reproducible every time you do it? Or did it only happen once
> and you can't make it happen again?

It is not reproducible every time. The pattern to reproduce seems to be that this issue can be reproduced when I explicitly set my machine to only use the internal display when undocked, and then attempt to extend my display after docking. Just connecting my USB-C dock this evening I was able to reproduce the issue.
Comment 4 Michael Magyar 2023-04-04 02:48:14 UTC
Created attachment 157838 [details]
crash information from issue reproduction

KDE Crash Handler Automatic Crash Information
Comment 5 Nate Graham 2023-04-04 16:49:20 UTC
The infamous USB-C dock strikes again. :( Can't reproduce with my own USB-C dock with an HDMI screen plugged into it. Of course, every USB-C dock is broken in an excitingly different way.
Comment 6 Fushan Wen 2023-04-04 17:43:31 UTC
If the bug is reproducible, can you test https://invent.kde.org/qt/qt/qtdeclarative/-/merge_requests/40 if you can patch Qt provided by your distro?
Comment 7 Albert Astals Cid 2023-04-17 21:50:09 UTC
Git commit 45c22a0221937682f4496801a495458a00f76d3a by Albert Astals Cid, on behalf of Volker Hilsheimer.
Committed on 17/04/2023 at 21:40.
Pushed by aacid into branch 'kde/5.15'.

QQuickItem: Fix effective visibility for items without parent

Items are visible if they are children of a visible parent, and not
explicitly hidden. The effectiveVisible member stores the state and is
updated when conditions that impact the item visibility changes.

The old code returned true for items outside a visual hierarchy, which
broke signal emission when items were removed from a parent, e.g.
because the parent got destroyed. With this change, items removed from
a visual hierarchy will emit the visibleChanged signal.

Note: QQuickItem initializes the effectiveVisible member to true, even
if the item was created without parent item. Visual items are required
to be added to a visual hierarchy via setParentItem. For this reason,
newly created items never emit visibleChanged when they are added to
a parent.

Adjust the QQuickItem::visible test - it creates an item hierarchy
without window. Such items are never visible, so add a window and
parent the test item hierarchy to the window's content item.

This fixes the expected failures in the tests. It does introduce an
incompatibility with QGraphicsView and QGraphicsItem, which continue
to return true from QGraphicsItem::isVisible for items that are not
in an item hierarchy.

[ChangeLog][Qt Quick][QQuickItem] The visible property of Items without
a parent now always returns false, and the visibleChanged signal gets
emitted when the parent item of a visible item becomes null.

Fixes: QTBUG-108213
Change-Id: If4b2947cefd1407853f0f29e6c3fdbd49fc9af65
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit d1b9a4cacfb966cf0a37983d8f8044f3aedf5de3)
Related: bug 396359

M  +2    -4    src/quick/items/qquickitem.cpp
M  +2    -0    tests/auto/quick/qquickitem/tst_qquickitem.cpp

https://invent.kde.org/qt/qt/qtdeclarative/commit/45c22a0221937682f4496801a495458a00f76d3a
Comment 8 Fushan Wen 2023-04-22 01:08:39 UTC
Mark as resolved for now