Bug 404580 - kwin crashes when enabling laptop screen
Summary: kwin crashes when enabling laptop screen
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.15.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-20 01:06 UTC by Andrius Štikonas
Modified: 2021-01-13 18:44 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrius Štikonas 2019-02-20 01:06:00 UTC
I have an external screen that is plugged into my laptop.

Normally, my display configuration is laptop screen (on the left) is turned off, and external screen on the right is enabled.

If I go to screens kcm and enabled laptops screen (positioning it to the left of external screen), kwin_wayland crashes.



(gdb) thread apply all bt

Thread 10 (Thread 0x7fe8a242e700 (LWP 3771)):
#0  0x00007fe8e15c9d43 in poll () from /lib64/libc.so.6
#1  0x00007fe8d7fb31cb in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007fe8d7fb32ec in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007fe8e2b2aa52 in QEventDispatcherGlib::processEvents (this=0x7fe89c000b20, flags=...) at kernel/qeventdispatcher_glib.cpp:422
#4  0x00007fe8e2a9c5ff in QEventLoop::processEvents (this=0x7fe8a242dce0, flags=...) at kernel/qeventloop.cpp:138
#5  0x00007fe8e2a9c8fd in QEventLoop::exec (this=0x7fe8a242dce0, flags=...) at kernel/qeventloop.cpp:225
#6  0x00007fe8e285b62d in QThread::exec (this=0x55582905ef40) at thread/qthread.cpp:531
#7  0x00007fe8eab51a65 in ?? () from /usr/lib64/libQt5Qml.so.5
#8  0x00007fe8e285e290 in QThreadPrivate::start (arg=0x55582905ef40) at thread/qthread_unix.cpp:361
#9  0x00007fe8e55d496a in start_thread () from /lib64/libpthread.so.0
#10 0x00007fe8e15d591f in clone () from /lib64/libc.so.6

Thread 9 (Thread 0x7fe89a49f700 (LWP 3772)):
#0  0x00007fe8e15cfdf9 in syscall () from /lib64/libc.so.6
#1  0x00007fe8e285ff94 in QtLinuxFutex::_q_futex (addr=0x55582918fa80, op=0, val=0, val2=0, addr2=0x0, val3=0) at thread/qfutex_p.h:92
#2  0x00007fe8e286451f in QtLinuxFutex::futexWait<QBasicAtomicInteger<unsigned int> > (futex=..., expectedValue=0) at thread/qfutex_p.h:107
#3  0x00007fe8e286406d in futexSemaphoreTryAcquire_loop<false> (u=..., curValue=4294967296, nn=8589934593, timeout=-1) at thread/qsemaphore.cpp:219
#4  0x00007fe8e2863c96 in futexSemaphoreTryAcquire<false> (u=..., n=1, timeout=-1) at thread/qsemaphore.cpp:262
#5  0x00007fe8e28635ee in QSemaphore::acquire (this=0x55582918fa80, n=1) at thread/qsemaphore.cpp:326
#6  0x00007fe8c66c77da in ?? () from /usr/lib64/libQt5HunspellInputMethod.so.5
#7  0x00007fe8e285e290 in QThreadPrivate::start (arg=0x55582918fa60) at thread/qthread_unix.cpp:361
#8  0x00007fe8e55d496a in start_thread () from /lib64/libpthread.so.0
#9  0x00007fe8e15d591f in clone () from /lib64/libc.so.6

Thread 8 (Thread 0x7fe898c9c700 (LWP 3775)):
#0  0x00007fe8e55db57c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007fe8ec0389c4 in ?? () from /usr/lib64/libQt5Script.so.5
#2  0x00007fe8ec038a09 in ?? () from /usr/lib64/libQt5Script.so.5
#3  0x00007fe8e55d496a in start_thread () from /lib64/libpthread.so.0
#4  0x00007fe8e15d591f in clone () from /lib64/libc.so.6

