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.7k stars 835 forks source link

Buffer overread on hyprpm enable #7781

Open bodby opened 5 days ago

bodby commented 5 days ago

Already reported ? *

Regression?

No

System Info and Version

System/Version info ```sh On mobile and can't access my PC yet, will add this once I can. Sorry. ```

Description

Running hyprpm enable without anything after (no plugin name) prints a bunch of stuff unrelated to Hyprland; things like GCC compiler flags and a part of my PATH (as far as I remember).

Hyprpm disable does not have this problem; it does tell you that you haven't entered a valid plugin name.

Nothing else seems to happen when I do this though. Everything works as expected afterwards, though I haven't checked if there's a memory leak.

How to reproduce

Write hyprpm update and see output.

Crash reports, logs, images, videos

Will add output once I can. Sorry again.

vaxerski commented 3 days ago

image eee?

bodby commented 3 days ago

Try with a space after enable? Or two?

Could be because I wasn't able to update for a while; this was on 0.42.0.

vaxerski commented 3 days ago

image

nope

bodby commented 2 days ago

image

???

I just updated to 0.43.0. This was also after hyprpm update, though I think that only affects plugins.

I am on Gentoo, you probably compile Hyprland with an extra flag or something.

bodby commented 2 days ago

Looking at the CMakeLists shows this:

image

I usually only use -O2 and -Wall for all my packages; the build file uses -O3 and -fmacro-prefix-...

I'm not sure what the last flag does, but I'll try compiling with both.

bodby commented 1 day ago

Did not work. I'm on GCC 14 if that means anything, though it shouldn't matter.

vaxerski commented 1 day ago

compile hyprpm in debug and provide a stacktrace just like for hyprland, I can't see where this could happen https://wiki.hyprland.org/Crashes-and-Bugs/#obtaining-a-debug-stacktrace

bodby commented 1 day ago

Not on systemd. Can I compile with -ggdb (think it was that flag)? I'm not that familiar with debuggers. Or build systems in general.

I also can't get a debug target. I tried using cmake in hyprpm and in the base hyprland directory. Neither had a make debug option.

vaxerski commented 1 day ago

hyprland does have a debug target, see the wiki's debug instructions

you can launch hyprpm with gdb and then get it to crash and follow the instructions as for hyprland

bodby commented 1 day ago

I did follow but the makefile that CMake generates doesn't have a debug target. Could I still run with -ggdb and gdb somehow?

EDIT: I'm stupid there's manual build instructions, but I don't remember them working. I'll try cloning and then running make in the base dir; I initially tried in hyprpm/.