Frequent KWin crashes on switching TTYs

I get frequent TTYs crashes when I switch TTYs.

Crash report is here -

Application: KWin (kwin_x11), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f3135344140 (LWP 3308))]


Thread 5 (Thread 0x7f3131467700 (LWP 14527)):
#0  0x00007f313a49cba6 in ppoll () from /lib64/libc.so.6
#1  0x00007f3139001c41 in qt_safe_poll(pollfd*, unsigned long, timespec const*) () from /usr/lib64/libQt5Core.so.5
#2  0x00007f31390030b9 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#3  0x00007f3138fb04fb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#4  0x00007f3138dfa396 in QThread::exec() () from /usr/lib64/libQt5Core.so.5
#5  0x00007f3138dfb6e2 in ?? () from /usr/lib64/libQt5Core.so.5
#6  0x00007f31383ddfab in start_thread () from /lib64/libpthread.so.0
#7  0x00007f313a4a766f in clone () from /lib64/libc.so.6


Thread 4 (Thread 0x7f31177fe700 (LWP 3392)):
#0  0x00007f31383e3fdc in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f31388e709a in ?? () from /usr/lib64/libQt5Script.so.5
#2  0x00007f31388e70bb in ?? () from /usr/lib64/libQt5Script.so.5
#3  0x00007f31383ddfab in start_thread () from /lib64/libpthread.so.0
#4  0x00007f313a4a766f in clone () from /lib64/libc.so.6


Thread 3 (Thread 0x7f31309c0700 (LWP 3377)):
#0  0x00007f313a49cba6 in ppoll () from /lib64/libc.so.6
#1  0x00007f3139001c41 in qt_safe_poll(pollfd*, unsigned long, timespec const*) () from /usr/lib64/libQt5Core.so.5
#2  0x00007f31390030b9 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#3  0x00007f3138fb04fb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#4  0x00007f3138dfa396 in QThread::exec() () from /usr/lib64/libQt5Core.so.5
#5  0x00007f3137b8cf25 in ?? () from /usr/lib64/libQt5Qml.so.5
#6  0x00007f3138dfb6e2 in ?? () from /usr/lib64/libQt5Core.so.5
#7  0x00007f31383ddfab in start_thread () from /lib64/libpthread.so.0
#8  0x00007f313a4a766f in clone () from /lib64/libc.so.6


Thread 2 (Thread 0x7f3132728700 (LWP 3348)):
#0  0x00007f313a49cba6 in ppoll () from /lib64/libc.so.6
#1  0x00007f3139001c41 in qt_safe_poll(pollfd*, unsigned long, timespec const*) () from /usr/lib64/libQt5Core.so.5
#2  0x00007f31390030b9 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#3  0x00007f3138fb04fb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#4  0x00007f3138dfa396 in QThread::exec() () from /usr/lib64/libQt5Core.so.5
#5  0x00007f31375ec565 in ?? () from /usr/lib64/libQt5DBus.so.5
#6  0x00007f3138dfb6e2 in ?? () from /usr/lib64/libQt5Core.so.5
#7  0x00007f31383ddfab in start_thread () from /lib64/libpthread.so.0
#8  0x00007f313a4a766f in clone () from /lib64/libc.so.6