Thread 7 (Thread 0x7fe8affff700 (LWP 3770)):
#0  0x00007fe8e15c9d43 in poll () from /lib64/libc.so.6
#1  0x00007fe8d7fb31cb in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007fe8d7fb32ec in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007fe8e2b2aa52 in QEventDispatcherGlib::processEvents (this=0x7fe8a4000b20, flags=...) at kernel/qeventdispatcher_glib.cpp:422
#4  0x00007fe8e2a9c5ff in QEventLoop::processEvents (this=0x7fe8afffece0, flags=...) at kernel/qeventloop.cpp:138
#5  0x00007fe8e2a9c8fd in QEventLoop::exec (this=0x7fe8afffece0, flags=...) at kernel/qeventloop.cpp:225
#6  0x00007fe8e285b62d in QThread::exec (this=0x555828f39720) at thread/qthread.cpp:531
#7  0x00007fe8eab51a65 in ?? () from /usr/lib64/libQt5Qml.so.5
#8  0x00007fe8e285e290 in QThreadPrivate::start (arg=0x555828f39720) at thread/qthread_unix.cpp:361
#9  0x00007fe8e55d496a in start_thread () from /lib64/libpthread.so.0
#10 0x00007fe8e15d591f in clone () from /lib64/libc.so.6

Thread 6 (Thread 0x7fe8b581c700 (LWP 3743)):
#0  0x00007fe8e55db57c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007fe8b61968cb in ?? () from /usr/lib64/dri/i965_dri.so
#2  0x00007fe8b61965da in ?? () from /usr/lib64/dri/i965_dri.so
#3  0x00007fe8e55d496a in start_thread () from /lib64/libpthread.so.0
#4  0x00007fe8e15d591f in clone () from /lib64/libc.so.6
---Type <return> to continue, or q <return> to quit---

