Bug 466095 - Plasma crashes in DesktopView::screenToFollow() on screen wake up when KScreen service is active and high refresh rate monitor is connected and AdaptivSync is enabled
Summary: Plasma crashes in DesktopView::screenToFollow() on screen wake up when KScree...
Status: RESOLVED DUPLICATE of bug 468430
Alias: None
Product: plasmashell
Classification: Plasma
Component: generic-multiscreen (show other bugs)
Version: 5.27.0
Platform: unspecified Linux
: NOR crash
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2023-02-19 17:20 UTC by Krzysztof Cybulski
Modified: 2023-06-07 08:55 UTC (History)
8 users (show)

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


Attachments
New crash information added by DrKonqi (4.55 KB, text/plain)
2023-02-21 03:54 UTC, S. Christian Collins
Details
New crash information added by DrKonqi (3.37 KB, text/plain)
2023-03-07 08:12 UTC, Krzysztof Cybulski
Details
New crash information added by DrKonqi (5.92 KB, text/plain)
2023-03-08 06:13 UTC, Sven Eden
Details
plasmashell backtrace (2.51 KB, text/plain)
2023-03-25 07:59 UTC, Guillaume Castagnino
Details
New crash information added by DrKonqi (5.93 KB, text/plain)
2023-06-07 08:55 UTC, Sven Eden
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Krzysztof Cybulski 2023-02-19 17:20:20 UTC
Application: plasmashell (5.27.0)

Qt Version: 5.15.8
Frameworks Version: 5.103.0
Operating System: Linux 5.19.0-32-generic x86_64
Windowing System: X11
Distribution: KDE neon 5.27
DrKonqi: 5.27.0 [KCrashBackend]

-- Information about the crash:
When I wake up monitors from sleep, plasmashell crashes, 

This never hapended before upgrade to Plasma 5.27, I use KDE Neon

I have 3 monitros

xrandr --listmonitors
Monitors: 3
 0: +*DisplayPort-0 2560/597x1440/336+1920+419  DisplayPort-0
 1: +HDMI-A-0 1920/509x1080/286+0+1200  HDMI-A-0
 2: +DVI-D-0 1920/518x1200/324+0+0  DVI-D-0

The reporter is unsure if this crash is reproducible.

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

[KCrash Handler]
#4  QWeakPointer<QObject>::internalData() const (this=0x58) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer_impl.h:696
#5  QPointer<QScreen>::data() const (this=0x58) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qpointer.h:77
#6  QPointer<QScreen>::operator QScreen*() const (this=0x58) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qpointer.h:83
#7  DesktopView::screenToFollow() const (this=0x0) at ./shell/desktopview.cpp:120
#8  0x000055d0a819351f in ShellCorona::screenInvariants() const (this=0x55d0a883a780) at ./shell/shellcorona.cpp:828
#9  0x00007fbf354f40d4 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffd97221b60, r=0x55d0a883a780, this=0x55d0a8aeb4d0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#10 doActivate<false>(QObject*, int, void**) (sender=0x55d0a883a8a8, signal_index=3, argv=0x7ffd97221b60) at kernel/qobject.cpp:3923
#11 0x00007fbf354ed177 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=<optimized out>, m=m@entry=0x7fbf3575d2e0 <QTimer::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffd97221b60) at kernel/qobject.cpp:3983
#12 0x00007fbf354f815e in QTimer::timeout(QTimer::QPrivateSignal) (this=<optimized out>, _t1=...) at .moc/moc_qtimer.cpp:205
#13 0x00007fbf354e99ff in QObject::event(QEvent*) (this=0x55d0a883a8a8, e=0x7ffd97221ce0) at kernel/qobject.cpp:1369
#14 0x00007fbf3616c793 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x55d0a883a8a8, e=0x7ffd97221ce0) at kernel/qapplication.cpp:3640
#15 0x00007fbf354bc07a in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x55d0a883a8a8, event=0x7ffd97221ce0) at kernel/qcoreapplication.cpp:1064
#16 0x00007fbf35514e0b in QTimerInfoList::activateTimers() (this=0x55d0a8805350) at kernel/qtimerinfo_unix.cpp:643
#17 0x00007fbf35515754 in timerSourceDispatch (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:183
#18 idleTimerSourceDispatch(GSource*, GSourceFunc, gpointer) (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:230
#19 0x00007fbf33facd3b in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x00007fbf340016c8 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#21 0x00007fbf33faa3e3 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#22 0x00007fbf35515ad8 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x55d0a8805180, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#23 0x00007fbf354ba99b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffd97221f20, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#24 0x00007fbf354c2f34 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#25 0x00007fbf359364d0 in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1870
#26 0x00007fbf3616c709 in QApplication::exec() () at kernel/qapplication.cpp:2832
#27 0x000055d0a8166a8b in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at ./shell/main.cpp:235
[Inferior 1 (process 11825) detached]

Reported using DrKonqi
Comment 1 S. Christian Collins 2023-02-21 03:54:05 UTC
Created attachment 156563 [details]
New crash information added by DrKonqi