Thread 1 (Thread 0x7f3135344140 (LWP 3308)):
[KCrash Handler]
#6  0x00007f3138af3081 in ?? () from /usr/lib64/libkwin4_effect_builtins.so.1
#7  0x00007f3138af3144 in ?? () from /usr/lib64/libkwin4_effect_builtins.so.1
#8  0x00007f3138af46b5 in ?? () from /usr/lib64/libkwin4_effect_builtins.so.1
#9  0x00007f3138af5093 in ?? () from /usr/lib64/libkwin4_effect_builtins.so.1
#10 0x00007f313a21a723 in KWin::EffectsHandlerImpl::drawWindow(KWin::EffectWindow*, int, QRegion, KWin::WindowPaintData&) () from /usr/lib64/libkwin.so.5
#11 0x00007f3138a66a49 in ?? () from /usr/lib64/libkwin4_effect_builtins.so.1
#12 0x00007f313a21a723 in KWin::EffectsHandlerImpl::drawWindow(KWin::EffectWindow*, int, QRegion, KWin::WindowPaintData&) () from /usr/lib64/libkwin.so.5
#13 0x00007f3138b57cbc in KWin::Effect::drawWindow(KWin::EffectWindow*, int, QRegion, KWin::WindowPaintData&) () from /usr/lib64/libkwineffects.so.12
#14 0x00007f313a21a723 in KWin::EffectsHandlerImpl::drawWindow(KWin::EffectWindow*, int, QRegion, KWin::WindowPaintData&) () from /usr/lib64/libkwin.so.5
#15 0x00007f313a2054dc in KWin::Scene::finalPaintWindow(KWin::EffectWindowImpl*, int, QRegion, KWin::WindowPaintData&) () from /usr/lib64/libkwin.so.5
#16 0x00007f313a21a5bb in KWin::EffectsHandlerImpl::paintWindow(KWin::EffectWindow*, int, QRegion, KWin::WindowPaintData&) () from /usr/lib64/libkwin.so.5
#17 0x00007f3138b57b4c in KWin::Effect::paintWindow(KWin::EffectWindow*, int, QRegion, KWin::WindowPaintData&) () from /usr/lib64/libkwineffects.so.12
#18 0x00007f313a21a563 in KWin::EffectsHandlerImpl::paintWindow(KWin::EffectWindow*, int, QRegion, KWin::WindowPaintData&) () from /usr/lib64/libkwin.so.5
#19 0x00007f3138b57b4c in KWin::Effect::paintWindow(KWin::EffectWindow*, int, QRegion, KWin::WindowPaintData&) () from /usr/lib64/libkwineffects.so.12
#20 0x00007f313a21a563 in KWin::EffectsHandlerImpl::paintWindow(KWin::EffectWindow*, int, QRegion, KWin::WindowPaintData&) () from /usr/lib64/libkwin.so.5
#21 0x00007f3138b6043b in KWin::AnimationEffect::paintWindow(KWin::EffectWindow*, int, QRegion, KWin::WindowPaintData&) () from /usr/lib64/libkwineffects.so.12
#22 0x00007f313a21a563 in KWin::EffectsHandlerImpl::paintWindow(KWin::EffectWindow*, int, QRegion, KWin::WindowPaintData&) () from /usr/lib64/libkwin.so.5
#23 0x00007f313a20b9b1 in KWin::Scene::paintWindow(KWin::Scene::Window*, int, QRegion, KWin::WindowQuadList) () from /usr/lib64/libkwin.so.5
#24 0x00007f313a208367 in KWin::Scene::paintSimpleScreen(int, QRegion) () from /usr/lib64/libkwin.so.5
#25 0x00007f31301a8302 in ?? () from /usr/lib64/qt5/plugins/org.kde.kwin.scenes/KWinSceneOpenGL.so
#26 0x00007f313a20aee0 in KWin::Scene::finalPaintScreen(int, QRegion, KWin::ScreenPaintData&) () from /usr/lib64/libkwin.so.5
#27 0x00007f313a21a315 in KWin::EffectsHandlerImpl::paintScreen(int, QRegion, KWin::ScreenPaintData&) () from /usr/lib64/libkwin.so.5
#28 0x00007f3138b57aa1 in KWin::Effect::paintScreen(int, QRegion, KWin::ScreenPaintData&) () from /usr/lib64/libkwineffects.so.12
#29 0x00007f313a21a2bd in KWin::EffectsHandlerImpl::paintScreen(int, QRegion, KWin::ScreenPaintData&) () from /usr/lib64/libkwin.so.5
#30 0x00007f3138b57aa1 in KWin::Effect::paintScreen(int, QRegion, KWin::ScreenPaintData&) () from /usr/lib64/libkwineffects.so.12
#31 0x00007f313a21a2bd in KWin::EffectsHandlerImpl::paintScreen(int, QRegion, KWin::ScreenPaintData&) () from /usr/lib64/libkwin.so.5
#32 0x00007f3138b57aa1 in KWin::Effect::paintScreen(int, QRegion, KWin::ScreenPaintData&) () from /usr/lib64/libkwineffects.so.12
#33 0x00007f313a21a2bd in KWin::EffectsHandlerImpl::paintScreen(int, QRegion, KWin::ScreenPaintData&) () from /usr/lib64/libkwin.so.5
#34 0x00007f313a20ab8e in KWin::Scene::paintScreen(int*, QRegion const&, QRegion const&, QRegion*, QRegion*, QMatrix4x4 const&, QRect const&) () from /usr/lib64/libkwin.so.5
#35 0x00007f31301b0579 in KWin::SceneOpenGL::paint(QRegion, QList<KWin::Toplevel*>) () from /usr/lib64/qt5/plugins/org.kde.kwin.scenes/KWinSceneOpenGL.so
#36 0x00007f313a1fc91a in KWin::Compositor::performCompositing() () from /usr/lib64/libkwin.so.5
#37 0x00007f3138fdbcbb in QObject::event(QEvent*) () from /usr/lib64/libQt5Core.so.5
#38 0x00007f31399a5591 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#39 0x00007f31399acb30 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#40 0x00007f3138fb1829 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5
#41 0x00007f3139005053 in QTimerInfoList::activateTimers() () from /usr/lib64/libQt5Core.so.5
#42 0x00007f313900320c in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#43 0x00007f3133551b7e in ?? () from /usr/lib64/libQt5XcbQpa.so.5
#44 0x00007f3138fb04fb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#45 0x00007f3138fb8652 in QCoreApplication::exec() () from /usr/lib64/libQt5Core.so.5
#46 0x00007f313a57b4ab in kdemain () from /usr/lib64/libkdeinit5_kwin_x11.so
#47 0x00007f313a3cfb7b in __libc_start_main () from /lib64/libc.so.6
#48 0x0000560a4207d08a in _start ()
[Inferior 1 (process 3308) detached]



