Bug 428897

Summary: Kwin consistently crashes
Product: [Plasma] kwin Reporter: vmpn <volchok>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED DOWNSTREAM    
Severity: crash CC: chaim.zax, dabiswas112, dave_gomboc, kc-kde, kolAflash, mapelli.dario, paolo, peterlas, pierceagriffiths, volchok
Priority: NOR Keywords: drkonqi
Version: 5.17.5   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description vmpn 2020-11-09 17:16:54 UTC
Application: kwin_x11 (5.17.5)

Qt Version: 5.15.1
Frameworks Version: 5.74.0
Operating System: Linux 5.7.0-1-amd64 x86_64
Distribution: Debian GNU/Linux bullseye/sid

-- Information about the crash:
Initally logging into my user post reboot

Installed debug symbols so there is more usable stack trace in the report

The crash can be reproduced every time.

-- Backtrace:
Application: KWin (kwin_x11), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f7df077b8c0 (LWP 255564))]

Thread 3 (Thread 0x7f7ded445700 (LWP 255574)):
#0  futex_abstimed_wait_cancelable (private=0, abstime=0x7f7ded444c50, clockid=-314291248, expected=0, futex_word=0x5638c40c9364) at ../sysdeps/nptl/futex-internal.h:320
#1  __pthread_cond_wait_common (abstime=0x7f7ded444c50, clockid=-314291248, mutex=0x5638c40c9310, cond=0x5638c40c9338) at pthread_cond_wait.c:520
#2  __pthread_cond_timedwait (cond=0x5638c40c9338, mutex=0x5638c40c9310, abstime=0x7f7ded444c50) at pthread_cond_wait.c:656
#3  0x00007f7df6bf6aa4 in QWaitConditionPrivate::wait_relative(QDeadlineTimer) (deadline=..., this=0x5638c40c9310) at thread/qwaitcondition_unix.cpp:136
#4  QWaitConditionPrivate::wait(QDeadlineTimer) (deadline=..., deadline=..., this=0x5638c40c9310) at thread/qwaitcondition_unix.cpp:144
#5  QWaitCondition::wait(QMutex*, QDeadlineTimer) (this=this@entry=0x5638c40ccde0, mutex=mutex@entry=0x5638c40c3808, deadline=...) at thread/qwaitcondition_unix.cpp:225
#6  0x00007f7df6bf4ae1 in QThreadPoolThread::run() (this=0x5638c40ccdd0) at ../../include/QtCore/../../src/corelib/thread/qmutex.h:270
#7  0x00007f7df6bf0b01 in QThreadPrivate::start(void*) () at thread/qthread_unix.cpp:329
#8  0x00007f7df600eea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
#9  0x00007f7df838ed4f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7f7def267700 (LWP 255568)):
#0  0x00007f7df8384456 in __ppoll (fds=fds@entry=0x7f7de0009ae8, nfds=nfds@entry=1, timeout=<optimized out>, timeout@entry=0x0, sigmask=sigmask@entry=0x0) at ../sysdeps/unix/sysv/linux/ppoll.c:44
#1  0x00007f7df6e23779 in ppoll (__ss=<optimized out>, __timeout=<optimized out>, __nfds=<optimized out>, __fds=<optimized out>) at /usr/include/x86_64-linux-gnu/bits/poll2.h:77
#2  qt_ppoll (timeout_ts=0x0, nfds=1, fds=0x7f7de0009ae8) at kernel/qcore_unix.cpp:132
#3  qt_ppoll (timeout_ts=0x0, nfds=1, fds=0x7f7de0009ae8) at kernel/qcore_unix.cpp:129
#4  qt_safe_poll(pollfd*, unsigned long, timespec const*) (fds=0x7f7de0009ae8, nfds=1, timeout_ts=timeout_ts@entry=0x0) at kernel/qcore_unix.cpp:155
#5  0x00007f7df6e24e13 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=<optimized out>, flags=...) at ../../include/QtCore/../../src/corelib/tools/qarraydata.h:211
#6  0x00007f7df6dceb7b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7f7def266c90, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:141
#7  0x00007f7df6bef9be in QThread::exec() (this=<optimized out>) at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#8  0x00007f7df512fa27 in  () at /lib/x86_64-linux-gnu/libQt5DBus.so.5
#9  0x00007f7df6bf0b01 in QThreadPrivate::start(void*) () at thread/qthread_unix.cpp:329
#10 0x00007f7df600eea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
#11 0x00007f7df838ed4f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7f7df077b8c0 (LWP 255564)):
[KCrash Handler]
#4  std::__atomic_base<int>::operator++() (this=<optimized out>) at /usr/include/c++/10/bits/atomic_base.h:325
#5  QAtomicOps<int>::ref<int>(std::atomic<int>&) (_q_value=...) at ../../include/QtCore/../../src/corelib/thread/qatomic_cxx11.h:283
#6  QBasicAtomicInteger<int>::ref() (this=<optimized out>) at ../../include/QtCore/../../src/corelib/thread/qbasicatomic.h:118
#7  QtPrivate::RefCount::ref() (this=<optimized out>) at ../../include/QtCore/../../src/corelib/tools/qrefcount.h:61
#8  QString::operator=(QString const&) (this=0x5638c4214350, other=...) at text/qstring.cpp:2408
#9  0x00007f7df80a110c in  () at /lib/x86_64-linux-gnu/libkwin.so.5
#10 0x00007f7dec79b910 in Breeze::Decoration::isLeftEdge() const (this=0x5638c425d4f0) at /usr/include/c++/9/bits/atomic_base.h:413
#11 Breeze::Decoration::recalculateBorders() (this=this@entry=0x5638c425d4f0) at ./kdecoration/breezedecoration.cpp:397
#12 0x00007f7dec79f7f9 in Breeze::Decoration::reconfigure() (this=this@entry=0x5638c425d4f0) at ./kdecoration/breezedecoration.cpp:379
#13 0x00007f7dec79fa28 in Breeze::Decoration::init() (this=0x5638c425d4f0) at ./kdecoration/breezedecoration.cpp:248
#14 0x00007f7df80a2d52 in KWin::Decoration::DecorationBridge::createDecoration(KWin::AbstractClient*) () at /lib/x86_64-linux-gnu/libkwin.so.5
#15 0x00007f7df80774cc in KWin::Client::createDecoration(QRect const&) () at /lib/x86_64-linux-gnu/libkwin.so.5
#16 0x00007f7df807b758 in KWin::Client::updateDecoration(bool, bool) () at /lib/x86_64-linux-gnu/libkwin.so.5
#17 0x00007f7df810f246 in KWin::Client::manage(unsigned int, bool) () at /lib/x86_64-linux-gnu/libkwin.so.5
#18 0x00007f7df81ab9a5 in KWin::Workspace::createClient(unsigned int, bool) () at /lib/x86_64-linux-gnu/libkwin.so.5
#19 0x00007f7df81afa1f in KWin::Workspace::initWithX11() () at /lib/x86_64-linux-gnu/libkwin.so.5
#20 0x00007f7df81b0d51 in KWin::Workspace::init() () at /lib/x86_64-linux-gnu/libkwin.so.5
#21 0x00007f7df81b156d in KWin::Workspace::Workspace(QString const&) () at /lib/x86_64-linux-gnu/libkwin.so.5
#22 0x00007f7df810c054 in KWin::Application::createWorkspace() () at /lib/x86_64-linux-gnu/libkwin.so.5
#23 0x00007f7df845de6c in operator() (__closure=0x5638c4122bb0) at ./main_x11.cpp:251
#24 QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, KWin::ApplicationX11::performStartup()::<lambda()>::<lambda()> >::call (arg=<optimized out>, f=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:146
#25 QtPrivate::Functor<KWin::ApplicationX11::performStartup()::<lambda()>::<lambda()>, 0>::call<QtPrivate::List<>, void> (arg=<optimized out>, f=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:256
#26 QtPrivate::QFunctorSlotObject<KWin::ApplicationX11::performStartup()::<lambda()>::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=0x5638c4122ba0, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:443
#27 0x00007f7df6e06796 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7fff9d947df0, r=0x7fff9d9483a0, this=0x5638c4122ba0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#28 doActivate<false>(QObject*, int, void**) (sender=0x5638c40806b0, signal_index=3, argv=0x7fff9d947df0) at kernel/qobject.cpp:3886
#29 0x00007f7df845e2cc in operator() (__closure=0x5638c407e920) at ./main.h:186
#30 QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, KWin::ApplicationX11::performStartup()::<lambda()> >::call (arg=<optimized out>, f=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:146
#31 QtPrivate::Functor<KWin::ApplicationX11::performStartup()::<lambda()>, 0>::call<QtPrivate::List<>, void> (arg=<optimized out>, f=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:256
#32 QtPrivate::QFunctorSlotObject<KWin::ApplicationX11::performStartup()::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=0x5638c407e910, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:443
#33 0x00007f7df6e06796 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7fff9d947f40, r=0x5638c4074cb0, this=0x5638c407e910) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#34 doActivate<false>(QObject*, int, void**) (sender=0x5638c4074cb0, signal_index=4, argv=0x7fff9d947f40) at kernel/qobject.cpp:3886
#35 0x00007f7df7de8633 in  () at /lib/x86_64-linux-gnu/libKF5WindowSystem.so.5
#36 0x00007f7df6dfc11f in QObject::event(QEvent*) (this=0x5638c4074cb0, e=0x7fff9d948110) at kernel/qobject.cpp:1291
#37 0x00007f7df789214f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#38 0x00007f7df6dd01ba in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x5638c4074cb0, event=0x7fff9d948110) at ../../include/QtCore/5.15.1/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:325
#39 0x00007f7df6e26ad3 in QTimerInfoList::activateTimers() (this=this@entry=0x5638c4004188) at kernel/qtimerinfo_unix.cpp:643
#40 0x00007f7df6e2420c in QEventDispatcherUNIXPrivate::activateTimers() (this=this@entry=0x5638c4004100) at kernel/qeventdispatcher_unix.cpp:249
#41 0x00007f7df6e24f67 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=<optimized out>, flags=...) at kernel/qeventdispatcher_unix.cpp:516
#42 0x00007f7df039b5fe in  () at /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#43 0x00007f7df6dceb7b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fff9d9482b0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:141
#44 0x00007f7df6dd6df0 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#45 0x00007f7df845f886 in kdemain(int, char**) (argc=<optimized out>, argv=0x7fff9d948558) at ./main_x11.cpp:474
#46 0x00007f7df82b7cca in __libc_start_main (main=0x5638c3502050 <main>, argc=3, argv=0x7fff9d948558, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff9d948548) at ../csu/libc-start.c:308
#47 0x00005638c350208a in _start ()
[Inferior 1 (process 255564) detached]

