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
21.58k stars 902 forks source link

Crash when field `class:` is empty for windowrulev2 #5431

Closed Fymyte closed 7 months ago

Fymyte commented 7 months ago

Hyprland Version

System/Version info ```sh Hyprland, built from branch HEAD at commit 3875679755014997776e091ff8903acfb311dd2f (props: bump ver to 0.38.0). Date: Mon Apr 1 18:30:37 2024 Tag: v0.38.0 flags: (if any) System Information: System name: Linux Node name: bigarch Release: 6.8.2-arch2-1 Version: #1 SMP PREEMPT_DYNAMIC Thu, 28 Mar 2024 17:06:35 +0000 GPU information: 08:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT] [1002:73df] (rev c0) (prog-if 00 [VGA controller]) os-release: NAME="Arch Linux" PRETTY_NAME="Arch Linux" ID=arch BUILD_ID=rolling ANSI_COLOR="38;2;23;147;209" HOME_URL="https://archlinux.org/" DOCUMENTATION_URL="https://wiki.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues" PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/" LOGO=archlinux-logo plugins: ```

Bug or Regression?

Bug

Description

When I save hyprland.conf with a windowrule having an empty class property, hyprland crashes instantly

How to reproduce

hyprland.conf with only this line:

windowrulev2 = float, class:

Crash reports, logs, images, videos

The backtrace is not really relevant for me, I didn't compile Hyprland myself with so the elf is stripped/no symbol.

At least it seems to crash in the constructor of CConfigManager