plasmashell (5.27.0) using Qt 5.15.8

In my case, I get this segfault when disabling my secondary monitor via the command "xrandr --output HDMI-0 --off", which I have assigned to a keyboard shortcut. The crash happens almost immediately after my second screen turns off, and Plasma desktop remains terminated (black desktop, no panels) until I re-enable the secondary monitor via my shortcut for "xrandr --output HDMI-0 --mode 1280x1024 --rate 75 --pos 1920x120", after which my desktop, panels, icons, etc. all come back.

I have only noticed this happening since the upgrade to Plasma 5.27, but since I don't use this feature very often, I can't be certain it was introduced with this release.

-- Additional System Info:
Video: EVGA NVIDIA GeForce GTX 980 Ti SC GAMING ACX 2.0+ w/ 6GB RAM
NVIDIA video driver: 515.86.01
Screen #1 (DVI-I-1, screen 0, marked as primary):
  * Monitor: ASUS VG248QE 24" LCD Monitor
  * Resolution: 1920 x 1280 @ 120 Hz
Screen #2 (HDMI-0, screen 1):
  * Monitor: Dell P170Sb 17" LCD Monitor
  * Resolution: 1280 x 1024 @ 75 Hz
  * Position relative to Screen #1: +1920+120

-- Backtrace (Reduced):
#4  QWeakPointer<QObject>::internalData() const (this=0x58) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer_impl.h:696
#5  QPointer<QScreen>::data() const (this=0x58) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qpointer.h:77
#6  QPointer<QScreen>::operator QScreen*() const (this=0x58) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qpointer.h:83
#7  DesktopView::screenToFollow() const (this=0x0) at ./shell/desktopview.cpp:120
#8  0x000055e25628e51f in ShellCorona::screenInvariants() const (this=0x55e258056c80) at ./shell/shellcorona.cpp:828
Comment 2 Nate Graham 2023-02-22 01:55:41 UTC
Not the same backtrace as seen in Bug 413782.
Comment 3 Krzysztof Cybulski 2023-02-22 06:47:49 UTC
If I disable KScreen2 in KDE services, crash is not happening, but I need to set my screens every time start my computer.
Comment 4 Marco Martin 2023-02-23 15:16:26 UTC
might have been fixed in commit d715af8f0c33a74b84ce2ebd22bc4009a91a33b6  of plasma-workspace
Comment 5 Nate Graham 2023-02-23 16:23:44 UTC
Indeed, so please re-open this if you find that you still experience the crash after upgrading to Plasma 5.27.1. Thanks a lot!
Comment 6 S. Christian Collins 2023-02-23 16:42:53 UTC
For me, the crash is indeed fixed in 5.27.1. However, now when I re-enable my secondary monitor with the xrandr command mentioned in comment #1, it's just a black screen (cursor shows, but no wallpaper or desktop functionality). I will file this as a separate bug.
Comment 7 Krzysztof Cybulski 2023-03-07 08:12:18 UTC
Created attachment 157076 [details]
New crash information added by DrKonqi

plasmashell (5.27.2) using Qt 5.15.8

For me it is not resolved, I did clean install of KDE Neon but problem persists.

-- Backtrace (Reduced):
#6  QWeakPointer<QObject>::internalData (this=0x58) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer_impl.h:696
#7  QPointer<QScreen>::data (this=0x58) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qpointer.h:77
#8  QPointer<QScreen>::operator QScreen* (this=0x58) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qpointer.h:83
#9  DesktopView::screenToFollow (this=0x0) at ./shell/desktopview.cpp:124
#10 0x00005608458cd78f in ShellCorona::screenInvariants (this=0x560847ad0870) at ./shell/shellcorona.cpp:828
Comment 8 Krzysztof Cybulski 2023-03-07 08:29:34 UTC
For me it is not resolved, I did clean install of KDE Neon but problem persists.
Comment 9 Sven Eden 2023-03-08 06:13:34 UTC
Created attachment 157104 [details]
New crash information added by DrKonqi

plasmashell (5.27.2) using Qt 5.15.8

Yesterday evening I closed all programs, started BOINC manager and let my attached projects run. I locked the session and turned my monitors off.
Nothing else was active.
Turned everything back on this morning, everything looked normal, but I had the little crash icon in my info area telling me that Plasma had crashed.

I do not know when, sorry. Might have been before I tunred everything off yesterday, during the night, or when turning everything back on.

-- Backtrace (Reduced):
#6  QWeakPointer<QObject>::internalData() const (this=0x58) at /usr/include/qt5/QtCore/qsharedpointer_impl.h:696
#7  QPointer<QScreen>::data() const (this=0x58) at /usr/include/qt5/QtCore/qpointer.h:77
#8  QPointer<QScreen>::operator QScreen*() const (this=0x58) at /usr/include/qt5/QtCore/qpointer.h:83
#9  DesktopView::screenToFollow() const (this=0x0) at /data/portage/portage/kde-plasma/plasma-workspace-5.27.2/work/plasma-workspace-5.27.2/shell/desktopview.cpp:124
#10 0x0000559825f2cc80 in ShellCorona::screenInvariants() const (this=0x55982798bc80) at /data/portage/portage/kde-plasma/plasma-workspace-5.27.2/work/plasma-workspace-5.27.2/shell/shellcorona.cpp:828
Comment 10 Marco Martin 2023-03-09 11:28:29 UTC
this says that a view for a desktop has been deleted, but not removed from m_desktopViewForScreen