Possible duplicates by query: bug 427021, bug 425205, bug 424171, bug 422092, bug 420495.

Reported using DrKonqi
Comment 1 Pierce 2020-11-09 23:39:45 UTC
The bug appears to be caused by libkdecorations2-5v5, libkf5screen-bin, and/or libkf5screen7 when they are upgraded to versions 4:5.19.5-3, 4:5.19.5-3, and 4:5.19.5-3, respectively. Downgrading libkdecorations2-5v5 to 4:5.17.5-2, libkf5screen-bin to 4:5.17.5-3, and libkf5screen7 to 4:5.17.5-3 fixed it for me.
Comment 2 kolAflash 2020-11-10 03:06:43 UTC
Same problem here on all my computers running Debian 11/Testing. (currently two computers)

Operating System: Linux 5.9.0-1-amd64 x86_64
Distribution: Debian-11 bullseye/testing


Pierce workaround works great!

wget 'https://snapshot.debian.org/archive/debian/20201030T214408Z/pool/main/k/kdecoration/libkdecorations2-5v5_5.17.5-2_amd64.deb'

wget 'https://snapshot.debian.org/archive/debian/20201030T214408Z/pool/main/libk/libkscreen/libkf5screen-bin_5.17.5-3_amd64.deb'

wget 'https://snapshot.debian.org/archive/debian/20201030T214408Z/pool/main/libk/libkscreen/libkf5screen7_5.17.5-3_amd64.deb'

