Bug 478990 - Plasmashell crashes upon unplugging and repluging a monitor in portrait mode
Summary: Plasmashell crashes upon unplugging and repluging a monitor in portrait mode
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: generic-crash (show other bugs)
Version: 5.91.0
Platform: Arch Linux Linux
: NOR crash
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: drkonqi, qt6
: 479409 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-12-25 10:59 UTC by qlum
Modified: 2024-01-13 12:41 UTC (History)
3 users (show)

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


Attachments
New crash information added by DrKonqi (180.76 KB, text/plain)
2023-12-25 10:59 UTC, qlum
Details

Note You need to log in before you can comment on or make changes to this bug.
Description qlum 2023-12-25 10:59:35 UTC
Application: plasmashell (5.91.0)

Qt Version: 6.7.0
Frameworks Version: 5.247.0
Operating System: Linux 6.7.0-rc5-273-tkg-eevdf x86_64
Windowing System: Wayland
Distribution: "Arch Linux"
DrKonqi: 5.91.0 [CoredumpBackend]

-- Information about the crash:
Whenever I unplug and then replug one of my displays which is in portrait mode, plasmashell crashes.
This does not happen under plasma 5.27
I can reproduce the issue on 2 different systems with different displays connected.

The crash can be reproduced every time.

-- Backtrace (Reduced):
#5  0x00007f27550810da in QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::get() const (this=0x8, this=<optimized out>) at /usr/include/qt6/QtCore/qscopedpointer.h:112
[...]
#8  QQuickItem::flags() const (this=0x0) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0-beta1/src/quick/items/qquickitem.cpp:6951
#9  forcePolishHelper(QQuickItem*) (item=0x0) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0-beta1/src/quick/items/qquickwindow.cpp:440
#10 0x00007f27537beaa9 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffc869672e0, r=0x55cc0056eb30, this=0x55cc0056f170, this=<optimized out>, r=<optimized out>, a=<optimized out>) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/corelib/kernel/qobjectdefs_impl.h:469
#11 doActivate<false>(QObject*, int, void**) (sender=0x55cc0056eb30, signal_index=3, argv=0x7ffc869672e0) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/corelib/kernel/qobject.cpp:4044


Reported using DrKonqi
Comment 1 qlum 2023-12-25 10:59:36 UTC
Created attachment 164437 [details]
New crash information added by DrKonqi

DrKonqi auto-attaching complete backtrace.
Comment 2 qlum 2023-12-25 14:12:53 UTC
I will add that the display that has been disconnected / reconnected does not have to be the one in portrait itself. 
It seems the crash also happens upon connecting a display while having at least one display in portrait.
The display in portrait can also be disabled in settings, when connecting a different display for plasmashell to crash.
Comment 3 Dennis 2023-12-27 12:39:46 UTC
Ok, weird stuff is happening after trying to reproduce. I can confirm things aren't working as they should, but I have to note:
- I tried it while my system was connected to a TB16 docking, which has the external monitor coupled.
- I can't report the crash due to 
https://bugs.kde.org/show_bug.cgi?id=478883
https://bugs.kde.org/show_bug.cgi?id=478885

I do have the bug reports saved locally, although drkonqi reports it is not usable. let me know if they are still of interest.
Comment 4 fanzhuyifan 2024-01-03 05:15:50 UTC
Can reproduce when setting the laptop screen to portrait mode.