Crash report ```sh -------------------------------------------- Hyprland Crash Report -------------------------------------------- Oops Hyprland received signal 6 (Aborted) Version: 3875679755014997776e091ff8903acfb311dd2f Tag: v0.38.0 System info: System name: Linux Node name: bigarch Release: 6.8.2-arch2-1 Version: #1 SMP PREEMPT_DYNAMIC Thu, 28 Mar 2024 17:06:35 +0000 GPU: 08:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT] [1002:73df] (rev c0) (prog-if 00 [VGA controller]) os-release: NAME="Arch Linux" PRETTY_NAME="Arch Linux" ID=arch BUILD_ID=rolling ANSI_COLOR="38;2;23;147;209" HOME_URL="https://archlinux.org/" DOCUMENTATION_URL="https://wiki.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues" PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/" LOGO=archlinux-logo Backtrace: #0 | Hyprland(_Z12getBacktracev+0x62) [0x5d0cf0631c02] getBacktrace() ??:? #1 | Hyprland(_ZN13CrashReporter18createAndSaveCrashEi+0x5b9) [0x5d0cf05de199] CrashReporter::createAndSaveCrash(int) ??:? #2 | Hyprland(_Z25handleUnrecoverableSignali+0x4c) [0x5d0cf056c5ec] handleUnrecoverableSignal(int) ??:? #3 | /usr/lib/libc.so.6(+0x3c770) [0x7e371ad6e770] ?? ??:0 #4 | /usr/lib/libc.so.6(+0x8d32c) [0x7e371adbf32c] main ??:? #5 | /usr/lib/libc.so.6(gsignal+0x18) [0x7e371ad6e6c8] ?? ??:0 #6 | /usr/lib/libc.so.6(abort+0xd7) [0x7e371ad564b8] ?? ??:0 #7 | /usr/lib/libstdc++.so.6(+0xdd3b2) [0x7e371b0dd3b2] CConfigManager::CConfigManager() ??:? #8 | Hyprland(+0xf5bf8) [0x5d0cf05cfbf8] CConfigManager::handleLayerRule(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&) ??:? #9 | Hyprland(_ZN14CConfigManager18handleWindowRuleV2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_+0xe8a) [0x5d0cf05d189a] CConfigManager::handleWindowRuleV2(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&) ??:? #10 | Hyprland(+0xd4c60) [0x5d0cf05aec60] std::_Function_handler, true, true> >::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation) ??:? #11 | /usr/lib/libhyprlang.so.2(_ZN8Hyprlang7CConfig9parseLineENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb+0x12f9) [0x7e371b3a7e19] ?? ??:0 #12 | /usr/lib/libhyprlang.so.2(_ZN8Hyprlang7CConfig9parseFileEPKc+0x335) [0x7e371b3a9965] ?? ??:0 #13 | /usr/lib/libhyprlang.so.2(_ZN8Hyprlang7CConfig5parseEv+0x204) [0x7e371b3ab484] ?? ??:0 #14 | Hyprland(_ZN14CConfigManager6reloadEv+0x138) [0x5d0cf05b4308] CConfigManager::reload() ??:? #15 | Hyprland(_ZN14CConfigManager4initEv+0x3a) [0x5d0cf05bc6fa] CConfigManager::init() ??:? #16 | Hyprland(_ZN11CCompositor12initManagersE18eManagersInitStage+0x1116) [0x5d0cf05732e6] CCompositor::initManagers(eManagersInitStage) ??:? #17 | Hyprland(_ZN11CCompositor10initServerEv+0xbc) [0x5d0cf0573adc] CCompositor::initServer() ??:? #18 | Hyprland(main+0x6d2) [0x5d0cf05532d2] main ??:? #19 | /usr/lib/libc.so.6(+0x25cd0) [0x7e371ad57cd0] ?? ??:0 #20 | /usr/lib/libc.so.6(__libc_start_main+0x8a) [0x7e371ad57d8a] ?? ??:0 #21 | Hyprland(_start+0x25) [0x5d0cf0569ba5] _start ??:? Log tail: [LOG] Hyprland PID: 3657 [LOG] ===== SYSTEM INFO: ===== [LOG] System name: Linux [LOG] Node name: bigarch [LOG] Release: 6.8.2-arch2-1 [LOG] Version: #1 SMP PREEMPT_DYNAMIC Thu, 28 Mar 2024 17:06:35 +0000 [LOG] GPU information: 08:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT] [1002:73df] (rev c0) (prog-if 00 [VGA controller]) [LOG] os-release: NAME="Arch Linux" PRETTY_NAME="Arch Linux" ID=arch BUILD_ID=rolling ANSI_COLOR="38;2;23;147;209" HOME_URL="https://archlinux.org/" DOCUMENTATION_URL="https://wiki.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues" PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/" LOGO=archlinux-logo [LOG] ======================== [INFO] If you are crashing, or encounter any bugs, please consult https://wiki.hyprland.org/Crashes-and-Bugs/ [LOG] Current splash: Ding ding pch n daa, bam-ba-ba-re-bam baram bom bom baba-bam-bam-bommm [LOG] Creating the HookSystem! [LOG] Creating the KeybindManager! [LOG] [hookSystem] New hook event registered: configReloaded [LOG] Creating the AnimationManager! [LOG] Created a bezier curve, baked 255 points, mem usage: 4.08kB, time to bake: 17.38µs. Estimated average calc time: 0.04µs. [LOG] Creating the ConfigManager! [LOG] Created a bezier curve, baked 255 points, mem usage: 4.08kB, time to bake: 8.29µs. Estimated average calc time: 0.03µs. [LOG] Using config: /home/fymyte/.config/hypr/hyprland.conf [LOG] !!!!HEY YOU, YES YOU!!!!: further logs to stdout / logfile are disabled by default. BEFORE SENDING THIS LOG, ENABLE THEM. Use debug:disable_logs = false to do so: https://wiki.hyprland.org/Configuring/Variables/#debug [LOG] Creating the CHyprError! [LOG] [hookSystem] New hook event registered: focusedMon [LOG] [hookSystem] New hook event registered: preRender [LOG] Creating the LayoutManager! [LOG] [hookSystem] New hook event registered: preConfigReload [LOG] Created a bezier curve, baked 255 points, mem usage: 4.08kB, time to bake: 8.23µs. Estimated average calc time: 0.01µs. [LOG] Using config: /home/fymyte/.config/hypr/hyprland.conf ```
vaxerski commented 7 months ago

bad news

Doesn't crash for me on -git.

