2024-02-20 21:16:07 +01:00
|
|
|
---
|
|
|
|
weight: 10
|
|
|
|
title: Crashes and Bugs
|
|
|
|
---
|
|
|
|
|
|
|
|
## Getting the log
|
2022-08-12 20:46:36 +02:00
|
|
|
|
2024-04-21 16:35:48 +02:00
|
|
|
If you are in a TTY, and the Hyprland session that crashed was the last one you
|
|
|
|
launched, the log can be printed with
|
2022-08-12 20:46:36 +02:00
|
|
|
|
2022-08-13 19:56:20 +02:00
|
|
|
```sh
|
2024-04-28 23:25:40 +02:00
|
|
|
cat $XDG_RUNTIME_DIR/hypr/$(ls -t $XDG_RUNTIME_DIR/hypr/ | head -n 1)/hyprland.log
|
2022-08-12 20:46:36 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
if you are in a Hyprland session, and you want the log of the last session, use
|
|
|
|
|
2022-08-13 19:56:20 +02:00
|
|
|
```sh
|
2024-04-28 23:25:40 +02:00
|
|
|
cat $XDG_RUNTIME_DIR/hypr/$(ls -t $XDG_RUNTIME_DIR/hypr/ | head -n 2 | tail -n 1)/hyprland.log
|
2022-08-12 20:46:36 +02:00
|
|
|
```
|
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
## Obtaining the Hyprland Crash Report
|
2024-02-20 01:54:45 +01:00
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
If you have `$XDG_CACHE_HOME` set, the crash report directory is
|
|
|
|
`$XDG_CACHE_HOME/hyprland`. If not, it's `$HOME/.cache/hyprland`.
|
2024-02-20 01:54:45 +01:00
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
Go to the crash report directory and you should find a file named
|
|
|
|
`hyprlandCrashReport[XXXX].txt` where `[XXXX]` is the PID of the process that
|
|
|
|
crashed.
|
2024-02-20 01:54:45 +01:00
|
|
|
|
|
|
|
Attach that file to your issue.
|
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
## Crashes at launch
|
2022-08-12 20:46:36 +02:00
|
|
|
|
|
|
|
Diagnose the issue by what is in the log:
|
|
|
|
|
2024-07-21 13:11:03 +02:00
|
|
|
- `backend failed to start` -> launch in the TTY and refer to the logs in RED.
|
2022-08-12 20:46:36 +02:00
|
|
|
- `Monitor X has NO PREFERRED MODE, and an INVALID one was requested` -> your
|
|
|
|
monitor is bork.
|
|
|
|
- Other -> see the coredump. Use `coredumpctl`, find the latest one's PID and do
|
|
|
|
`coredumpctl info PID`.
|
|
|
|
- failing on a driver (e.g. `radeon`) -> try compiling with
|
|
|
|
`make legacyrenderer`, if that doesn't help, report an issue.
|
|
|
|
- failing on `Hyprland` -> report an issue.
|
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
## Crashes not at launch
|
2022-08-12 20:46:36 +02:00
|
|
|
|
2022-10-10 16:22:57 +02:00
|
|
|
Report an issue on GitHub or on the Discord server.
|
2022-08-12 20:46:36 +02:00
|
|
|
|
2024-05-01 20:52:34 +02:00
|
|
|
## Obtaining a debug stacktrace
|
|
|
|
|
2024-09-07 16:47:03 +02:00
|
|
|
> Systemd-only.
|
2024-05-01 20:52:34 +02:00
|
|
|
|
2024-09-07 16:47:03 +02:00
|
|
|
1. Build Hyprland in debug (`make debug`).
|
|
|
|
2. Start Hyprland and get it to crash.
|
|
|
|
3. In a tty or terminal, do `coredumpctl debug Hyprland`.
|
2024-11-06 19:34:37 +01:00
|
|
|
- If gdb asks you for symbols, say `y`.
|
|
|
|
- If it asks about paging, say `c`.
|
2024-09-07 16:47:03 +02:00
|
|
|
4. Once you get to `(gdb)`, start file logging with `set logging on`.
|
2024-11-06 19:34:37 +01:00
|
|
|
- For a specific file, use `set logging file output.log`.
|
2024-09-07 16:47:03 +02:00
|
|
|
5. Run `bt -full`, then `exit` once finished, and attach the output.
|
2024-05-01 20:52:34 +02:00
|
|
|
|
2024-07-24 15:12:48 +02:00
|
|
|
## Obtaining a trace log
|
|
|
|
|
2024-09-07 16:47:03 +02:00
|
|
|
Launch Hyprland with `HYPRLAND_TRACE=1 AQ_TRACE=1` environment variables set.
|
2024-07-24 15:12:48 +02:00
|
|
|
|
|
|
|
These variables will enable _very_ verbose logging and it's not recommended to enable them unless debugging, as they
|
|
|
|
might cause slowdowns and _massive_ log files.
|
|
|
|
|
2024-07-24 15:13:54 +02:00
|
|
|
Try to reproduce your issue as fast as possible so we don't have to sift through 1 million lines of logs.
|
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
## Bugs
|
2022-08-12 20:46:36 +02:00
|
|
|
|
2024-03-17 13:44:39 +01:00
|
|
|
First of all, **_READ THE [FAQ PAGE](../FAQ)_**
|
2022-08-12 20:46:36 +02:00
|
|
|
|
|
|
|
If your bug is not listed there, you can ask on the Discord server or open an
|
2022-10-10 16:22:57 +02:00
|
|
|
issue on GitHub.
|
2023-10-05 02:05:55 +02:00
|
|
|
|
2024-04-22 12:32:33 +02:00
|
|
|
## Bisecting an issue
|
|
|
|
|
|
|
|
"Bisecting" is finding the first _git_ commit that introduced a specific bug or
|
|
|
|
regression using binary search. This is done in `git` using the `git bisect` command.
|
|
|
|
|
|
|
|
First, clone the Hyprland repo if you haven't already:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
git clone --recursive https://github.com/hyprwm/Hyprland
|
|
|
|
cd Hyprland
|
|
|
|
```
|
|
|
|
|
|
|
|
Start the bisect process:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
git bisect start
|
|
|
|
```
|
|
|
|
|
|
|
|
Enter the first known good commit hash that did not contain the issue:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
git bisect good [good commit]
|
|
|
|
```
|
|
|
|
|
|
|
|
Then, enter the known bad commit hash that does contain the issue. You can simply use HEAD:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
git bisect bad HEAD
|
|
|
|
```
|
|
|
|
|
|
|
|
_git_ will now checkout a commit in the middle of the specified range.
|
2024-06-16 12:43:13 +02:00
|
|
|
Now, reset and build Hyprland:
|
2024-04-22 12:32:33 +02:00
|
|
|
|
|
|
|
```sh
|
2024-04-27 22:48:19 +02:00
|
|
|
git reset --hard --recurse-submodules
|
2024-04-22 12:32:33 +02:00
|
|
|
make all
|
|
|
|
```
|
|
|
|
|
2024-06-16 12:43:13 +02:00
|
|
|
...and run the built executable from the TTY `./build/Hyprland`.
|
2024-04-22 12:32:33 +02:00
|
|
|
|
|
|
|
Try to reproduce your issue. If you can't (i.e. the bug is not present), go back to the
|
|
|
|
Hyprland repo and run `git bisect good`. If you can reproduce it, run `git bisect bad`.
|
|
|
|
_git_ will then checkout another commit and continue the binary search.
|
2024-06-16 12:43:13 +02:00
|
|
|
If there's a build error, run `git bisect skip`.
|
2024-04-22 12:32:33 +02:00
|
|
|
|
2024-04-27 22:48:19 +02:00
|
|
|
Reset, build and install Hyprland again and repeat this step until _git_ identifies the
|
2024-04-22 12:32:33 +02:00
|
|
|
commit that introduced the bug:
|
|
|
|
|
|
|
|
```
|
|
|
|
[commit hash] is the first bad commit
|
|
|
|
```
|
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
## Building the Wayland stack with ASan
|
2023-10-05 02:05:55 +02:00
|
|
|
|
|
|
|
If requested, this is the deepest level of memory issue debugging possible.
|
|
|
|
|
2024-04-21 16:35:48 +02:00
|
|
|
_Do this in the tty, with no Hyprland instances running._
|
2023-10-05 02:05:55 +02:00
|
|
|
|
2024-03-01 15:18:32 +01:00
|
|
|
Clone hyprland: `git clone --recursive https://github.com/hyprwm/Hyprland`
|
2023-10-05 02:05:55 +02:00
|
|
|
|
2024-03-01 15:18:32 +01:00
|
|
|
`make asan`
|
2023-10-05 02:05:55 +02:00
|
|
|
|
2024-03-01 15:18:32 +01:00
|
|
|
Reproduce your crash. Hyprland will exit back to the tty.
|
2024-02-01 13:17:33 +01:00
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
Now, in either `cwd`, `~` or `./build`, search for file(s) named
|
|
|
|
`asan.log.XXXXX` where XXXXX is a number.
|
2023-10-05 02:05:55 +02:00
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
Zip all of them up and attach to your issue.
|
2024-08-18 20:05:57 +02:00
|
|
|
|
|
|
|
## Debugging DRM issues
|
|
|
|
|
|
|
|
DRM (Direct Rendering Manager) is the underlying kernel architecture to take a gpu buffer (something
|
|
|
|
we can render to) and put it on your screen (via the gpu) instead of a window.
|
|
|
|
|
|
|
|
Freezes, glitches, and others, can be caused by issues with Hyprland's communication with DRM, the driver
|
|
|
|
or kernel. In those cases, a DRM log is helpful.
|
|
|
|
|
2024-11-06 19:34:37 +01:00
|
|
|
{{< callout >}}
|
|
|
|
|
|
|
|
Please note, these logs are EXTREMELY verbose. Please reproduce your bug(s) ASAP to avoid getting a 1GB log.
|
|
|
|
|
|
|
|
{{< /callout >}}
|
2024-08-18 20:05:57 +02:00
|
|
|
|
|
|
|
```sh
|
|
|
|
echo 0x19F | sudo tee /sys/module/drm/parameters/debug # cnables verbose drm logging
|
|
|
|
sudo dmesg -C # clears kernel debug logs
|
|
|
|
dmesg -w > ~/dmesg.log & # writes kernel logs in the background to a file at ~/dmesg.log
|
|
|
|
Hyprland
|
|
|
|
|
|
|
|
# ... repro the issue, then quit hyprland
|
|
|
|
|
|
|
|
|
|
|
|
fg # after this, use CTRL+C to stop writing the logs
|
|
|
|
echo 0 | sudo tee /sys/module/drm/parameters/debug # disables drm logging, don't forget this to avoid slowdowns
|
|
|
|
```
|
|
|
|
|
|
|
|
After this, _attach_ the `dmesg.log` file.
|