sudo dpkg -i ./libk*.deb

kwin_x11 --replace  # or reboot / re-login
Comment 3 Dario 2020-11-10 13:16:11 UTC
Same problem here (Debian Testing, same as the others). Thanks kolAflash for adding a copyandpaste-able solution!
Comment 4 Vlad Zahorodnii 2020-11-10 13:33:51 UTC
(In reply to Pierce from comment #1)
> The bug appears to be caused by libkdecorations2-5v5, libkf5screen-bin,
> and/or libkf5screen7 when they are upgraded to versions 4:5.19.5-3,
> 4:5.19.5-3, and 4:5.19.5-3, respectively. Downgrading libkdecorations2-5v5
> to 4:5.17.5-2, libkf5screen-bin to 4:5.17.5-3, and libkf5screen7 to
> 4:5.17.5-3 fixed it for me.

You cannot use kwin 5.17 with kdecorations 5.19. Both must have the same version.
Comment 5 Pierce 2020-11-10 13:57:44 UTC
(In reply to Vlad Zahorodnii from comment #4)
> (In reply to Pierce from comment #1)
> > The bug appears to be caused by libkdecorations2-5v5, libkf5screen-bin,
> > and/or libkf5screen7 when they are upgraded to versions 4:5.19.5-3,
> > 4:5.19.5-3, and 4:5.19.5-3, respectively. Downgrading libkdecorations2-5v5
> > to 4:5.17.5-2, libkf5screen-bin to 4:5.17.5-3, and libkf5screen7 to
> > 4:5.17.5-3 fixed it for me.
> 
> You cannot use kwin 5.17 with kdecorations 5.19. Both must have the same
> version.

Nice catch! As of right now, Debian Testing has kwin-x11 at version 5.17, but the three kdecorations packages were bumped to version 5.19. Unstable has kwin-x11 at 5.19.
Comment 6 vmpn 2020-11-10 17:53:08 UTC
(In reply to kolAflash from comment #2)
> Same problem here on all my computers running Debian 11/Testing. (currently
> two computers)
> 
> Operating System: Linux 5.9.0-1-amd64 x86_64
> Distribution: Debian-11 bullseye/testing
> 
> 
> Pierce workaround works great!
> 
> wget
> 'https://snapshot.debian.org/archive/debian/20201030T214408Z/pool/main/k/
> kdecoration/libkdecorations2-5v5_5.17.5-2_amd64.deb'
> 
> wget
> 'https://snapshot.debian.org/archive/debian/20201030T214408Z/pool/main/libk/
> libkscreen/libkf5screen-bin_5.17.5-3_amd64.deb'
> 
> wget
> 'https://snapshot.debian.org/archive/debian/20201030T214408Z/pool/main/libk/
> libkscreen/libkf5screen7_5.17.5-3_amd64.deb'
> 
> sudo dpkg -i ./libk*.deb
> 
> kwin_x11 --replace  # or reboot / re-login

I can confirm that above steps resolves the crashes.  Thank you very much
Comment 7 Dario 2020-11-10 18:12:17 UTC
This bug in Debian Testing (bullseye) is tracked here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=974112
Comment 8 Vlad Zahorodnii 2020-11-11 14:57:00 UTC
*** Bug 428975 has been marked as a duplicate of this bug. ***
Comment 9 Vlad Zahorodnii 2020-11-11 15:04:52 UTC
*** Bug 428937 has been marked as a duplicate of this bug. ***
Comment 10 Vlad Zahorodnii 2020-11-11 15:05:29 UTC
*** Bug 428936 has been marked as a duplicate of this bug. ***
Comment 11 Christoph Feck 2020-11-11 21:51:45 UTC
*** Bug 428907 has been marked as a duplicate of this bug. ***
Comment 12 Nate Graham 2020-11-11 21:52:31 UTC
*** Bug 428966 has been marked as a duplicate of this bug. ***
Comment 13 Nate Graham 2020-11-11 21:52:36 UTC
*** Bug 428952 has been marked as a duplicate of this bug. ***
Comment 14 Nate Graham 2020-11-11 21:52:44 UTC
*** Bug 428920 has been marked as a duplicate of this bug. ***