Bug 397635 - [wayland] Crash right-clicking with simulated right click on touchpad crashes Latte plasmoid
Summary: [wayland] Crash right-clicking with simulated right click on touchpad crashes...
Status: RESOLVED FIXED
Alias: None
Product: lattedock
Classification: Plasma
Component: plasmoid (show other bugs)
Version: 0.8.0
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Michail Vourlakos
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-19 18:03 UTC by Sefa Eyeoglu
Modified: 2018-08-28 17:23 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 0.8.1


Attachments
Screenshot of ddd stacktrace (110.60 KB, image/png)
2018-08-24 10:18 UTC, Sefa Eyeoglu
Details
backtrace (3.46 KB, text/x-log)
2018-08-24 10:46 UTC, Sefa Eyeoglu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sefa Eyeoglu 2018-08-19 18:03:14 UTC
I am running Latte DOck on Wayland and if I tap with two fingers on any item in the dock, the dock crashes. This only happens on Wayland, when simulated right click is enabled in system settings. If I right-click normally it does not crash. Normal plasma panels also don't crash.
I can provide a stack trace later, as the Arch Linux packages do not generate stack traces.
Will test in KDE neon.
Comment 1 Sefa Eyeoglu 2018-08-19 19:31:04 UTC
I can't reproduce the bug on KDE neon. Seems like this has something to do with Arch.
Comment 2 Alexander Mentyu 2018-08-20 12:48:39 UTC
I was able to reproduce crash in neon, debug symbols was installed - but DrKonqi displays only segmentation fault instead of backtrace
Comment 3 Michail Vourlakos 2018-08-20 13:29:39 UTC
If you use a mouse and right click it doesnt crash?
Comment 4 Sefa Eyeoglu 2018-08-20 13:30:48 UTC
Normal right-click works.
Comment 5 Alexander Mentyu 2018-08-20 13:33:51 UTC
If clicking fast with only right click - eventually latte-dock crashes - also with segmentation fault
Comment 6 Sefa Eyeoglu 2018-08-20 14:20:53 UTC
It is very weird behaviour:

 - Start Latte Dock, tap with two fingers -> Crash

 - Start Latte Dock, right-click -> No Crash

 - Start Latte Dock, right-click, keep menu open, right click anything else on the dock -> Crash

 - Start Latte Dock, right-click, close the menu, tap with two fingers -> No Crash
