Bug 455328 - X11 Plasma crashes in QScreen::geometry() after dual DisplayPort monitors on nvidia wake up from sleep
Summary: X11 Plasma crashes in QScreen::geometry() after dual DisplayPort monitors on ...
Status: RESOLVED DUPLICATE of bug 451147
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: 5.25.0
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: drkonqi, multiscreen, regression
Depends on:
Blocks:
 
Reported: 2022-06-15 13:42 UTC by Alexey Chernyak
Modified: 2022-08-15 18:33 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.25.3
Sentry Crash Report:


Attachments
New crash information added by DrKonqi (2.05 KB, text/plain)
2022-06-18 07:17 UTC, Nicolas Bello
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Chernyak 2022-06-15 13:42:31 UTC
Application: plasmashell (5.25.0)
 (Compiled from sources)
Qt Version: 5.15.4
Frameworks Version: 5.95.0
Operating System: Linux 5.18.4-gentoo x86_64
Windowing System: X11
Distribution: "Gentoo Base System release 2.8"
DrKonqi: 5.25.0 [KCrashBackend]

-- Information about the crash:
SUMMARY
My Plasma has been crashing every time I wake up my dual DisplayPort monitors on nVIDIA from sleep for the past few releases.
I suspect it started happening when I upgraded to Qt v5.15.3 a few months ago and continues happening with Qt v5.15.4.
Blowing away ~/.config and creating new profile did not fix it.