This often disables opengl and distorts KDE.

Can you explain what you mean by “switch TTYs”. I can think of more than one possible meaning, so it would be helpful if you could clarify.

Some more information would be useful.

What Tumbleweed snapshot are you running? You can check with:

cat /etc/os-release

How are you updating your system?

I am on latest Tumbleweed.

# cat /etc/os-release 
NAME="openSUSE Tumbleweed"
# VERSION="20190220"
ID="opensuse-tumbleweed"
ID_LIKE="opensuse suse"
VERSION_ID="20190220"
PRETTY_NAME="openSUSE Tumbleweed"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:tumbleweed:20190220"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"

I do zypper up & dup.

When I activate tty(2-6) with ALT+CTL+F(n) and go back to tty7 I experience this crash all the time. I can provide a complete crash report but the KDE thing says I need pbuildid for collecting debug info but there is no such package or I can’t find it.

Best to use “zypper dup”. Otherwise you can get incomplete updates. Your problem is the kind of thing that can happen with incomplete updates.

I have not seen this problem. But let’s look at what might be different for your system.

I’m using GDM for logins. You may be using SDDM.
I usually run KDE with X11. Perhaps you are using Wayland. I don’t think I have tried switching ttys with KDE/Wayland.

Since last week I use zypper dup for updates. I am using SDDM with X11 -

(base)  
[Tue Feb 26 19:10:31 flux@flux ~] 
# loginctl
SESSION  UID USER SEAT  TTY
      2 1000 flux seat0     

1 sessions listed.
(base)  
[Tue Feb 26 19:10:34 flux@flux ~] 
# loginctl show-session 2 -p Type
Type=x11
(base)  
[Tue Feb 26 19:11:01 flux@flux ~] 
# 


Just as a test, I switched to using SDDM.

After rebooting, I logged in, then logged out again.

I then switched to tty1 (went okay)
Next I switched to tty2 – and my system rebooted.

However, that has not happened again. In several repeat tests, it is all working fine. I should probably mention that my testing was in a KVM virtual machine.

Could it be graphics related? What kind of graphics card to you have?

Yeah, I witnessed the reboot when I switched to tty2 post install. I am using NVIDIA gpu but have witnessed this behavior on stock Intel HD Graphics too.

Only Intel graphics here. And I have not been able to get the problem to repeat.

If these failures are repeatable for you, then maybe open a bug report.

I get this too. If I switch to text then back to graphical, generally kwin crashes and restarts. Using latest TW + latest nvidia driver + GTX 1060 6GB. Kwin restarts fine, and I rarely switch to text anyway, but yeah it crashes a lot when switching back to gui. I don’t know if it’s affecting my opengl, but I’m not seeing any “kde distortions” (per first post).

Specifically, I get a black screen for about 10 seconds, and then a pop-up notification that says “KWin closed unexpectedly” and “Desktop effects were restarted due to a graphics reset”.

Have you tried to simply delete the configuration files, among the hidden files?

Today when I switched from text console back to KDE, I encountered the graphics corruption on the KDE panel that someone else was talking about. I logged out and back in to recover (ie didn’t reboot).

Is there a way to kill and restart the KDE launcher panel? What are the magic commands?

Could try restarting plasmashell

Alt-F2 then in the “search” box

kquitapp5 plasmashell && kstart5 plasmashell

and hit the “return” key.

Works a treat! Thanks!

Interestingly, or more correctly annoyingly, I’ve been experiencing a very similar (kwin crashes and is restarted upon switching back to a graphics screen) problem on leap 15.0 with proprietary nvidia driver. The same hardware worked flawlessly with 42.3.

Googling around it seems this is quite a common problem, with possibly multiple causes and in some cases solutions.

The (KDE/KWin) developers don’t seem particularly interested now as their efforts are on Wayland, KWin effectively being frozen, even for bugs.

This particular problem is generally put down to a bug in the proprietary driver: “As Martin [Flöser] said in 385324, you need to report to your driver vendor that the driver triggers the graphics reset.” is a typical response, (from 401410 – KWin constantly restarts)

In my own case it can be avoided by first logging out from KDE before switching to a VT, albeit is does add a few seconds, but avoids KWin crashing/restarting.