Comment 7 Michail Vourlakos 2018-08-22 15:22:14 UTC
(In reply to Alexander Mentyu from comment #5)
> If clicking fast with only right click - eventually latte-dock crashes -
> also with segmentation fault

not in my system, I cant reproduce this, do you have any meaningful backtrace?
Comment 8 Michail Vourlakos 2018-08-23 22:32:28 UTC
(In reply to Sefa Eyeoglu from comment #6)
> It is very weird behaviour:
> 
>  - Start Latte Dock, tap with two fingers -> Crash
> 
>  - Start Latte Dock, right-click -> No Crash
> 
>  - Start Latte Dock, right-click, keep menu open, right click anything else
> on the dock -> Crash
> 
>  - Start Latte Dock, right-click, close the menu, tap with two fingers -> No
> Crash

how did you manage to configure touchpad for plasma wayland? in my system is disabled
Comment 9 Michail Vourlakos 2018-08-24 09:41:40 UTC
For meaningful backtraces you can use also: https://github.com/psifidotos/Latte-Dock/wiki/How-to-Report-Crashes
Comment 10 Sefa Eyeoglu 2018-08-24 09:48:16 UTC
I enabled click simulation in the touchpad settings in the system settings. Nothing special.
Comment 11 Michail Vourlakos 2018-08-24 09:56:29 UTC
(In reply to Sefa Eyeoglu from comment #10)
> I enabled click simulation in the touchpad settings in the system settings.
> Nothing special.

what plasma version are you using? In my TumbleWeed system all touchpad settings are disabled
Comment 12 Sefa Eyeoglu 2018-08-24 10:04:47 UTC
I have the latest stable release of all packages. 
KDE Plasma Version: 5.13.4
KDE Frameworks Version: 5.49.0
Qt Version: 5.11.1
Latte Dock Version: 0.8.0
Comment 13 Sefa Eyeoglu 2018-08-24 10:18:55 UTC
Created attachment 114574 [details]
Screenshot of ddd stacktrace

I used ddd to get a stack trace. It worked. But it uses a weird font :/
Comment 14 Michail Vourlakos 2018-08-24 10:31:26 UTC
(In reply to Sefa Eyeoglu from comment #13)
> Created attachment 114574 [details]
> Screenshot of ddd stacktrace
> 
> I used ddd to get a stack trace. It worked. But it uses a weird font :/

have you enabled window previews?
Comment 15 Sefa Eyeoglu 2018-08-24 10:34:02 UTC
Only for non-minimized windows
Comment 16 Sefa Eyeoglu 2018-08-24 10:46:15 UTC
Created attachment 114579 [details]
backtrace

I created the same backtrace with gdb. Probably more readable
Comment 17 Michail Vourlakos 2018-08-24 15:12:30 UTC
(In reply to Sefa Eyeoglu from comment #16)
> Created attachment 114579 [details]
> backtrace
> 
> I created the same backtrace with gdb. Probably more readable

the backtrace is full of Qt-related code and not any Latte but I will need to reproduce in my system in order to play with it...

one thing you could try is to check which right-click codepath produces this. clicking an applet in the dock with right click is different than clicking the Latte tasks plasmoid. Please try to add an applet in your dock and right click it, do you get the same results?
Comment 18 Sefa Eyeoglu 2018-08-24 15:26:52 UTC
(In reply to Michail Vourlakos from comment #17)
> (In reply to Sefa Eyeoglu from comment #16)
> > Created attachment 114579 [details]
> > backtrace
> > 
> > I created the same backtrace with gdb. Probably more readable
> 
> the backtrace is full of Qt-related code and not any Latte but I will need
> to reproduce in my system in order to play with it...
> 
> one thing you could try is to check which right-click codepath produces
> this. clicking an applet in the dock with right click is different than
> clicking the Latte tasks plasmoid. Please try to add an applet in your dock
> and right click it, do you get the same results?

If I (emulate) right click on an applet (I tried the Analog Clock) it does not crash. Very weird behavior.
Comment 19 Michail Vourlakos 2018-08-24 15:31:00 UTC
(In reply to Sefa Eyeoglu from comment #18)
> (In reply to Michail Vourlakos from comment #17)
> > (In reply to Sefa Eyeoglu from comment #16)
> If I (emulate) right click on an applet (I tried the Analog Clock) it does
> not crash. Very weird behavior.

not that much...
Latte taskmanager is creating its own ContextMenu instead
of using the default plasma containment codepath. It is how
plasma taskmanagers are also handling this. If I could reproduce
in my system then I could identify which qml code creates this.

My guess is that too much mouse events are sent almost instantly
and somewhere in that behavior something isnt prepared yet.
Comment 20 Michail Vourlakos 2018-08-24 15:32:20 UTC
have you tried the same thing for a plasma taskmanager in a plasma panel?
Comment 21 Sefa Eyeoglu 2018-08-24 15:40:20 UTC
(In reply to Michail Vourlakos from comment #20)
> have you tried the same thing for a plasma taskmanager in a plasma panel?

Yes. That onw works.
Comment 22 Michail Vourlakos 2018-08-28 16:41:21 UTC
Git commit afb34a85cf7c30eed343e51ceb1d1f73ba7a65a2 by Michail Vourlakos.
Committed on 28/08/2018 at 15:55.
Pushed by mvourlakos into branch 'master'.

dont crash plasmoid from too fast mouse events

make sure that we delete a valid contextMenu and
not a ghost reference. This could occur from
two-fingers emulating right-click in wayland.
FIXED-IN: 0.8.1

M  +3    -1    plasmoid/package/contents/ui/ContextMenu.qml
M  +5    -1    plasmoid/package/contents/ui/task/TaskDelegate.qml

https://commits.kde.org/latte-dock/afb34a85cf7c30eed343e51ceb1d1f73ba7a65a2
Comment 23 Michail Vourlakos 2018-08-28 16:41:21 UTC
Git commit b4dd016ed0d861e9c1676cbd6edb425edbe6c966 by Michail Vourlakos.
Committed on 28/08/2018 at 16:35.
Pushed by mvourlakos into branch 'master'.

delay hiding previews when creating contextmenu

-- there are cases that hiding previews too early
can create crashes under wayland. Such a case is
when the user uses the touchpad to emulate a right-click
event to create a context menu for specific task
FIXED-IN: 0.8.1

M  +6    -3    plasmoid/package/contents/ui/ContextMenu.qml
M  +2    -3    plasmoid/package/contents/ui/main.qml

https://commits.kde.org/latte-dock/b4dd016ed0d861e9c1676cbd6edb425edbe6c966
Comment 24 Michail Vourlakos 2018-08-28 16:42:49 UTC
Git commit abf8b5c77245ee97f35cfc50259f71dfd0677250 by Michail Vourlakos.
Committed on 28/08/2018 at 16:42.
Pushed by mvourlakos into branch 'v0.8'.

delay hiding previews when creating contextmenu

-- there are cases that hiding previews too early
can create crashes under wayland. Such a case is
when the user uses the touchpad to emulate a right-click
event to create a context menu for specific task
FIXED-IN: 0.8.1
(cherry picked from commit b4dd016ed0d861e9c1676cbd6edb425edbe6c966)

M  +6    -3    plasmoid/package/contents/ui/ContextMenu.qml
M  +2    -3    plasmoid/package/contents/ui/main.qml

https://commits.kde.org/latte-dock/abf8b5c77245ee97f35cfc50259f71dfd0677250
Comment 25 Michail Vourlakos 2018-08-28 16:42:49 UTC
Git commit 56b4be6f8eb410591925dc0e57f5ba1ba31d7276 by Michail Vourlakos.
Committed on 28/08/2018 at 16:41.
Pushed by mvourlakos into branch 'v0.8'.

dont crash plasmoid from too fast mouse events

make sure that we delete a valid contextMenu and
not a ghost reference. This could occur from
two-fingers emulating right-click in wayland.
FIXED-IN: 0.8.1
(cherry picked from commit afb34a85cf7c30eed343e51ceb1d1f73ba7a65a2)

M  +3    -1    plasmoid/package/contents/ui/ContextMenu.qml
M  +5    -1    plasmoid/package/contents/ui/task/TaskDelegate.qml

https://commits.kde.org/latte-dock/56b4be6f8eb410591925dc0e57f5ba1ba31d7276
Comment 26 Michail Vourlakos 2018-08-28 16:44:34 UTC
I think you can test again to confirm that this is fixed...
Comment 27 Sefa Eyeoglu 2018-08-28 17:23:25 UTC
Yep. It seems like it's working now.