Review Request 122019: Fix crash in KGlobalAccel X11 runtime shutdown

David Edmundson david at davidedmundson.co.uk
Tue Jan 13 08:08:18 UTC 2015



> On Jan. 12, 2015, 3:54 p.m., Martin Gräßlin wrote:
> > src/runtime/kglobalaccel_x11.cpp, line 86
> > <https://git.reviewboard.kde.org/r/122019/diff/1/?file=341433#file341433line86>
> >
> >     somehow I don't like this guard due to QX11Info::connection() not being a valid connection any more if the connection is broken.
> >     
> >     I'm wondering whether there are other ways - I expect that Qt quits due to an XIO error? Maybe we could install a handler for it?
> 
> David Edmundson wrote:
>     the point of xcb_connection_has_error is to check if it is broken.
>     "Test whether the connection has shut down due to a fatal error."
>     
>     
>     I don't see how a handler helps much, all we would be able to do in that situation is quit the app which is exactly what we're doing anyway.
> 
> Martin Gräßlin wrote:
>     my concern is rather that QX11Info::connection isn't providing sane information any more. E.g. it could be nullptr. At least that's what I would expect it to return if the X connection broke.

I can make it (!QX11Info::connection() || xcb_conn....) if you prefer?


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/122019/#review73872
-----------------------------------------------------------


On Jan. 12, 2015, 3:26 p.m., David Edmundson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/122019/
> -----------------------------------------------------------
> 
> (Updated Jan. 12, 2015, 3:26 p.m.)
> 
> 
> Review request for KDE Frameworks.
> 
> 
> Repository: kglobalaccel
> 
> 
> Description
> -------
> 
> As kglobalaccel is no longer a kdeinit executable it is not killed
> gracefully in shutdown, when a user logs out it will be killed as the X
> connection is removed.
> 
> GlobalShortcutsRegistry on deletion calls grabKey(key, false) to remove
> any remaining grabs, since the X connection has gone any XCB results in
> a crash.
> 
> This patch adds a guard around that.
> 
> 
> Diffs
> -----
> 
>   src/runtime/kglobalaccel_x11.cpp dfb03b5 
> 
> Diff: https://git.reviewboard.kde.org/r/122019/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> David Edmundson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20150113/0ac86e0a/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list