Thread 5 (Thread 0x7fe8c4b3c700 (LWP 3742)):
#0  0x00007fe8e15c9d43 in poll () from /lib64/libc.so.6
#1  0x00007fe8d7fb31cb in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007fe8d7fb32ec in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007fe8e2b2aa52 in QEventDispatcherGlib::processEvents (this=0x7fe8bc000b20, flags=...) at kernel/qeventdispatcher_glib.cpp:422
#4  0x00007fe8e2a9c5ff in QEventLoop::processEvents (this=0x7fe8c4b3bce0, flags=...) at kernel/qeventloop.cpp:138
#5  0x00007fe8e2a9c8fd in QEventLoop::exec (this=0x7fe8c4b3bce0, flags=...) at kernel/qeventloop.cpp:225
#6  0x00007fe8e285b62d in QThread::exec (this=0x555828bb9e40) at thread/qthread.cpp:531
#7  0x00007fe8e285b806 in QThread::run (this=0x555828bb9e40) at thread/qthread.cpp:598
#8  0x00007fe8e285e290 in QThreadPrivate::start (arg=0x555828bb9e40) at thread/qthread_unix.cpp:361
#9  0x00007fe8e55d496a in start_thread () from /lib64/libpthread.so.0
#10 0x00007fe8e15d591f in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x7fe8c533d700 (LWP 3741)):
#0  0x00007fe8e15c9d43 in poll () from /lib64/libc.so.6
#1  0x00007fe8d7fb31cb in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007fe8d7fb32ec in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007fe8e2b2aa52 in QEventDispatcherGlib::processEvents (this=0x7fe8b8000b20, flags=...) at kernel/qeventdispatcher_glib.cpp:422
#4  0x00007fe8e2a9c5ff in QEventLoop::processEvents (this=0x7fe8c533cce0, flags=...) at kernel/qeventloop.cpp:138
#5  0x00007fe8e2a9c8fd in QEventLoop::exec (this=0x7fe8c533cce0, flags=...) at kernel/qeventloop.cpp:225
#6  0x00007fe8e285b62d in QThread::exec (this=0x555828b58a60) at thread/qthread.cpp:531
#7  0x00007fe8e285b806 in QThread::run (this=0x555828b58a60) at thread/qthread.cpp:598
#8  0x00007fe8e285e290 in QThreadPrivate::start (arg=0x555828b58a60) at thread/qthread_unix.cpp:361
#9  0x00007fe8e55d496a in start_thread () from /lib64/libpthread.so.0
#10 0x00007fe8e15d591f in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x7fe899c9e700 (LWP 3773)):
#0  0x00007fe8e55db57c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007fe8e286af37 in QWaitConditionPrivate::wait (this=0x55582902b780, deadline=...) at thread/qwaitcondition_unix.cpp:146
#2  0x00007fe8e286abd4 in QWaitCondition::wait (this=0x55582907ccd0, mutex=0x55582907ccc8, deadline=...) at thread/qwaitcondition_unix.cpp:225
#3  0x00007fe8e286aaac in QWaitCondition::wait (this=0x55582907ccd0, mutex=0x55582907ccc8, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:208
#4  0x00007fe89b0c77cb in ?? () from /usr/lib64/qt5/qml/Qt/labs/folderlistmodel/libqmlfolderlistmodelplugin.so
#5  0x00007fe8e285e290 in QThreadPrivate::start (arg=0x55582907ccb8) at thread/qthread_unix.cpp:361
#6  0x00007fe8e55d496a in start_thread () from /lib64/libpthread.so.0
#7  0x00007fe8e15d591f in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7fe8c5da4700 (LWP 3740)):
#0  0x00007fe8e15c9d43 in poll () from /lib64/libc.so.6
#1  0x00007fe8d7fb31cb in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007fe8d7fb32ec in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007fe8e2b2aa52 in QEventDispatcherGlib::processEvents (this=0x7fe8c0000b20, flags=...) at kernel/qeventdispatcher_glib.cpp:422
#4  0x00007fe8e2a9c5ff in QEventLoop::processEvents (this=0x7fe8c5da3cb0, flags=...) at kernel/qeventloop.cpp:138
#5  0x00007fe8e2a9c8fd in QEventLoop::exec (this=0x7fe8c5da3cb0, flags=...) at kernel/qeventloop.cpp:225
#6  0x00007fe8e285b62d in QThread::exec (this=0x7fe8e4ccad80 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread.cpp:531
#7  0x00007fe8e4a1e171 in QDBusConnectionManager::run (this=0x7fe8e4ccad80 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at qdbusconnection.cpp:178
#8  0x00007fe8e285e290 in QThreadPrivate::start (arg=0x7fe8e4ccad80 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread_unix.cpp:361
#9  0x00007fe8e55d496a in start_thread () from /lib64/libpthread.so.0
#10 0x00007fe8e15d591f in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7fe8ed3b9880 (LWP 3739)):
#0  0x00007fe8e2ae4040 in QMetaObject::disconnect (sender=0x555829791780, signal_index=-1, receiver=0x555828d290c0, method_index=6) at kernel/qobject.cpp:3344
---Type <return> to continue, or q <return> to quit---
#1  0x00007fe8e4a5824e in QDBusAdaptorConnector::disconnectAllSignals (this=0x555828d290c0, obj=0x555829791780) at qdbusabstractadaptor.cpp:252
#2  0x00007fe8e4a581ab in QDBusAdaptorConnector::addAdaptor (this=0x555828d290c0, adaptor=0x555829c782b0) at qdbusabstractadaptor.cpp:232
#3  0x00007fe8e4a58394 in QDBusAdaptorConnector::polish (this=0x555828d290c0) at qdbusabstractadaptor.cpp:272
#4  0x00007fe8e4a58b53 in QDBusAdaptorConnector::qt_static_metacall (_o=0x555828d290c0, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x555829c925e0) at qdbusabstractadaptor.cpp:406
#5  0x00007fe8e2ade0b9 in QMetaCallEvent::placeMetaCall (this=0x555829c7d180, object=0x555828d290c0) at kernel/qobject.cpp:520
#6  0x00007fe8e2adf083 in QObject::event (this=0x555828d290c0, e=0x555829c7d180) at kernel/qobject.cpp:1260
#7  0x00007fe8e3c735d0 in QApplicationPrivate::notify_helper (this=0x555828b6ce60, receiver=0x555828d290c0, e=0x555829c7d180) at kernel/qapplication.cpp:3753
#8  0x00007fe8e3c7098d in QApplication::notify (this=0x7ffe3c051680, receiver=0x555828d290c0, e=0x555829c7d180) at kernel/qapplication.cpp:3110
#9  0x00007fe8e2a9f863 in QCoreApplication::notifyInternal2 (receiver=0x555828d290c0, event=0x555829c7d180) at kernel/qcoreapplication.cpp:1060
#10 0x00007fe8e2aa01fa in QCoreApplication::sendEvent (receiver=0x555828d290c0, event=0x555829c7d180) at kernel/qcoreapplication.cpp:1450
#11 0x00007fe8e2aa0dc8 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x555828b22c30) at kernel/qcoreapplication.cpp:1799
#12 0x00007fe8e2b246ae in QEventDispatcherUNIX::processEvents (this=0x555828b67a00, flags=...) at kernel/qeventdispatcher_unix.cpp:466
#13 0x00007fe8c87882de in QUnixEventDispatcherQPA::processEvents (this=0x555828b67a00, flags=...) at qunixeventdispatcher.cpp:63
#14 0x00007fe8e2a9c5ff in QEventLoop::processEvents (this=0x7ffe3c0514a0, flags=...) at kernel/qeventloop.cpp:138
#15 0x00007fe8e2a9c8fd in QEventLoop::exec (this=0x7ffe3c0514a0, flags=...) at kernel/qeventloop.cpp:225
#16 0x00007fe8e2aa003e in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1363
#17 0x00007fe8e3146434 in QGuiApplication::exec () at kernel/qguiapplication.cpp:1779
#18 0x00007fe8e3c7022f in QApplication::exec () at kernel/qapplication.cpp:2910
#19 0x000055582711f4e0 in main (argc=4, argv=0x7ffe3c0518e8) at /var/tmp/portage/kde-plasma/kwin-5.15.1/work/kwin-5.15.1/main_wayland.cpp:830
Comment 1 Andrius Štikonas 2019-02-20 01:19:30 UTC
I can also see this in journalctl