in theory, the only entry point where a desktopview gets deleted is in ShellCorona::removeDesktop  (also in ShellCorona::setScreenForContainment but in theory this should ever be called only from the reorder UI)

in ShellCorona::removeDesktop from 5.27.1 the view is removed m_desktopViewForScreen by searching all the values, so we are sure it's actually removed.
Unless, the same view was inserted in the map multiple times, mapped in two or more screen numbers. this seems *very* improbable, but perhaps worth investigating
Comment 11 Krzysztof Cybulski 2023-03-10 07:42:51 UTC
Hello, 

I ran some extra tests today and Plasma crashes if my high refresh rate monitor is connected.
When only my two standard 60hz monitors are connected. Plasma does not crash.
Comment 12 Krzysztof Cybulski 2023-03-10 17:33:23 UTC
I found that i can disable Adaptive Sync in my MSI MAG274QRF-QD monitor. After switching it off the crash is not happening anymore. So the cause of the crash is Adaptive Sync related.
Please let me know if i can help more.

My monitors:
MSI MAG274QRF-QD (DP-1 2560x1440 165 Hz)
DELL U2412M (DP-0 1920x1200 60 Hz)
SAMSUNG SMBX2331 (HDMI-0 1920x1080 60 Hz)
Comment 13 Guillaume Castagnino 2023-03-25 07:58:46 UTC
Hi,

I have the same backtrace with a quite different use case.

using x11, not wayland, and one standard low frequency monitor (60Hz) connected through mDP and a videoprojector connected through HDMI.

Operating System: Gentoo Linux 2.13
KDE Plasma Version: 5.27.3
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8
Kernel Version: 6.2.8-gentoo (64-bit)
Graphics Platform: X11
Processors: 12 × 12th Gen Intel® Core™ i5-12500
Memory: 31.1 Gio of RAM
Graphics Processor: Mesa Intel® UHD Graphics 770
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: B660I AORUS PRO DDR4
System Version: -CF


Monitors: 2
 0: +*DP-1 2560/597x1440/336+0+0  DP-1
 1: +HDMI-1 1920/508x1080/286+2560+0  HDMI-1


Use case, quite simple:
- Start the HDMI video projector
- shut-down the main DP screen
- put back the main DP screen on
- plasmashell crashes

Nota: it seems that I get this crash only since my main screen is using DP (it was before connected through HDMI too, without issues). But this assumption is just a guess, since I cannot connect it any more using HDMI (motherboard changed)

The backtrace follows
Comment 14 Guillaume Castagnino 2023-03-25 07:59:15 UTC
Created attachment 157561 [details]
plasmashell backtrace
Comment 15 Guillaume Castagnino 2023-03-25 09:19:11 UTC
And for completeness, no crash if plasmashell is built with -DNDEBUG, so this a workaround.
Comment 16 Nate Graham 2023-04-13 19:21:28 UTC

*** This bug has been marked as a duplicate of bug 468430 ***
Comment 17 Sven Eden 2023-06-07 08:55:58 UTC
Created attachment 159511 [details]
New crash information added by DrKonqi

plasmashell (5.27.5) using Qt 5.15.9

DesktopView::screenToFollow() got called on a NULL pointer in my case. (See trace)

Monitor in question reported not having a signal when I turned it on this morning, which was very unusual. Then it came back after 2-3 seconds and I logged into my machine being greeted by the crash reporter.

The Montor is an ASUS Predator with AdaptiveSync (G-Sync compatible) running at 2k resolution @144Hz.

Just one more thing: Could DrKonqi please tell its audience (me) exactly *WHEN* the crash happened? The laptop was doing work overnight, so it could've been useful to know when this happened. Not in this case, obviously, but in outhers it might. Thanks!

-- Backtrace (Reduced):
#6  QWeakPointer<QObject>::internalData() const (this=0x58) at /usr/include/qt5/QtCore/qsharedpointer_impl.h:696
#7  QPointer<QScreen>::data() const (this=0x58) at /usr/include/qt5/QtCore/qpointer.h:77
#8  QPointer<QScreen>::operator QScreen*() const (this=0x58) at /usr/include/qt5/QtCore/qpointer.h:83
#9  DesktopView::screenToFollow() const (this=0x0) at /data/portage/portage/kde-plasma/plasma-workspace-5.27.5/work/plasma-workspace-5.27.5/shell/desktopview.cpp:124
#10 0x000055a2a9a685c0 in ShellCorona::screenInvariants() const (this=0x55a2aa4f3670) at /data/portage/portage/kde-plasma/plasma-workspace-5.27.5/work/plasma-workspace-5.27.5/shell/shellcorona.cpp:828