hyprland-community / hyprland-autoname-workspaces

Hyprland autoname workspaces 🪟 [maintainers=@cyrinux,@maximbaz]
ISC License
192 stars 8 forks source link

[BUG] thread 'main' panicked at 'no group named 'owner'' #82

Closed donovanglover closed 1 year ago

donovanglover commented 1 year ago

Describe the bug Crashes when switching to a workspace with osu!lazer

Program version?

Program configuration dump? (ideally)

To Reproduce Steps to reproduce the behavior:

  1. Start hyprland-autoname-workspaces
  2. Start osu!
  3. Change workspaces and observe crash

Expected behavior No crash

Linux Distro (please complete the following information):

Additional context

thread 'main' panicked at 'no group named 'owner'', /build/hyprland-autoname-workspaces-1.0.0-vendor.tar.gz/regex/src/re_unicode.rs:1172:32
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: <regex::re_unicode::Captures as core::ops::index::Index<&str>>::index
   3: hyprland::event_listener::shared::event_parser
   4: hyprland::event_listener::mutable::EventListener::start_listener
   5: hyprland_autoname_workspaces::renamer::Renamer::start_listeners
   6: hyprland_autoname_workspaces::main
cyrinux commented 1 year ago

Can you please share result of hyprctl clients -j please when osu is running.

I can't sadly install osulazer on aarch64 to test. I need you input. 😉

cyrinux commented 1 year ago

Can you also be sure to use the last hyprland from main/master ?

donovanglover commented 1 year ago

Here's hyprctl clients -j. I'm using hyprland v0.26.0.

{
    "address": "0x3e00260",
    "mapped": true,
    "hidden": false,
    "at": [0, 0],
    "size": [1875, 1080],
    "workspace": {
        "id": 4,
        "name": "<b><span color='red'>4-four:</span></b> "
    },
    "floating": false,
    "monitor": 0,
    "class": "osu!",
    "title": "osu!",
    "initialClass": "osu!",
    "initialTitle": "osu!",
    "pid": 385205,
    "xwayland": true,
    "pinned": false,
    "fullscreen": false,
    "fullscreenMode": 0,
    "fakeFullscreen": false,
    "grouped": [],
    "swallowing": null
}

I assume this is related to the class/title ending with an exclamation point. osu! isn't the only program to cause this error, but it is the easiest to reproduce with.

cyrinux commented 1 year ago

Thx, I I'll dig more with those infos 👍

cyrinux commented 1 year ago

@donovanglover do you reproduce the bug with last version of hyprland and autoname (1.1.1) ? I can't reproduce it with unit test, i should miss somethinh 🤔

donovanglover commented 1 year ago

Unfortunately still crashes with the same error.

thread 'main' panicked at 'no group named 'owner'', /build/hyprland-autoname-workspaces-1.1.1-vendor.tar.gz/regex/src/re_unicode.rs:1172:32
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: <regex::re_unicode::Captures as core::ops::index::Index<&str>>::index
   3: hyprland::event_listener::shared::event_parser
   4: hyprland::event_listener::mutable::EventListener::start_listener
   5: hyprland_autoname_workspaces::renamer::Renamer::start_listeners
   6: hyprland_autoname_workspaces::main
cyrinux commented 1 year ago

@donovanglover I try to replicate with unit test and also just running kitty in X11 mode with KITTY_DISABLE_WAYLAND=1 kitty --class 'osu!test' --title 'osu!test but I cant reproduce.

donovanglover commented 1 year ago

Wasn't able to reproduce it with kitty or a binary that ended in !. The osu! executable is a script that calls a script that starts an app image. Still reproducible in v1.1.3, although now the line number is different. ironbar had a similar issue but didn't crash, so I feel like this is an issue with hyprland-rs.

Anomalocaridid commented 1 year ago

I have the same problem with Minecraft. It seems like it only happens when I move to another workspace while it's in fullscreen, though. If I close it or exit fullscreen without moving workspaces it seems like the error does not appear.

Also, Minecraft has periods in its title and class, which might be related to osu!lazer having an exclamation mark in its title and class. In addition, I noticed that the backtrace mentions regex, which might somehow be related to special characters causing issues.

version: hyprland-autoname-workspaces 1.1.3

backtrace:

thread 'main' panicked at 'no group named 'owner'', /build/hyprland-autoname-workspaces-1.1.3-vendor.tar.gz/regex/src/regex/string.rs:2007:32
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: <regex::regex::string::Captures as core::ops::index::Index<&str>>::index
   3: hyprland::event_listener::shared::event_parser
   4: hyprland::event_listener::mutable::EventListener::start_listener
   5: hyprland_autoname_workspaces::renamer::Renamer::start_listeners
   6: hyprland_autoname_workspaces::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

hyprctl clients -j:

