[Touchpad KCM] Fix kded crashing at startup
ClosedPublic

Authored by atulbi on May 18 2019, 9:29 PM.

Details

Summary

When XcbAtom::atom() is called (by kded on key press other than Kded Keyboard shortcuts), m_connection seems to be having null or 0x0 value.
Small check on m_connection solves the issue for me.

BUG: 407614

Test Plan

kded5 do not crashed at startup.

Diff Detail

Repository
R119 Plasma Desktop
Branch
Plasma/5.16
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 11958
Build 11976: arc lint + arc unit
atulbi created this revision.May 18 2019, 9:29 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMay 18 2019, 9:29 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
atulbi requested review of this revision.May 18 2019, 9:29 PM
atulbi edited the summary of this revision. (Show Details)May 18 2019, 9:52 PM
davidedmundson requested changes to this revision.May 18 2019, 10:03 PM
davidedmundson added a subscriber: davidedmundson.

m_connection seems to be having null or 0x0 value.

Which means we're calling XcbAtom::atom after being constructed from the default constructor not the proper one.

That doesn't sound right. If you can explain why we end up in this situation and it's legit, I'll accept, otherwise it looks like we're just treating a symptom.

This revision now requires changes to proceed.May 18 2019, 10:03 PM

I believe we don't call the XcbAtom::intern function in the X libinput backend, what we do in the evdev/synaptics constructor part. Question is if we just don't want to not send the relevant call on keypress after all in X libinput. Because libinput does the disable-on-keyboard thing internally and we don't need to send anything like we did before.

by kded on key press other than Kded Keyboard shortcuts

Do you mean it's sent on shortcut or not? Just wondering why I couldn't replicate the issue in my testing.

m_connection seems to be having null or 0x0 value.

Which means we're calling XcbAtom::atom after being constructed from the default constructor not the proper one.

That doesn't sound right. If you can explain why we end up in this situation and it's legit, I'll accept, otherwise it looks like we're just treating a symptom.

As Roman pointed out, X Libinput backend do not call XcbAtom::intern for m_touchpadOffAtom. Rightly said we're just treating a symptom.

by kded on key press other than Kded Keyboard shortcuts

Do you mean it's sent on shortcut or not? Just wondering why I couldn't replicate the issue in my testing.

kded5 did not crash until I pressed some key which is not Kded Keyboard shortcuts. Like Ctrl+Alt+T did not crash it, but just pressing any other key crashed it.
Sending patch for it in a while.

atulbi updated this revision to Diff 58319.May 19 2019, 7:29 PM
  • Now we have separate m_touchpadOffAtom for synaptics and Libinput. On Libinput, used m_enabled prop.
  • setTouchpadOff will be ignored on X Libinput.

Codewise looks fine. Good adaption in comparison to first revision! Question remains if we want to further disconnect/deactivate the applet functionality in case libinput is used. We don't need to watch the keyboard presses at all. Same holds for the Wayland case, where we wouldn't even need the kcminit at all (T6084).

Anyways, we can do small steps. This looks good already. Let's wait for some feedback from bug report and I would be happy with current revision.

kcms/touchpad/src/backends/x11/xlibtouchpad.h
63

Q_UNUSED

romangg accepted this revision.May 20 2019, 8:55 AM

Feedback positive in bug report.

fvogt added a subscriber: fvogt.May 20 2019, 9:44 AM
This revision was not accepted when it landed; it landed in state Needs Review.May 20 2019, 9:47 AM
This revision was automatically updated to reflect the committed changes.