vas. 20 00:59:19 laptop kdeinit5[3778]: kscreen.kded: KScreen::Output( 2   "SAM HDMI-A-1-S24C300/808661304" connected enabled primary pos: QPoint(1920,0) res: QSize(-1, -1) modeId: "0" scale: 1 followPreferred>
vas. 20 00:59:19 laptop kdeinit5[3778]: kscreen.kded: Change detected
vas. 20 00:59:19 laptop kdeinit5[3778]: kscreen.kded: KScreen::Output( 1   "AUO eDP-1-unknown" connected disabled  pos: QPoint(0,0) res: QSize(-1, -1) modeId: "0" scale: 1 followPreferredMode: false )
vas. 20 00:59:19 laptop kdeinit5[3778]: kscreen.kded: KScreen::Output( 2   "SAM HDMI-A-1-S24C300/808661304" connected enabled primary pos: QPoint(1920,0) res: QSize(-1, -1) modeId: "0" scale: 1 followPreferred>
vas. 20 00:59:19 laptop kdeinit5[3778]: kscreen.kded: Change detected
vas. 20 00:59:19 laptop kdeinit5[3778]: kscreen.kded: KScreen::Output( 1   "AUO eDP-1-unknown" connected disabled  pos: QPoint(0,0) res: QSize(-1, -1) modeId: "0" scale: 1 followPreferredMode: false )
vas. 20 00:59:19 laptop kdeinit5[3778]: kscreen.kded: KScreen::Output( 2   "SAM HDMI-A-1-S24C300/808661304" connected enabled primary pos: QPoint(1920,0) res: QSize(-1, -1) modeId: "0" scale: 1 followPreferred>
vas. 20 00:59:19 laptop kdeinit5[3778]: kscreen.kded: Change detected
vas. 20 00:59:19 laptop kdeinit5[3778]: kscreen.kded: KScreen::Output( 1   "AUO eDP-1-unknown" connected disabled  pos: QPoint(0,0) res: QSize(-1, -1) modeId: "0" scale: 1 followPreferredMode: false )
vas. 20 00:59:19 laptop kdeinit5[3778]: kscreen.kded: KScreen::Output( 2   "SAM HDMI-A-1-S24C300/808661304" connected enabled primary pos: QPoint(1920,0) res: QSize(-1, -1) modeId: "0" scale: 1 followPreferred>
vas. 20 00:59:19 laptop kernel: traps: kwin_wayland[3739] general protection ip:7fe8e2ae4040 sp:7ffe3c050b60 error:0 in libQt5Core.so.5.12.1[7fe8e279f000+65f000]
vas. 20 00:59:19 laptop systemd[1]: Started Process Core Dump (PID 5436/UID 0).
vas. 20 00:59:20 laptop kdeinit5[3778]: kscreen.kded: Saving current config to file
vas. 20 00:59:20 laptop kdeinit5[3778]: kscreen.kded: Config saved on:  "/home/andrius/.local/share/kscreen/2c86d3716a57a3dfb9e034cabaced403"
vas. 20 00:59:20 laptop kdeinit5[3778]: kscreen.kded: KScreen::Output( 1   "AUO eDP-1-unknown" connected disabled  pos: QPoint(0,0) res: QSize(-1, -1) modeId: "0" scale: 1 followPreferredMode: false )
vas. 20 00:59:20 laptop kdeinit5[3778]: kscreen.kded: KScreen::Output( 2   "SAM HDMI-A-1-S24C300/808661304" connected enabled primary pos: QPoint(1920,0) res: QSize(-1, -1) modeId: "0" scale: 1 followPreferred>
vas. 20 00:59:22 laptop konsole[5372]: The Wayland connection broke. Did the Wayland compositor die?
vas. 20 00:59:22 laptop systemsettings5[5308]: The Wayland connection broke. Did the Wayland compositor die?
vas. 20 00:59:22 laptop plasmashell[4391]: The Wayland connection broke. Did the Wayland compositor die?
vas. 20 00:59:22 laptop org.kde.kpasswdserver[3701]: The Wayland connection broke. Did the Wayland compositor die?
vas. 20 00:59:22 laptop org.kde.kpasswdserver[3701]: QDBusAbstractAdaptor: Cannot relay signal KDEDModule::moduleDeleted(KDEDModule*): Pointers are not supported: KDEDModule*
vas. 20 00:59:22 laptop org.kde.kuiserver[3701]: The Wayland connection broke. Did the Wayland compositor die?
Comment 2 Martin Flöser 2019-02-20 05:24:23 UTC
I don't see a crash in the frame stacks.
Comment 3 Andrius Štikonas 2019-02-20 12:43:14 UTC
On 2019-02-20 05:24, Martin Flöser wrote:
> https://bugs.kde.org/show_bug.cgi?id=404580
> 
> --- Comment #2 from Martin Flöser <mgraesslin@kde.org> ---
> I don't see a crash in the frame stacks.

How can I obtain a crash log then.

I obtained this by running coredumpctl debug /usr/bin/kwin_wayland.
And dmesg clearly indicates General protection fault, so some illegal 
action was being attempted.
Comment 4 Martin Flöser 2019-02-20 19:02:29 UTC
Oh, I'm sure this is the backtrace. I just don't see any crash. All threads are in their event loop except for thread 1 which is looking innocent: qdbus code from event loop.  None of the threads is in KWin code.
Comment 5 Nate Graham 2021-01-13 18:44:47 UTC
#6  QMessageLogger::fatal (this=this@entry=0x7fffd70c5ba0, msg=msg@entry=0x7ff994ac00b8 "The Wayland connection broke. Did the Wayland compositor die?") at global/qlogging.cpp:893

This means that the compositor crashed. Due to a Qt issue, when this happens, the app using it will crash too. KDE developers submitted a fix, but sadly it was not merged. See https://codereview.qt-project.org/c/qt/qtwayland/+/308984.

Until we get better handling of this in Qt, the best we can do is debug why the compositor crashed in the first place. So can you please get a backtrace of the crash in kwin_wayland and then file a new bug report with it on kwin | wayland-generic? Thanks!

You may be able to use the `coredumpctl` utility to retrieve the backtrace. See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports#Retrieving_a_backtrace_using_coredumpctl