Review Request 126807: Ensure connection to exist before using

Xuetian Weng wengxt at gmail.com
Wed Jan 20 04:20:50 UTC 2016



> On Jan. 19, 2016, 6:35 p.m., Rajeesh K V wrote:
> > I must admit I don't understand the root cause or how m_connection could be null, but as this fixes the crash - ship it.
> 
> Andreas Cord-Landwehr wrote:
>     If I am not mistaken, the root cause is the following:
>     * XLibTouchpad has a member variable m_touchpadOffAtom
>     * this variable is created by the default constructor that sets the connection to 0
>     * no m_touchpadOffAtom.intern(...) call is performed to set the connection, so it remains 0
>     The question now for me is, what are the correct parameters for m_touchpadOffAtom.inter(...). On the one hand it should be m_connection, on the other hand I do not know what the parameter "name" should name. The correct position would be IMO plasma-desktop/kcms/touchpad/src/backends/x11/xlibtouchpad.cpp line 266 to make this call.
> 
> Rajeesh K V wrote:
>     Ok, I see the issue now.
>     The actual backends - libinput and synaptics sets their m_touchpadOffAtom with respective properties. The new class XlibTouchpad does not initialize its m_touchpadOffAtom in constructor. I'm not sure with what property it should be initialized with. Adding Weng Xeutian for more details.

If m_display is null, the m_device should be null thus it's not possible to reach the problematic code.
So I think the only possibility is XGetXCBConnection returns null. Maybe check m_connection somewhere makes more sense.


- Xuetian


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


On Jan. 19, 2016, 9:24 a.m., Andreas Cord-Landwehr wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/126807/
> -----------------------------------------------------------
> 
> (Updated Jan. 19, 2016, 9:24 a.m.)
> 
> 
> Review request for Plasma and Alexander Mezin.
> 
> 
> Bugs: 357907
>     https://bugs.kde.org/show_bug.cgi?id=357907
> 
> 
> Repository: plasma-desktop
> 
> 
> Description
> -------
> 
> This is an attempt to fix the crash reported at https://bugs.kde.org/show_bug.cgi?id=357907.
> Yet, I am neither familiar with the code nor with using XCB. So I cannot judge if this is only a workaround or a proper fix.
> 
> 
> Diffs
> -----
> 
>   kcms/touchpad/src/backends/x11/xcbatom.cpp 06f7f52 
> 
> Diff: https://git.reviewboard.kde.org/r/126807/diff/
> 
> 
> Testing
> -------
> 
> Solves the crashes for me.
> 
> 
> Thanks,
> 
> Andreas Cord-Landwehr
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20160120/c1ac6d4d/attachment.html>


More information about the Plasma-devel mailing list