Operating System: Arch Linux 
KDE Plasma Version: 5.91.90
KDE Frameworks Version: 5.248.0
Qt Version: 6.7.0
Kernel Version: 6.6.8-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 20 × 13th Gen Intel® Core™ i9-13900H
Memory: 15.2 GiB of RAM
Graphics Processor: Mesa Intel® Graphics
Manufacturer: ASUSTeK COMPUTER INC.
Product Name: ROG Zephyrus G16 GU603VV_GU603VV
System Version: 1.0
Comment 5 fanzhuyifan 2024-01-04 21:48:32 UTC
*** Bug 479409 has been marked as a duplicate of this bug. ***
Comment 6 fanzhuyifan 2024-01-04 21:49:38 UTC
(In reply to fanzhuyifan from comment #5)
> *** Bug 479409 has been marked as a duplicate of this bug. ***

Same backtrace when changing display positions using multiple monitors.

#0  0x00007fc0e04810da in QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::get() const (this=0x8, this=<optimized out>)
    at /usr/include/qt6/QtCore/qscopedpointer.h:112
#1  qGetPtrHelper<QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> > const>(QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> > const&)
    (ptr=..., ptr=<optimized out>) at /usr/include/qt6/QtCore/qtclasshelpermacros.h:79
#2  QQuickItem::d_func() const (this=0x0) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0-beta1/src/quick/items/qquickitem.h:494
#3  QQuickItem::flags() const (this=0x0) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0-beta1/src/quick/items/qquickitem.cpp:6951
#4  forcePolishHelper(QQuickItem*) (item=0x0) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.7.0-beta1/src/quick/items/qquickwindow.cpp:440
#5  0x00007fc0de9beaa9 in QtPrivate::QSlotObjectBase::call(QObject*, void**)
    (a=0x7fffd56af420, r=0x55da7f58a890, this=0x55da7f597770, this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/corelib/kernel/qobjectdefs_impl.h:469
#6  doActivate<false>(QObject*, int, void**) (sender=0x55da7f58a890, signal_index=3, argv=0x7fffd56af420)
    at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/corelib/kernel/qobject.cpp:4044
#7  0x00007fc0df200fe3 in QWindow::screenChanged(QScreen*) (_t1=0x55da7c882cc0, this=0x55da7f58a890)
    at /usr/src/debug/qt6-base/build/src/gui/Gui_autogen/include/moc_qwindow.cpp:815
#8  QWindowPrivate::emitScreenChangedRecursion(QScreen*) (newScreen=0x55da7c882cc0, this=0x7fbfd40255f0)
    at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/gui/kernel/qwindow.cpp:496
#9  QWindowPrivate::setTopLevelScreen(QScreen*, bool) (this=this@entry=0x7fbfd40255f0, newScreen=0x55da7c882cc0, recreate=recreate@entry=false)
    at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/gui/kernel/qwindow.cpp:520
#10 0x00007fc0df200ea5 in QWindowPrivate::create(bool, unsigned long long) (this=0x7fbfd40255f0, recursive=recursive@entry=false, nativeHandle=nativeHandle@entry=0)
    at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/gui/kernel/qwindow.cpp:549
#11 0x00007fc0df201741 in QWindow::create() (this=<optimized out>) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/gui/kernel/qwindow.cpp:716
#12 0x00007fc0d01817fd in surfaceForWindow(QWindow*) (window=0x55da7f58a890) at /usr/src/debug/kwindowsystem/kwindowsystem/src/platforms/wayland/surfacehelper.h:26
#13 WindowShadow::internalDestroy() (this=0x55da7f5ae8f0) at /usr/src/debug/kwindowsystem/kwindowsystem/src/platforms/wayland/windowshadow.cpp:192
#14 0x00007fc0de9beaa9 in QtPrivate::QSlotObjectBase::call(QObject*, void**)
    (a=0x7fffd56af618, r=0x55da7f5ae8f0, this=0x55da80c4a7d0, this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/corelib/kernel/qobjectdefs_impl.h:469
#15 doActivate<false>(QObject*, int, void**) (sender=0x55da81f0aca0, signal_index=7, argv=0x7fffd56af618)
    at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/corelib/kernel/qobject.cpp:4044
#16 0x00007fc0e09a9ef0 in QtWaylandClient::QWaylandWindow::wlSurfaceDestroyed() (this=0x55da81f0aca0)
    at /usr/src/debug/qt6-wayland/build/src/client/WaylandClient_autogen/include/moc_qwaylandwindow_p.cpp:174
#17 QtWaylandClient::QWaylandWindow::reset() (this=0x55da81f0aca0) at /usr/src/debug/qt6-wayland/qtwayland-everywhere-src-6.7.0-beta1/src/client/qwaylandwindow.cpp:284
#18 0x00007fc0e09a4a18 in QtWaylandClient::QWaylandWindow::~QWaylandWindow() (this=0x55da81f0aca0, this=<optimized out>)
    at /usr/src/debug/qt6-wayland/qtwayland-everywhere-src-6.7.0-beta1/src/client/qwaylandwindow.cpp:77
#19 0x00007fc0d97e1bb2 in non-virtual thunk to QtWaylandClient::QWaylandEglWindow::~QWaylandEglWindow() ()
    at /usr/src/debug/qt6-wayland/qtwayland-everywhere-src-6.7.0-beta1/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow_p.h:35
#20 0x00007fc0df206595 in QWindowPrivate::destroy() (this=0x7fbfd40255f0) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/gui/kernel/qwindow.cpp:2086
#21 0x00007fc0df201b32 in QWindow::~QWindow() (this=0x55da7f58a890, this=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/gui/kernel/qwindow.cpp:185
#22 0x000055da7ae2296d in PanelView::~PanelView() (this=0x55da7f58a890, __in_chrg=<optimized out>)
    at /usr/src/debug/plasma-workspace/plasma-workspace/shell/panelview.cpp:129
#23 0x00007fc0de9afa4c in qDeleteInEventHandler(QObject*) (o=0x55da7f58a890)
    at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/corelib/kernel/qobject.cpp:4945
#24 QObject::event(QEvent*) (this=0x55da7f58a890, e=0x55da7e14c9e0) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/corelib/kernel/qobject.cpp:1433
--Type <RET> for more, q to quit, c to continue without paging--c
#25 0x00007fc0e0b7bf4b in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x55da7f58a890, e=0x55da7e14c9e0)
    at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/widgets/kernel/qapplication.cpp:3290
#26 0x00007fc0de965488 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x55da7f58a890, event=event@entry=0x55da7e14c9e0)
    at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/corelib/kernel/qcoreapplication.cpp:1134
#27 0x00007fc0de965814 in QCoreApplication::sendEvent(QObject*, QEvent*) (event=0x55da7e14c9e0, receiver=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/corelib/kernel/qcoreapplication.cpp:1575
#28 QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x55da7c83dba0)
    at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/corelib/kernel/qcoreapplication.cpp:1946
#29 0x00007fc0debad734 in QCoreApplication::sendPostedEvents(QObject*, int) (receiver=0x0, event_type=0)
    at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/corelib/kernel/qcoreapplication.cpp:1803
#30 postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x55da7c8e3510)
    at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/corelib/kernel/qeventdispatcher_glib.cpp:244
#31 0x00007fc0dd48ff69 in g_main_dispatch (context=0x7fc0d4000ef0) at ../glib/glib/gmain.c:3476
#32 0x00007fc0dd4ee367 in g_main_context_dispatch_unlocked (context=0x7fc0d4000ef0) at ../glib/glib/gmain.c:4284
#33 g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x7fc0d4000ef0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at ../glib/glib/gmain.c:4349
#34 0x00007fc0dd48e162 in g_main_context_iteration (context=0x7fc0d4000ef0, may_block=1) at ../glib/glib/gmain.c:4414
#35 0x00007fc0debab164 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x55da7c86c3d0, flags=...)
    at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/corelib/kernel/qeventdispatcher_glib.cpp:394
#36 0x00007fc0de96d67e in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (flags=..., this=0x7fffd56afc30)
    at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/corelib/kernel/qeventloop.cpp:100
#37 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x7fffd56afc30, flags=...)
    at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/corelib/kernel/qeventloop.cpp:182
#38 0x00007fc0de9690b8 in QCoreApplication::exec() () at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/corelib/global/qflags.h:74
#39 0x00007fc0e0b7849a in QApplication::exec() () at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/widgets/kernel/qapplication.cpp:2568
#40 0x000055da7adfd0e5 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/plasma-workspace/plasma-workspace/shell/main.cpp:214
Comment 7 fanzhuyifan 2024-01-04 21:59:12 UTC
Examining the backtraces, the problem seems to be QWindow::create being called on a window that is being destroyed in its destructor...

> #15 0x00007f2754000ea5 in QWindowPrivate::create(bool, unsigned long long) (this=0x55cbff19c5c0, recursive=recursive@entry=false, nativeHandle=nativeHandle@entry=0) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/gui/kernel/qwindow.cpp:549
> #16 0x00007f2754001741 in QWindow::create() (this=<optimized out>) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/gui/kernel/qwindow.cpp:716
> #17 0x00007f274dac7edd in surfaceForWindow(QWindow*) (window=0x55cc0056eb30) at /usr/src/debug/kwindowsystem/kwindowsystem-5.247.0/src/platforms/wayland/surfacehelper.h:26
> ...
> #25 0x00007f2754006595 in QWindowPrivate::destroy() (this=0x55cbff19c5c0) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/gui/kernel/qwindow.cpp:2086
> #26 0x00007f2754001b32 in QWindow::~QWindow() (this=0x55cc0056eb30, this=<optimized out>) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.7.0-beta1/src/gui/kernel/qwindow.cpp:185
Comment 8 Bug Janitor Service 2024-01-04 23:41:01 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kwindowsystem/-/merge_requests/142
Comment 9 fanzhuyifan 2024-01-09 07:48:08 UTC
Git commit 7e9130c13c82db42e9309a434cbc7fe074c5497e by Yifan Zhu.
Committed on 09/01/2024 at 08:37.
Pushed by fanzhuyifan into branch 'master'.

Only try unset surface if native window is alive

Sometimes WindowShadow::internalDestroy is called when the window is being destroyed.
In that case, recreating the window in surfaceForWindow(...) causes segfault.
Only call surfaceForWindow and unset the surface if the native window is alive.

M  +3    -1    src/platforms/wayland/windowshadow.cpp

https://invent.kde.org/frameworks/kwindowsystem/-/commit/7e9130c13c82db42e9309a434cbc7fe074c5497e
Comment 10 fanzhuyifan 2024-01-09 17:45:41 UTC
Marking as fixed since the particular problem corresponding to the reported backtraces should be fixed by the latest commit. The remaining crashes that I get seems to be duplicates of either 477233 or 478838.
Comment 11 qlum 2024-01-13 12:41:30 UTC
The Issue I was having seems to at least been fixed in RC1