hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
19.27k stars 802 forks source link

Hard crash on setting dynamic keyword #5974

Open TheAifam5 opened 3 months ago

TheAifam5 commented 3 months ago

Hyprland 0.39.1, 0.40.0

System/Version info ```sh System name: Linux Node name: pussyripper Release: 6.8.0-pf8-x86_64 Version: #1 SMP PREEMPT_DYNAMIC Wed May 8 00:05:12 CEST 2024 GPU: 0a:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM204 [GeForce GTX 970] [10de:13c2] (rev a1) (prog-if 00 [VGA controller]) 43:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU106 [GeForce RTX 2070 Rev. A] [10de:1f07] (rev a1) (prog-if 00 [VGA controller]) os-release: NAME=Gentoo ID=gentoo PRETTY_NAME="Gentoo Linux" ANSI_COLOR="1;32" HOME_URL="https://www.gentoo.org/" SUPPORT_URL="https://www.gentoo.org/support/" BUG_REPORT_URL="https://bugs.gentoo.org/" VERSION_ID="2.15" ```

Bug or Regression?

Bug

Description

I had an idea to "lock" my tablet to the monitor boundaries where the mouse is, since Hyprland allows setting the "output" of the device, I wrote a small script that dynamically changes the "output" based on which monitor the mouse currently is. I am not aware that Hyprland has support for such case.

It does not matter how fast you move the mouse back and forth, always crashes after few times, sometimes it slows the whole Hyprland to the unusable state and then crashes.

How to reproduce

  1. Create ~/.local/bin/hypr-wacom:
    
    #!/usr/bin/env bash

function handle { action="${1%%>>}" args="${1#>>}" if [[ $action == "focusedmon" ]]; then monitor="${args%%,}" index="${args#,}" echo "focusedmonitor ${monitor} at ${index}" hyprctl keyword "\$WACOM_OUTPUT" "$monitor" fi }

socat -U - "UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" | while read -r line; do handle "$line"; done


2. Add to the config:

$WACOM_OUTPUT = "HDMI-A-1"

exec-once = ~/.local/bin/hypr-wacom

device { name = wacom-intuos-bt-m-pen transform = 0 output = $WACOM_OUTPUT }



3. Move your mouse to different monitor back and forth

### Crash reports, logs, images, videos

[hyprlandCrashReport628700.txt](https://github.com/hyprwm/Hyprland/files/15268494/hyprlandCrashReport628700.txt)
[hyprland.log](https://github.com/hyprwm/Hyprland/files/15268499/hyprland.log)
MightyPlaza commented 3 months ago

can you try latest version

TheAifam5 commented 3 months ago

Same behavior on the 0.40.0.

vaxerski commented 3 months ago

best part is that the script doesnt even work because you need the -r flag here for hyprctl for these changes to take effect lole

can you try on -git?

TheAifam5 commented 3 months ago

@vaxerski i have added the missing flag -r and the difference is that whole Hyprland freezes for maybe a second or lower (noticable lag), but if I do it back and forth, still crashes with and without -r.

TheAifam5 commented 3 months ago

Commit: 1753059b07be52cf78fa2676c4c71d2edb560199 Same results.

hyprlandCrashReport931719.txt hyprland.log

vaxerski commented 3 months ago

I feel it's a bug in hyprlang, somehow

vaxerski commented 3 months ago

can you build hyprlang from git in debug and provide a debug stacktrace? https://wiki.hyprland.org/Crashes-and-Bugs/#obtaining-a-debug-stacktrace

hyprlang: https://github.com/hyprwm/hyprlang

if not I'll try to repro this but defo not today (and not with a tablet I dont even have one)

TheAifam5 commented 3 months ago

@vaxerski i will happily provide all requested information when I am back on PC, around 22:00 CEST or later.

TheAifam5 commented 3 months ago

Hyprland(master): https://github.com/hyprwm/Hyprland/commit/38911d6df4977b6b00557cc887eb151d032e505b Hyprlang(master): https://github.com/hyprwm/hyprlang/commit/78fcaa27ae9e1d782faa3ff06c8ea55ddce63706

bt-full.log hyprlandd.log hyprlandCrashReport755035.txt

You don't need a tablet to reproduce it. Without the device section, it freezes Hyprland for a second or less, but does not crash (no matter how fast i move between displays):

$WACOM_OUTPUT = "HDMI-A-1"

exec-once = ~/.local/bin/hypr-wacom