[Development] [xcb/xsettings] https://codereview.qt-project.org/81808 segfaults in CI

Egbert Eich eich at suse.de
Mon Mar 31 14:19:03 CEST 2014


Jørgen, thanks for reviewing my patch!

Unfortunately adding endian support to the xsettings client functions in
the xcb platform plugin has caused some unforseen crashes in the Ci test
suite.
I've been able to build the tests in question but I have not been able to
reproduce the crash.
The reason for this is simple: If the troublesome code path leading to
QXcbXSettings::QXcbXSettings() is taken at all depends on the detailed setup 
of the system (like if and how certain X resources and environment variables 
are set and if libXcursor is installed).
Even then it depends on what is providing the Xsettings:
I've tested with 'lxsession-xsettings' from LXDE where I didn't see any 
crashes, instead my patch fixed crashes I was seeing with a Qt client 
running on BE and the xesttings provider running on LE.

'lxsession-xsettings' uses the code to handle the Xsettings which is also
used by xsettings-kde or the gnome-settings-daemon. This code was originally 
written by Owen Taylor, the author if the xsettings proposal on fd.o:
http://standards.freedesktop.org/xsettings-spec/xsettings-spec-0.5.html
Unfortunately the standard proposal only describes the location where the 
endianess is specified however it leaves out the convention used.
In his code Owen uses the same convention of of X.h (from Xlib) which has:
#define LSBFist  0
#define MSBFirst 1
(Check https://projects.kde.org/projects/playground/base/xsettings-kde/repository/revisions/c7335d532d717e2a15b54834f64976e9fd9ffd3f/entry/xsettings-manager.c and 
https://projects.kde.org/projects/playground/base/xsettings-kde/repository/revisions/c7335d532d717e2a15b54834f64976e9fd9ffd3f/entry/xsettings-common.c)

It's possible that the xsettings provider running on the Ci test system 
uses a different convention. 
Unfortunately the setup of the Ci test suite is not defined well enough: 
qtbase/tests/README only talks about a "KDE 3 or KDE 4 desktop" which doesn't 
really help here.
As a first remedy to the crash I have 
1. Added a test if ByteOrder contains anything else but 0 and 1 and if so
   issue a QWarning and bail.
2. Add length checks if we run past the end of the xSettings data.

Still it would be good to know what Xsettings 'provider' (ie. daemon)
the Qt Ci test suite is using to make sure the same convetions are used
everywhere (even though they are missing in the spec).

Cheers,
	Egbert.





More information about the Development mailing list