STEPS TO REPRODUCE
1. Login to X11 session using dual monitors connected to nVIDIA video card via DisplayPort cables.
2. Leave it idle until monitors go to sleep (desktop should be configured not to go to sleep).
3. Wake monitors up and get back into the session (with or withour screen lock, it doesn't matter).

OBSERVED RESULT
Plasma crashes every time, with taskbar, desktop icons and wallpapers all gone.

EXPECTED RESULT
No crash.

SOFTWARE/OS VERSIONS
X.org Version: 21.1.3
nVIDIA Drivers Version: 515.48.07

The crash can be reproduced every time.

-- Backtrace:
Application: Plasma (plasmashell), signal: Segmentation fault

[KCrash Handler]
#4  0x00007fea5ef46160 in QScreen::geometry() const () at /usr/lib64/libQt5Gui.so.5
#5  0x00005652efca82bf in  ()
#6  0x00005652efcab5a2 in  ()
#7  0x00007fea5ef2bb75 in QWindow::event(QEvent*) () at /usr/lib64/libQt5Gui.so.5
#8  0x00007fea5f7a56df in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#9  0x00007fea5eb21398 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib64/libQt5Core.so.5
#10 0x00007fea5ef1d6a9 in QGuiApplicationPrivate::processGeometryChangeEvent(QWindowSystemInterfacePrivate::GeometryChangeEvent*) () at /usr/lib64/libQt5Gui.so.5
#11 0x00007fea5ef0003c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Gui.so.5
#12 0x00007fea5a06a42a in  () at /usr/lib64/libQt5XcbQpa.so.5
#13 0x00007fea5d097c0c in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0
#14 0x00007fea5d097eb8 in  () at /usr/lib64/libglib-2.0.so.0
#15 0x00007fea5d097f6f in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0
#16 0x00007fea5eb71898 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#17 0x00007fea5eb1fe2b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#18 0x00007fea5eb28160 in QCoreApplication::exec() () at /usr/lib64/libQt5Core.so.5
#19 0x00005652efc93758 in  ()
#20 0x00007fea5e4d020a in  () at /lib64/libc.so.6
#21 0x00007fea5e4d02bc in __libc_start_main () at /lib64/libc.so.6
#22 0x00005652efc93971 in  ()
[Inferior 1 (process 4567) detached]

Reported using DrKonqi
Comment 1 Nicolas Bello 2022-06-18 07:17:50 UTC
Created attachment 149878 [details]
New crash information added by DrKonqi

plasmashell (5.25.0) using Qt 5.15.4

Returned to session after suspended.

-- Backtrace (Reduced):
#4  0x00007f88daf4ceb0 in QScreen::geometry() const () at /usr/lib64/libQt5Gui.so.5
[...]
#7  0x00007f88daf321a5 in QWindow::event(QEvent*) () at /usr/lib64/libQt5Gui.so.5
#8  0x00007f88db76396f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#9  0x00007f88daa824d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib64/libQt5Core.so.5
#10 0x00007f88daf23b21 in QGuiApplicationPrivate::processGeometryChangeEvent(QWindowSystemInterfacePrivate::GeometryChangeEvent*) () at /usr/lib64/libQt5Gui.so.5
Comment 2 Alexey Chernyak 2022-06-26 10:05:03 UTC
Still happens after upgrade to:
Qt: v5.15.5
Plasma: v5.25.1


Application: Plasma (plasmashell), signal: Segmentation fault

[KCrash Handler]
#4  0x00007f123bd01150 in QScreen::geometry() const () at /usr/lib64/libQt5Gui.so.5
#5  0x0000557dad6162bf in  ()
#6  0x0000557dad6195a2 in  ()
#7  0x00007f123bce6b65 in QWindow::event(QEvent*) () at /usr/lib64/libQt5Gui.so.5
#8  0x00007f123c56071f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#9  0x00007f123b8d93d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib64/libQt5Core.so.5
#10 0x00007f123bcd8699 in QGuiApplicationPrivate::processGeometryChangeEvent(QWindowSystemInterfacePrivate::GeometryChangeEvent*) () at /usr/lib64/libQt5Gui.so.5
#11 0x00007f123bcbb02c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Gui.so.5
#12 0x00007f1236e2756a in  () at /usr/lib64/libQt5XcbQpa.so.5
#13 0x00007f1239e4fc0c in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0
#14 0x00007f1239e4feb8 in  () at /usr/lib64/libglib-2.0.so.0
#15 0x00007f1239e4ff6f in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0
#16 0x00007f123b9298d8 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#17 0x00007f123b8d7e6b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#18 0x00007f123b8e01a0 in QCoreApplication::exec() () at /usr/lib64/libQt5Core.so.5
#19 0x0000557dad601758 in  ()
#20 0x00007f123b28820a in  () at /lib64/libc.so.6
#21 0x00007f123b2882bc in __libc_start_main () at /lib64/libc.so.6
#22 0x0000557dad601971 in  ()
[Inferior 1 (process 4381) detached]
Comment 3 Andreas Sturmlechner 2022-06-27 07:58:23 UTC
Your output is missing debug symbols, so it is not very useful.

See also: https://wiki.gentoo.org/wiki/Debugging

If you don't want do enable this system-wide, `equery b /usr/lib64/libQt5Gui.so.5` and all other involved *.so files in your trace and add the package they belong to package.env:

https://wiki.gentoo.org/wiki//etc/portage/package.env
Comment 4 Alexey Chernyak 2022-06-28 02:51:35 UTC
Is this enough, or you need more?

Application: Plasma (plasmashell), signal: Segmentation fault

[KCrash Handler]
#4  QScreen::geometry() const (this=0x0) at /mnt/tmpfs/portage/dev-qt/qtgui-5.15.5/work/qtbase-everywhere-src-5.15.5/src/gui/kernel/qscreen.cpp:413
#5  0x00005598c2fe614f in PanelView::geometryByDistance(int) const (this=this@entry=0x5598c65b9190, distance=0) at /mnt/tmpfs/portage/kde-plasma/plasma-workspace-5.25.1/work/plasma-workspace-5.25.1/shell/panelview.cpp:533
#6  0x00005598c2fe9411 in PanelView::resizeEvent(QResizeEvent*) (this=0x5598c65b9190, ev=0x7ffce5689c70) at /mnt/tmpfs/portage/kde-plasma/plasma-workspace-5.25.1/work/plasma-workspace-5.25.1/shell/panelview.cpp:841
#7  0x00007f32cb896ce5 in QWindow::event(QEvent*) (this=0x5598c65b9190, ev=<optimized out>) at /mnt/tmpfs/portage/dev-qt/qtgui-5.15.5/work/qtbase-everywhere-src-5.15.5/src/gui/kernel/qwindow.cpp:2438
#8  0x00007f32cc107f5e in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x5598c65b9190, e=0x7ffce5689c70) at /mnt/tmpfs/portage/dev-qt/qtwidgets-5.15.5/work/qtbase-everywhere-src-5.15.5/src/widgets/kernel/qapplication.cpp:3637
#9  0x00007f32cb48b138 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x5598c65b9190, event=0x7ffce5689c70) at /mnt/tmpfs/portage/dev-qt/qtcore-5.15.5/work/qtbase-everywhere-src-5.15.5/src/corelib/kernel/qcoreapplication.cpp:1064
#10 0x00007f32cb8886ce in QGuiApplicationPrivate::processGeometryChangeEvent(QWindowSystemInterfacePrivate::GeometryChangeEvent*) (e=<optimized out>) at /mnt/tmpfs/portage/dev-qt/qtgui-5.15.5/work/qtbase-everywhere-src-5.15.5/src/gui/kernel/qguiapplication.cpp:2607
#11 0x00007f32cb86b16c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) (flags=flags@entry=...) at /mnt/tmpfs/portage/dev-qt/qtgui-5.15.5/work/qtbase-everywhere-src-5.15.5/src/gui/kernel/qwindowsysteminterface.cpp:1169
#12 0x00007f32c69c1b1a in xcbSourceDispatch(GSource*, GSourceFunc, gpointer) (source=<optimized out>) at /mnt/tmpfs/portage/dev-qt/qtgui-5.15.5/work/qtbase-everywhere-src-5.15.5/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp:105
#13 0x00007f32c99ebac9 in g_main_dispatch (context=0x7f32c0005010) at ../glib-2.72.2/glib/gmain.c:3417
#14 g_main_context_dispatch (context=0x7f32c0005010) at ../glib-2.72.2/glib/gmain.c:4135
#15 0x00007f32c99ebd58 in g_main_context_iterate (context=context@entry=0x7f32c0005010, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib-2.72.2/glib/gmain.c:4211
#16 0x00007f32c99ebdec in g_main_context_iteration (context=0x7f32c0005010, may_block=1) at ../glib-2.72.2/glib/gmain.c:4276
#17 0x00007f32cb4daf16 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x5598c3c85b10, flags=...) at /mnt/tmpfs/portage/dev-qt/qtcore-5.15.5/work/qtbase-everywhere-src-5.15.5/src/corelib/kernel/qeventdispatcher_glib.cpp:423
#18 0x00007f32cb489c0b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffce5689ef0, flags=..., flags@entry=...) at /mnt/tmpfs/portage/dev-qt/qtcore-5.15.5/work/qtbase-everywhere-src-5.15.5/include/QtCore/../../src/corelib/global/qflags.h:69
#19 0x00007f32cb491a56 in QCoreApplication::exec() () at /mnt/tmpfs/portage/dev-qt/qtcore-5.15.5/work/qtbase-everywhere-src-5.15.5/include/QtCore/../../src/corelib/global/qflags.h:121
#20 0x00007f32cb88060c in QGuiApplication::exec() () at /mnt/tmpfs/portage/dev-qt/qtgui-5.15.5/work/qtbase-everywhere-src-5.15.5/src/gui/kernel/qguiapplication.cpp:1867
#21 0x00007f32cc107ed5 in QApplication::exec() () at /mnt/tmpfs/portage/dev-qt/qtwidgets-5.15.5/work/qtbase-everywhere-src-5.15.5/src/widgets/kernel/qapplication.cpp:2829
#22 0x00005598c2fd1725 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /mnt/tmpfs/portage/kde-plasma/plasma-workspace-5.25.1/work/plasma-workspace-5.25.1/shell/main.cpp:240
[Inferior 1 (process 4376) detached]
Comment 5 Fushan Wen 2022-06-28 09:36:52 UTC
Fixed in 5.24.6 and 5.25.2(released today)
Comment 6 Fushan Wen 2022-06-28 09:38:50 UTC
Sorry, this seems to be another bug.
Comment 7 Bug Janitor Service 2022-06-28 10:16:08 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1876
Comment 8 Fushan Wen 2022-06-28 12:03:12 UTC
Git commit ffadcb34282f1219c312d73ebf9660fdbab8fe2d by Fushan Wen.
Committed on 28/06/2022 at 12:03.
Pushed by fusionfuture into branch 'Plasma/5.25'.

shell: avoid crash after waking up from sleep

In `ShellCorona::handleScreenRemoved(QScreen*)` the panel was removed by a timer, which can cause null QScreen pointer. This fix is explicitly merged for 5.25 and should not be cherry-picked to master branch.
FIXED-IN: 5.25.3

M  +9    -6    shell/panelview.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/ffadcb34282f1219c312d73ebf9660fdbab8fe2d
Comment 9 Fushan Wen 2022-06-28 13:35:56 UTC
Git commit 0742227e820f4a0c10fc0c001ef3443ebaeeae09 by Fushan Wen.
Committed on 28/06/2022 at 12:56.
Pushed by fusionfuture into branch 'master'.

shell: avoid crash after waking up from sleep

The panel was removed by a timer, which can cause null QScreen pointer.
FIXED-IN: 5.25.3

(cherry picked from ffadcb34282f1219c312d73ebf9660fdbab8fe2d)

M  +9    -6    shell/panelview.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/0742227e820f4a0c10fc0c001ef3443ebaeeae09
Comment 10 Alexey Chernyak 2022-06-28 15:09:48 UTC
I have applied the patch, and the issue seems to be somewhat better.
The first time when monitors woke up from sleep - everything looked good - for the first time in months.

Second time, however, the taskbar was missing again. Desktop icons did return but on a different screen from before sleep.
There was no KCrash Handler dialog box, so don't know what it was (sometimes it doesn't appear).

