I have laptop with touch screen, so I wanted to use plugin: https://github.com/horriblename/hyprgrass. However Hyprland crashes on touchUp event. I have tried to do some investigation. First it works fine with debug builds, but I find out what may be the problem. Functions: onTouchDown(wlr_touch_down_event*), onTouchUp(wlr_touch_up_event*), onTouchMove(wlr_touch_motion_event*) from CInputManager may be called from different threads (if i tap the screen fast enough with multiple fingers) and they use the same field m_sTouchData, so it looks like race condition. However i was not able to crash it without plugin loaded, so I have created minimal version of plugin hyprgrass, which creates hooks for this functions, but this hooks just call m_pOriginal, so I expect that it does nothing, but hyprland crashes onTouchUp.
Hyprland Version
499df49f7b28f9e3be9b1c53843fd5c465dec60b
Bug or Regression?
Bug
Description
I have laptop with touch screen, so I wanted to use plugin: https://github.com/horriblename/hyprgrass. However Hyprland crashes on touchUp event. I have tried to do some investigation. First it works fine with debug builds, but I find out what may be the problem. Functions:
onTouchDown(wlr_touch_down_event*)
,onTouchUp(wlr_touch_up_event*)
,onTouchMove(wlr_touch_motion_event*)
fromCInputManager
may be called from different threads (if i tap the screen fast enough with multiple fingers) and they use the same fieldm_sTouchData
, so it looks like race condition. However i was not able to crash it without plugin loaded, so I have created minimal version of plugin hyprgrass, which creates hooks for this functions, but this hooks just callm_pOriginal
, so I expect that it does nothing, but hyprland crashes onTouchUp.I added mutex to m_sTouchData and it does solve the problem:
I am not sure what is going on, it looks like compiler does something in release build.
How to reproduce
Load plugin from snipped above. Touch screen. On touch up hyprland should crash.
Crash reports, logs, images, videos
hyprland.log hyprlandCrashReport445.txt