Bug 386370 - kwin randomly crashes when switching desktops
Summary: kwin randomly crashes when switching desktops
Status: RESOLVED DOWNSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-30 23:21 UTC by Jesse
Modified: 2018-06-12 19:29 UTC (History)
4 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 Jesse 2017-10-30 23:21:30 UTC
Sometimes, when I switch desktops, the kwin crashes with the following error:

The X11 connection broke: No error (code 0)
XIO:  fatal IO error 17 (File exists) on X server ":0"
      after 1186801 requests (1186801 known processed) with 0 events remaining.
QObject::~QObject: Timers cannot be stopped from another thread


Then, I have to press Alt + F2 and run 'kwin --replace' to get it working again. I haven't been able to notice the exact reason of the crash; it's seems to be just random. Sometimes if I keep switching repetitively, it crashes on the 10th time; others, crashes on the first.

This leads me to think that this is related to the graphic card. I have a NVIDIA GTX 970 with proprietary drivers, and I'm running Archlinux with plasma 5.11.2.

I have tried in a brand new user, so it shouldn't be related related to my config.
Comment 1 Martin Flöser 2017-10-31 08:53:57 UTC
Please provide backtrace of the crash. Without we cannot investigate at all.
Comment 2 Jesse 2017-10-31 13:45:56 UTC
How can I do that in this case? When it crashes, it doesn't popup that usual error dialog.
Comment 3 malek.ric 2017-11-13 16:26:26 UTC
How about this?

QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined
QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined
QXcbConnection: XCB error: 3 (BadWindow), sequence: 10887, resource id: 98599225, major code: 15 (QueryTree), minor code: 0
QXcbConnection: XCB error: 3 (BadWindow), sequence: 14585, resource id: 98573266, major code: 15 (QueryTree), minor code: 0
QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined
QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined
QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined
The X11 connection broke: No error (code 0)
XIO:  fatal IO error 0 (Success) on X server ":0"
      after 2970130 requests (2970130 known processed) with 0 events remaining.
QObject::~QObject: Timers cannot be stopped from another thread
QThread::wait: Thread tried to wait on itself
Comment 4 Martin Flöser 2017-11-13 16:39:00 UTC
sorry, but that's nothing in addition to what you provided in the initial comment.
Comment 5 malek.ric 2017-11-13 22:17:02 UTC
Sorry, I did not notice the first comment. I am just facing the same bug as Mr. Jesse. And guys here too: https://bbs.archlinux.org/viewtopic.php?id=231042.

I will try to search a way how to provide a kwin backtrace.
Comment 6 Eevee 2017-11-20 04:39:08 UTC
I'm having the same problem — quite frequently! — and I don't think kwin is crashing at all.  It seems to be cleanly exiting, hence the lack of a backtrace or error dialog or automatic restarting.  At the moment I'm running it in a shell loop, which is...  not ideal.

I'm also on Arch with the nvidia blob, using 5.11.3, and had no problems before upgrading from 5.10.5.

The Arch forum thread suggests it's fixed in 5.11.4, but doesn't clarify further.  I don't see any recent commits that /sound/ relevant, but I only know so much about WM internals.  :)
Comment 7 Eevee 2017-12-25 13:08:25 UTC
This is definitely still happening with 5.11.4 and the latest nvidia blob.

Again, there is no backtrace; kwin is exiting cleanly.
Comment 8 Christoph Feck 2018-01-10 20:40:19 UTC
KWin is not exiting cleanly, it aborts because the X connection broke. This is usually caused by a faulty X driver causing a crash of the X server. Please looks for someone who is able to debug X server crashes.
Comment 9 Eevee 2018-01-10 20:58:29 UTC
I'm pretty sure I'd notice if X were crashing.

See also bug 388127, which has a workaround.
Comment 10 Emil Jacobs 2018-03-16 11:29:08 UTC
I'd like to confirm this bug in an updated instance of Fedora 27. The bug is intermittent and therefore not easily reproducible. Workaround so far is to not use virtual desktops...

If logging is required, please request specific logging as I'm not a developer and can't easily judge what is and isn't relevant.
Comment 11 Martin Flöser 2018-03-16 15:12:28 UTC
Resetting the state. The issue is not in our code, but most likely in the driver. This is based on the information we have in this bug report. Just reopening doesn't change the fact of the information presented here. If you have new information which would indicate differently, then please present the information. But do not reopen the bug, we will do so if the information point to a bug in KWin. This is not a bug tracker for all issues in the stack, but only for KWin.