Some thoughts about how it ends up in this state...

My understanding is that when a DisplayPort monitor goes to sleep, it's as if it has been completely disconnected from the system, and when it wakes up - it's as it it was plugged in again.

My two DisplayPort monitors are different models, and they have different wake-up latency.
So one of them usually wakes up a second or two before the other.

On wakeup I usually observe windows on my screen do all kinds of acrobatics:
* A windows that was full screen on one of the monitors, suddenly becomes widely stretched full screen across both monitors, and then returns back to being fullscreen on one monitor.
* Desktop icons end up on the monitor different to the one they were on before sleep.
* Some open application windows also end up on monitor different to the one they were on before sleep.

I would suspect that Plasma goes haywire in the interim state in between one of the monitors being already awake, and the other one not awake yet.

I think the observed results may be slightly different depending on:
* Which monitor was the primary display for X before sleep.
* Which monitor had the KDE taskbar and desktop icons before sleep.
* Which monitor gets put to sleep (i.e. disconnected) first.
* Which of the two monitors wakes up and reconnects  first.
Comment 11 Fushan Wen 2022-06-28 15:58:05 UTC
(In reply to Alexey Chernyak from comment #10)

> Second time, however, the taskbar was missing again. Desktop icons did
> return but on a different screen from before sleep.

https://invent.kde.org/plasma/plasma-workspace/-/commit/41fb821545aac4df273fb45d0e4de9ab49143d9c
https://invent.kde.org/plasma/plasma-workspace/-/commit/68ed1677ac334dafb8a319bda419105c9d88adbb

Did you try the two commits? They are included in 5.25.2.
Comment 12 Alexey Chernyak 2022-06-29 00:53:49 UTC
(In reply to Fushan Wen from comment #11)
> Did you try the two commits? They are included in 5.25.2.

I now have upgraded to 5.25.2.
It looks like this patch has also made it into 5.25.2 - so I didn't have to explicitly apply it.

On first wakeup - taskbar disappeared and desktop icons moved to another monitor..
On second wakeup - taskbar still gone, desktop icons disappeared, and one of monitor wallpapers disappeared, has just black background now.

No KCrash Handler dialogs.

So I guess this particular crash itself may be fixed, but Plasma remains messed up and unusable after monitor sleeps.
Comment 13 Nate Graham 2022-08-04 19:09:56 UTC
*** Bug 457438 has been marked as a duplicate of this bug. ***
Comment 14 Nate Graham 2022-08-15 18:33:12 UTC
Not fixed; we're getting reports from people with Plasma 5.25.4. Also, it looks like the original master bug report for this was Bug 451147; duping there.

*** This bug has been marked as a duplicate of bug 451147 ***