Qt/KDE problems with MIT-SHM when Xorg is not running as root

Martin Gräßlin mgraesslin at kde.org
Thu Jan 29 01:33:58 PST 2015


On Thursday 29 January 2015 10:20:41 Hans de Goede wrote:
> Hi All,
> 
> A Fedora user has reported problems with MIT-SHM when the xserver
> is not running as root. Normal use works fine, but when doing a
> "su -" and then starting X apps as root MIT-SHM fails, see this
> screenshot:
> 
> https://bugzilla.redhat.com/attachment.cgi?id=977933
> 
> The culprit is this error:
> "Xerror: BadAccess (Attempt to access private resources denied)"
> 
> Which makes sense, the shm segment is created by the app running
> as root, and the Xserver which is running as a normal user thus
> cannot access it, so far this has never been a problem because
> X was always running as root :)
> 
> I'm tempted to call this a feature rather then a bug, and declaring
> this a Qt/KDE bug. I've written MIT SHM using X11 code in the past,
> and always installed an error handler, and did an XSync after the
> attach to check if the xshm-attach succeed, as it will also fail
> when running over the network. I guess qt/kde is using some other
> heuristic to determine if it is not running over a network, and
> assumes that things will just work when not running over the
> network, rather then doing "proper" error checking here.
> 
> So to me it seems that Qt/KDE should do "proper" error checking
> here and simply fallback to a non shm path in this special case.

thanks for letting me know. Sharing my personal opinion on it:
first of all I consider it an out-of-scope if one runs kcalc as root ;-) That 
basically applies to all KDE applications - I do not think we support running 
them on root. So breakage here is for me a feature and not a bug.

Otherwise it's important to know which application version that is. Whether 
it's Qt 4 or Qt 5. The complete interaction with X11 got rewritten for Qt 5 
from scratch using XCB. From studying the code in the past I know the xshm 
related code supports fallback to non-shm paths. I assume that kcalc is still 
a Qt 4 based application in Fedora. If this problem is solved in Qt 5 I guess 
nobody would care any more about it.

Regards,
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.x.org/archives/xorg-devel/attachments/20150129/ac33da80/attachment.sig>


More information about the xorg-devel mailing list