[{
    "address": "0x20f59e0",
    "mapped": true,
    "hidden": false,
    "at": [22, 60],
    "size": [1316, 686],
    "workspace": {
        "id": 2,
        "name": "2: <span color='#00FF00'></span>"
    },
    "floating": false,
    "monitor": 0,
    "class": "org.wezfurlong.wezterm",
    "title": "~/nixos",
    "initialClass": "org.wezfurlong.wezterm",
    "initialTitle": "wezterm",
    "pid": 4023,
    "xwayland": false,
    "pinned": false,
    "fullscreen": false,
    "fullscreenMode": 0,
    "fakeFullscreen": false,
    "grouped": [],
    "swallowing": null
},{
    "address": "0x2090100",
    "mapped": false,
    "hidden": false,
    "at": [0, 0],
    "size": [0, 0],
    "workspace": {
        "id": -1,
        "name": ""
    },
    "floating": false,
    "monitor": -1,
    "class": "",
    "title": "",
    "initialClass": "",
    "initialTitle": "",
    "pid": 0,
    "xwayland": true,
    "pinned": false,
    "fullscreen": false,
    "fullscreenMode": 0,
    "fakeFullscreen": false,
    "grouped": [],
    "swallowing": null
},{
    "address": "0x2091560",
    "mapped": false,
    "hidden": false,
    "at": [0, 0],
    "size": [0, 0],
    "workspace": {
        "id": -1,
        "name": ""
    },
    "floating": false,
    "monitor": -1,
    "class": "",
    "title": "",
    "initialClass": "",
    "initialTitle": "",
    "pid": 0,
    "xwayland": true,
    "pinned": false,
    "fullscreen": false,
    "fullscreenMode": 0,
    "fakeFullscreen": false,
    "grouped": [],
    "swallowing": null
},{
    "address": "0x20929c0",
    "mapped": false,
    "hidden": false,
    "at": [0, 0],
    "size": [0, 0],
    "workspace": {
        "id": -1,
        "name": ""
    },
    "floating": false,
    "monitor": -1,
    "class": "",
    "title": "",
    "initialClass": "",
    "initialTitle": "",
    "pid": 0,
    "xwayland": true,
    "pinned": false,
    "fullscreen": false,
    "fullscreenMode": 0,
    "fakeFullscreen": false,
    "grouped": [],
    "swallowing": null
},{
    "address": "0x2093e20",
    "mapped": false,
    "hidden": false,
    "at": [0, 0],
    "size": [0, 0],
    "workspace": {
        "id": -1,
        "name": ""
    },
    "floating": false,
    "monitor": -1,
    "class": "",
    "title": "",
    "initialClass": "",
    "initialTitle": "",
    "pid": 0,
    "xwayland": true,
    "pinned": false,
    "fullscreen": false,
    "fullscreenMode": 0,
    "fakeFullscreen": false,
    "grouped": [],
    "swallowing": null
},{
    "address": "0x2095280",
    "mapped": true,
    "hidden": false,
    "at": [22, 60],
    "size": [1316, 686],
    "workspace": {
        "id": 1,
        "name": "1: 󰍳 󰍳"
    },
    "floating": false,
    "monitor": 0,
    "class": "org.prismlauncher.PrismLauncher",
    "title": "Prism Launcher 7.1",
    "initialClass": "org.prismlauncher.PrismLauncher",
    "initialTitle": "Prism Launcher 7.1",
    "pid": 14979,
    "xwayland": false,
    "pinned": false,
    "fullscreen": false,
    "fullscreenMode": 0,
    "fakeFullscreen": false,
    "grouped": [],
    "swallowing": null
},{
    "address": "0x20cbaa0",
    "mapped": false,
    "hidden": false,
    "at": [0, 0],
    "size": [0, 0],
    "workspace": {
        "id": -1,
        "name": ""
    },
    "floating": false,
    "monitor": -1,
    "class": "",
    "title": "",
    "initialClass": "",
    "initialTitle": "",
    "pid": 0,
    "xwayland": true,
    "pinned": false,
    "fullscreen": false,
    "fullscreenMode": 0,
    "fakeFullscreen": false,
    "grouped": [],
    "swallowing": null
},{
    "address": "0x21d2780",
    "mapped": true,
    "hidden": false,
    "at": [0, 0],
    "size": [1360, 768],
    "workspace": {
        "id": 1,
        "name": "1: 󰍳 󰍳"
    },
    "floating": true,
    "monitor": 0,
    "class": "Minecraft 1.20.1",
    "title": "Minecraft 1.20.1",
    "initialClass": "Minecraft 1.20.1",
    "initialTitle": "Minecraft 1.20.1",
    "pid": 57413,
    "xwayland": true,
    "pinned": false,
    "fullscreen": true,
    "fullscreenMode": 0,
    "fakeFullscreen": false,
    "grouped": [],
    "swallowing": null
}]
cyrinux commented 1 year ago

I feel like yes we have an issue in hyprland-rs but I would also prevent to crash from on autoname. I check this.

As I can sadly install nor minecraft nor osu! on aarch64:

cyrinux commented 1 year ago

Ok, can you try main branch again please, do forgot to pull.

I feel like we found the issue, I should be fix soon in hyprland-rs, I will do release then for both projects. 🥳

Anomalocaridid commented 1 year ago

After running the latest commit to main with cargo run, it looks like it's fixed on my end. Thank you!

cyrinux commented 1 year ago

Will do a release 1.1.4 now. cc @donovanglover

donovanglover commented 1 year ago

Fixed for me as well. Thanks!