Fymyte commented 7 months ago

Mmm ok I will start by installing the -git and check

Fymyte commented 7 months ago

Checked today, I still get the issue with the latest git. I will try to install the asan version

MightyPlaza commented 7 months ago

-git crash report?

gulafaran commented 7 months ago

i can reproduce,

Core was generated by `Hyprland'.
Program terminated with signal SIGABRT, Aborted.
#0  0x00007ffff73ae5bc in ?? () from /usr/lib64/libc.so.6
[Current thread is 1 (Thread 0x7ffff645eac0 (LWP 931160))]
(gdb) bt
#0  0x00007ffff73ae5bc in ??? () at /usr/lib64/libc.so.6
#1  0x00007ffff7360fc2 in raise () at /usr/lib64/libc.so.6
#2  0x00007ffff734a4e1 in abort () at /usr/lib64/libc.so.6
#3  0x00005555555e17a2 in handleUnrecoverableSignal (sig=6) at ../hyprland-source/src/Compositor.cpp:37
#4  0x00007ffff7361060 in <signal handler called> () at /usr/lib64/libc.so.6
#5  0x00007ffff73ae5bc in ??? () at /usr/lib64/libc.so.6
#6  0x00007ffff7360fc2 in raise () at /usr/lib64/libc.so.6
#7  0x00007ffff734a4e1 in abort () at /usr/lib64/libc.so.6
#8  0x00007ffff76db72b in std::__glibcxx_assert_fail(char const*, int, char const*, char const*) ()
    at /usr/lib/gcc/x86_64-pc-linux-gnu/13/libstdc++.so.6
#9  0x0000555555679a48 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::back (this=0x7fffffffc890)
    at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/basic_string.h:1341
#10 0x0000555555679e41 in operator() (__closure=0x7fffffffc610, pos=7) at ../hyprland-source/src/config/ConfigManager.cpp:2048
#11 0x000055555567a84c in CConfigManager::handleWindowRuleV2
    (this=0x555555b599f0, command="windowrulev2", value="suppressevent maximize, class:")
    at ../hyprland-source/src/config/ConfigManager.cpp:2055
#12 0x0000555555668726 in handleWindowRuleV2 (c=0x7fffffffcba0 "windowrulev2", v=0x555556837e50 "suppressevent maximize, class:")
    at ../hyprland-source/src/config/ConfigManager.cpp:218
#13 0x00007ffff7a93ae2 in Hyprlang::CConfig::parseLine(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool) () at /usr/lib64/libhyprlang.so.2
#14 0x00007ffff7a94b5f in Hyprlang::CConfig::parseFile(char const*) () at /usr/lib64/libhyprlang.so.2
#15 0x00007ffff7a9573f in Hyprlang::CConfig::parse() () at /usr/lib64/libhyprlang.so.2
#16 0x00005555556696af in CConfigManager::reload (this=0x555555b599f0) at ../hyprland-source/src/config/ConfigManager.cpp:630
#17 0x000055555566fa88 in CConfigManager::tick (this=0x555555b599f0) at ../hyprland-source/src/config/ConfigManager.cpp:903
#18 0x000055555579e496 in handleTimer (data=0x555556493310) at ../hyprland-source/src/managers/ThreadManager.cpp:14
#19 0x00007ffff7f9bbfd in wl_event_loop_dispatch () at /usr/lib64/libwayland-server.so.0
#20 0x00007ffff7f9bdbe in wl_display_run () at /usr/lib64/libwayland-server.so.0
#21 0x00005555555e6957 in CCompositor::startCompositor (this=0x555555b53ca0) at ../hyprland-source/src/Compositor.cpp:630
#22 0x0000555555765c66 in main (argc=1, argv=0x7fffffffdc88) at ../hyprland-source/src/main.cpp:111
(gdb) 
Fymyte commented 7 months ago

Thanks I didn't have the time to recrash 😅

vaxerski commented 7 months ago

this should fix it. Lmk.

Fymyte commented 7 months ago

Confirmed fixed on master :+1: thanks for this amazing wm and swiftness of response