Impossible layer-shell surface caused segfault
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.1k
- Forks
- 237
- Avg merge
- 1h 43m
- Merged PRs (30d)
- 1
Description
Describe the bug
On the Wayland compositor, applications can request a layer shell surface. However, when the user switches to another TTY, wayfire registers a new placeholder virtual output and closes the real output. Since the placeholder virtual output has a size of 0, it's impossible to register certain fixed-size layer shell surfaces on it. This causes wayfire to crash due to a segmentation fault.
In my example, the program causing this crash is xfce4-panel, which has recently added Wayland support but is still not reliable enough. Although xfce4-panel itself exhibits bad behavior and should be considered buggy, wayfire should not crash due to an application's bug, but should instead handle the situation differently, for example, by killing the process that requests an impossible layer shell surface.
To Reproduce
Steps to reproduce the behavior:
- Run wayfire and Run xfce4-panel
- Switch to tty with like
ctrl+alt+F3 - wayfire segfault and crasg
Expected behavior
Wayfire should kill problematic process and continue to run on NOOP-1
Screenshots or stacktrace
Logs here:
II 2026-01-05 11:48:48.854 - [libseat] [libseat/backend/logind.c:382] Disabling seat
II 2026-01-05 11:48:48.854 - [backend/drm/backend.c:112] DRM FD paused
II 2026-01-05 11:48:48.854 - [src/core/output-layout.cpp:1323] remove output: eDP-1
II 2026-01-05 11:48:48.854 - [src/core/output-layout.cpp:1204] new output: NOOP-1
II 2026-01-05 11:48:48.854 - [src/core/output-layout.cpp:702] Couldn't find matching mode 1280x720@0 for output NOOP-1. Trying to use custom mode(might not work)
EE 2026-01-05 11:48:48.862 - [src/core/output-layout.cpp:601] disabling output: eDP-1
II 2026-01-05 11:48:48.862 - [src/core/output-layout.cpp:232] transfer views from eDP-1 -> NOOP-1
EE 2026-01-05 11:48:48.864 - [backend/drm/drm.c:1349] connector eDP-1: Failed to disable CRTC 88
qt.qpa.wayland: There are no outputs - creating placeholder screen
EE 2026-01-05 11:48:48.884 - [src/view/layer-shell/layer-shell.cpp:631] layer-surface has calculated width and height < 0
EE 2026-01-05 11:48:48.885 - [src/main.cpp:144] Fatal error: Segmentation fault
Wayfire version
0.10.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/view/layer-shell/layer-shell.cpp around line 631, where the log reports a layer surface with calculated dimensions below zero, and review the output transition in src/core/output-layout.cpp. Reproduce with xfce4-panel, Wayfire, and a TTY switch. Done means Wayfire continues running on NOOP-1 without a segmentation fault and handles the impossible layer-shell request as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100