Bug 366421

Summary: kwin_x11: QXcbConnection: XCB error: 9
Product: [Frameworks and Libraries] frameworks-kwindowsystem Reporter: Gerald Cox <gbcox>
Component: generalAssignee: Martin Flöser <mgraesslin>
Status: RESOLVED UPSTREAM    
Severity: normal CC: kdelibs-bugs, MeSat, rdieter, zawertun
Priority: NOR    
Version: 5.24.0   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description Gerald Cox 2016-08-04 19:29:42 UTC
I'm getting tons of these messages in my log file:

kwin_x11: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 50548, resource id: 0, major code: 14 (GetGeometry), minor code: 0

AFAIK everything appears to be working correctly, with the exception of my logfile filling up with these errors.  Is this an issue where some kind of debugging hasn't been turned off, or is this a real issue that needs attention.


Reproducible: Always

Steps to Reproduce:
Not doing anything in particular that I know of.... just my log is just getting these messages repeating over and over and over again.

Actual Results:  
Not doing anything in particular that I know of.... just my log is just getting these messages repeating over and over and over again.

Expected Results:  
If not an error, shouldn't be any messages.
Comment 1 Rex Dieter 2016-08-04 21:15:27 UTC
I suspect this is coming from Qt
Comment 2 Rex Dieter 2016-08-04 22:22:14 UTC
Confirmed,

qtbase-opensource-src-5.6.1/src/plugins/platforms/xcbqxcbconnection.cpp:    
qWarning("QXcbConnection: XCB error: %d (%s), sequence: %d, resource id: %d, major code: %d (%s), minor code: %d",

Now, whether it's worth treating the symptom (hide the warning), or the disease (the cause for the warning)?
Comment 3 Martin Flöser 2016-08-05 05:48:37 UTC
> Now, whether it's worth treating the symptom (hide the warning), or the disease (the cause for the warning)?

We can only treat the symptom. We don't know where the GetGeometry call fails (multiple locations in KWin) and the event does not tell us either. KWin always uses the calls which report errors on the event loop as all calls are allowed to fail. From KWin side it can always happen that a call fails: that's just in the nature of a window manager. If KWin processes events when the window got destroyed, calls like GetGeometry will fail (as the window is gone). We had looked into this once and concluded that trying to not get the errors (e.g. grab server) will result in much worse situations than just having the calls fail.

The correct thing to do would be introduce categorized logging in Qt's xcb plugin, so that the warnings can be filtered out.
Comment 4 Rex Dieter 2016-08-05 13:21:49 UTC
Per comment #3, filed
https://bugreports.qt.io/browse/QTBUG-55167
requesting support for categorized logging be added here.
Comment 5 Robin Laing 2019-02-09 23:58:30 UTC
Don't know if this will help or not but I found that I can generate as many error messages as I like by just moving my mouse between two different indicators on the task manager on my KDE desktop.

qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 37284, resource id: 69206033, major code: 141 (Unknown), minor code: 3
qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 37303, resource id: 79691782, major code: 141 (Unknown), minor code: 3
qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 37321, resource id: 69206033, major code: 141 (Unknown), minor code: 3
qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 37332, resource id: 79691782, major code: 141 (Unknown), minor code: 3

The sequence number changes but the resource id remains the same between each application displayed.  Still happening in the current plasma on Fedora 29.