Bug 353587 - deadlock in QXcbConnection::xi2SetupDevices
Summary: deadlock in QXcbConnection::xi2SetupDevices
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.4.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-06 04:52 UTC by SinClaus
Modified: 2016-03-29 21:14 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SinClaus 2015-10-06 04:52:24 UTC
Plasma hangs always if comp is on more then 24 hours.
At the morning I see black screen with live mouse pointer. I can switch to other VT by Ctrl-Alt-Fn.
Shift-Alt-F12 don't show any effect.
kwin_x11 process is in a "Sl" state.
Backtrace from this state:
#0  0x00007f05e47df07f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x00007f05e02336ed in _XReply () from /usr/lib/libX11.so.6
#2  0x00007f05e02360d1 in ?? () from /usr/lib/libX11.so.6
#3  0x00007f05e0235891 in _XError () from /usr/lib/libX11.so.6
#4  0x00007f05e02327c7 in ?? () from /usr/lib/libX11.so.6
#5  0x00007f05e0232885 in ?? () from /usr/lib/libX11.so.6
#6  0x00007f05e02337c5 in _XReply () from /usr/lib/libX11.so.6
#7  0x00007f05ce9925cf in XIQueryDevice () from /usr/lib/libXi.so.6
#8  0x00007f05cbc39bbb in QXcbConnection::xi2SetupDevices() () from /usr/lib/libQt5XcbQpa.so.5
#9  0x00007f05cbc3cee8 in QXcbConnection::xi2HandleHierachyEvent(void*) () from /usr/lib/libQt5XcbQpa.so.5
#10 0x00007f05cbc3d217 in QXcbConnection::xi2HandleEvent(xcb_ge_event_t*) () from /usr/lib/libQt5XcbQpa.so.5
#11 0x00007f05cbc15e65 in QXcbConnection::handleXcbEvent(xcb_generic_event_t*) () from /usr/lib/libQt5XcbQpa.so.5
#12 0x00007f05cbc16303 in QXcbConnection::processXcbEvents() () from /usr/lib/libQt5XcbQpa.so.5
#13 0x00007f05e24b8eb1 in QObject::event(QEvent*) () from /usr/lib/libQt5Core.so.5
#14 0x00007f05e31c300c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#15 0x00007f05e31c84e6 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#16 0x00007f05e248989b in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#17 0x00007f05e248bc96 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQt5Core.so.5
#18 0x00007f05e24dd7c2 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#19 0x00007f05cbc7835d in ?? () from /usr/lib/libQt5XcbQpa.so.5
#20 0x00007f05e248726a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#21 0x00007f05e248f20c in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#22 0x00007f05e49f473b in kdemain () from /usr/lib/libkdeinit5_kwin_x11.so
#23 0x00007f05e444e610 in __libc_start_main () from /usr/lib/libc.so.6
#24 0x00000000004007c9 in _start ()

System was working only one time: with unchecked option "Enable compositor on startup".

Reproducible: Always

Steps to Reproduce:
1. Simple install system (Arch) with plasma 5 (KDE) 
2.
3.
Comment 1 Thomas Lübking 2015-10-06 07:31:42 UTC
Thanks, this is a bug in Xlib, known also to Qt.

Since you claim you can prevent this by suspending the compositor, I could assume we cause an X error (what's not a bug per se, but can maybe avoided) in the compositor.

I'm frankly not sure whether Xlib stores to ~/.xsession-errors or journald, but it's printing to konsole if you run "kwin_x11 --replace &" from there ;-)

iow: if we can spot an X error caused by kwin compositing in this condition, we *may* be able to avoid the deadlocking condition.
Comment 2 SinClaus 2015-10-09 02:53:42 UTC
Hm.... kwin_x11 --replace answers "FATAL ERROR while trying to open display".
I'm running this from Vt2 on the local comp.
kwin_x11 is in a Sl state.
Comment 3 Thomas Lübking 2015-10-09 06:43:53 UTC
To interact with the X server from outside the X server you need to tell programs where to find it.

Just run
export DISPLAY=:0
Comment 4 SinClaus 2015-10-20 03:39:48 UTC
export DISPLAY=:0
and
kwin_x11 --replace

reanimane KDE session, but composer is dead or don't catch buttons pressing.
Comment 5 Thomas Lübking 2015-10-20 14:20:53 UTC
What do you mean by "don't catch buttons pressing"?

Either way, I assume kwin does not effectively restart, but only the running instance gets killed and you're left with an unmanged desktop (windows don't have decorations etc.)?