Uwsm-managed Hyprland crashes on startup if no monitor is connected

Hyprland version
Hyprland 0.50.1 built from branch  at commit 4e242d086e20b32951fdc0ebcbfb4d41b5be8dcc  ([gha] Nix: update inputs).
Date: Sat Jul 19 21:37:06 2025
Tag: v0.50.1, commits: 6291
built against:
 aquamarine 0.9.2
 hyprlang 0.6.3
 hyprutils 0.8.1
 hyprcursor 0.1.12
 hyprgraphics 0.1.5


no flags were set
Crash report

Hyprland Crash Report

Well this is awkward.

Hyprland received signal 11(SEGV)
Version: 4e242d086e20b32951fdc0ebcbfb4d41b5be8dcc
Tag: v0.50.1
Date: Sat Jul 19 21:37:06 2025
Flags:

System info:
System name: Linux
Node name: adixdzx15arch
Release: 6.15.6-arch1-1
Version: #1 SMP PREEMPT_DYNAMIC Thu, 10 Jul 2025 17:10:18 +0000

GPU:
00:02.0 Display controller [0380]: Intel Corporation Raptor Lake-S GT1 [UHD Graphics 770] [8086:a780] (rev 04)
03:00.0 VGA compatible controller [0300]: Intel Corporation DG2 [Arc A770] [8086:56a0] (rev 08) (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=[NO LINKS ALLOWED]
DOCUMENTATION_URL=“https://wiki.archlinux.org/
SUPPORT_URL= [NO LINKS ALLOWED]
BUG_REPORT_URL= [NO_LINKS ALLOWED]
PRIVACY_POLICY_URL= [NO LINKS ALLOWED]
LOGO=archlinux-logo
Backtrace:
# | Hyprland(_Z12getBacktracev+0x61) [0x5590af889441]
getBacktrace()
??:?
#1 | Hyprland(_ZN14NCrashReporter18createAndSaveCrashEi+0x1187) [0x5590af7e16d7]
NCrashReporter::createAndSaveCrash(int)
??:?
#2 | Hyprland(+0x22aa68) [0x5590af751a68]
CCompositor::getMonitorFromCursor()
??:?
#3 | /usr/lib/libc.so.6(+0x3def0) [0x7f9339955ef0]
??
??:0
#4 | Hyprland(ZN6Events18listener_mapWindowEPvS0+0x5100) [0x5590af874e20]
Events::listener_mapWindow(void*, void*)
??:?
#5 | /usr/lib/libhyprutils.so.7(_ZN9Hyprutils6Signal15CSignalListener12emitInternalEPv+0x2d) [0x7f933a5ecc6d]
??
??:0
#6 | /usr/lib/libhyprutils.so.7(_ZN9Hyprutils6Signal11CSignalBase12emitInternalEPv+0x195) [0x7f933a5ecec5]
??
??:0
#7 | /usr/lib/libhyprutils.so.7(_ZN9Hyprutils6Signal15CSignalListener12emitInternalEPv+0x2d) [0x7f933a5ecc6d]
??
??:0
#8 | /usr/lib/libhyprutils.so.7(_ZN9Hyprutils6Signal11CSignalBase12emitInternalEPv+0x195) [0x7f933a5ecec5]
??
??:0
#9 | Hyprland(+0x608fcf) [0x5590afb2ffcf]
CWLDataOfferResource::getSource()
??:?
#1 | Hyprland(ZN18CWLSurfaceResource8bfHelperERKSt6vectorIN9Hyprutils6Memory14CSharedPointerIS_EESaIS4_EESt8functionIFvS4_RKNS1_4Math8Vector2DEPvEESE+0x65f) [0x5590afb29dbf]
CWLSurfaceResource::bfHelper(std::vector<Hyprutils::Memory::CSharedPointer, std::allocator<Hyprutils::Memory::CSharedPointer > > const&, std::function<void (Hyprutils::Memory::CSharedPointer, Hyprutils::Math::Vector2D const&, void*)>, void*)
??:?
#11 | Hyprland(+0x603f35) [0x5590afb2af35]
CWLSurfaceResource::at(Hyprutils::Math::Vector2D const&, bool)
??:?
#12 | Hyprland(_ZN18CWLSurfaceResource11commitStateER13SSurfaceState+0x1c0) [0x5590afb366d0]
CWLSurfaceResource::commitState(SSurfaceState&)
??:?
#13 | Hyprland(+0x6012e2) [0x5590afb282e2]
CWLSurfaceResource::map()
??:?
#14 | Hyprland(+0x6058c9) [0x5590afb2c8c9]
CWLSurfaceResource::releaseBuffers(bool)
??:?
#15 | Hyprland(+0x7160f6) [0x5590afc3d0f6]
CWpColorManagerV1::sendSupportedFeature(wpColorManagerV1Feature)
??:?
#16 | /usr/lib/libffi.so.8(+0x7ac6) [0x7f9339694ac6]
??
??:0
#17 | /usr/lib/libffi.so.8(+0x476b) [0x7f933969176b]
??
??:0
#18 | /usr/lib/libffi.so.8(ffi_call+0x12e) [0x7f933969406e]
??
??:0
#19 | /usr/lib/libwayland-server.so.0(+0x6f85) [0x7f933a4cef85]
??
??:0
#2 | /usr/lib/libwayland-server.so.0(+0xbd02) [0x7f933a4d3d02]
??
??:0
#21 | /usr/lib/libwayland-server.so.0(wl_event_loop_dispatch+0x1f2) [0x7f933a4d2112]
??
??:0
#22 | /usr/lib/libwayland-server.so.0(wl_display_run+0x37) [0x7f933a4d41f7]
??
??:0
#23 | Hyprland(_ZN17CEventLoopManager9enterLoopEv+0x1a9) [0x5590af9714a9]
CEventLoopManager::enterLoop()
??:?
#24 | Hyprland(main+0x1002) [0x5590af6f5452]
main
??:?
#25 | /usr/lib/libc.so.6(+0x276b5) [0x7f933993f6b5]
??
??:0
#26 | /usr/lib/libc.so.6(__libc_start_main+0x89) [0x7f933993f769]
??
??:0
#27 | Hyprland(_start+0x25) [0x5590af74c595]
_start
??:?

Log tail:
[LOG] [CWLSeatProtocol] New seat resource bound at 5590df6b2630
[LOG] [CWLCompositorResource] New wl_surface with id 18 at 5590df6b2a30
[LOG] [CPrimarySelectionManager] New primary selection data device bound at 5590df6339e0
[LOG] [CWLDataDeviceManagerResource] New data device bound at 5590df633bd0
[LOG] [CWLCompositorResource] New wl_surface with id 21 at 5590df6b3270
[LOG] [CXDGShellProtocol] New xdg_wm_base at 5590df62eed0
[LOG] [CWLDataDeviceProtocol] New datamgr resource bound at 5590df5f2800
[LOG] [CPrimarySelectionProtocol] New primary_seletion_manager at 5590df637dd0
[LOG] [CSHMPool] Resizing a SHM pool from 2304 to 6912
[LOG] [CSHMPool] Resizing a SHM pool from 6912 to 16128
[LOG] [CSHMPool] Resizing a SHM pool from 16128 to 34560
[LOG] [CSHMPool] Resizing a SHM pool from 34560 to 71424
[LOG] [CSHMPool] Resizing a SHM pool from 71424 to 145152
[LOG] [CSHMPool] Resizing a SHM pool from 145152 to 292608
[LOG] [CSHMPool] Resizing a SHM pool from 292608 to 587520
[LOG] [CWLSeatProtocol] New seat resource bound at 5590df6c96b0
[LOG] [CWLCompositorResource] New wl_surface with id 18 at 5590df6c9ab0
[LOG] [CPrimarySelectionManager] New primary selection data device bound at 5590df639200
[LOG] [CWLDataDeviceManagerResource] New data device bound at 5590df639330
[LOG] [CWLCompositorResource] New wl_surface with id 21 at 5590df6ca2f0
[LOG] [CXDGShellProtocol] New xdg_wm_base at 5590df639ab0
[LOG] [CWLDataDeviceProtocol] New datamgr resource bound at 5590df4f6fc0
[LOG] [CPrimarySelectionProtocol] New primary_seletion_manager at 5590df63c330
[LOG] [CSHMPool] Resizing a SHM pool from 2304 to 6912
[LOG] [CSHMPool] Resizing a SHM pool from 6912 to 16128
[LOG] [CSHMPool] Resizing a SHM pool from 16128 to 34560
[LOG] [CSHMPool] Resizing a SHM pool from 34560 to 71424
[LOG] [CSHMPool] Resizing a SHM pool from 71424 to 145152
[LOG] [CSHMPool] Resizing a SHM pool from 145152 to 292608
[LOG] [CSHMPool] Resizing a SHM pool from 292608 to 587520
[LOG] [CWLSeatProtocol] New seat resource bound at 5590df6f1ee0
[LOG] [CWLCompositorResource] New wl_surface with id 18 at 5590df6f22e0
[LOG] [CPrimarySelectionManager] New primary selection data device bound at 5590df63d560
[LOG] [CWLDataDeviceManagerResource] New data device bound at 5590df63d680
[LOG] [CWLCompositorResource] New wl_surface with id 21 at 5590df6f2b20
[LOG] [CXDGShellProtocol] New xdg_wm_base at 5590df63e730
[LOG] [CWLCompositorResource] New wl_surface with id 18 at 5590df704af0
[LOG] [CXDGShellProtocol] New xdg_wm_base at 5590df63ebb0
[LOG] [CXDGWMBase] New xdg_surface at 5590df34a500
[LOG] [CXDGSurfaceResource] xdg_surface 5590df63ebb0 gets a toplevel 5590df2fa9f0
[LOG] CWLSurface 5590df67fe60 called init()
[LOG] [CXDGDecoration] unsetMode. Sending MODE_SERVER_SIDE.
[LOG] Window 5590df705220 set title to Passwörter.kdbx [Gesperrt] - KeePassXC
[LOG] Searching for matching rules for (title: Passwörter.kdbx [Gesperrt] - KeePassXC)
[LOG] Window rule suppressevent maximize → class:.* matched [Window 5590df705220: title: “Passwörter.kdbx [Gesperrt] - KeePassXC”]
[LOG] [hookSystem] New hook event registered: windowUpdateRules
[LOG] Window 5590df705220 set class to org.keepassxc.KeePassXC
[LOG] Searching for matching rules for org.keepassxc.KeePassXC (title: Passwörter.kdbx [Gesperrt] - KeePassXC)
[LOG] Window rule suppressevent maximize → class:.* matched [Window 5590df705220: title: “Passwörter.kdbx [Gesperrt] - KeePassXC”]
[LOG] [CXDGDecoration] unsetMode. Sending MODE_SERVER_SIDE.
[LOG] Searching for matching rules for org.keepassxc.KeePassXC (title: Passwörter.kdbx [Gesperrt] - KeePassXC)
[LOG] Window rule suppressevent maximize → class:.* matched [Window 5590df705220: title: “Passwörter.kdbx [Gesperrt] - KeePassXC”]
[LOG] Layout predicts size [Vector2D: x: 0, y: 0] for [Window 5590df705220: title: “Passwörter.kdbx [Gesperrt] - KeePassXC”]
[LOG] [CWLCompositorResource] New wl_region with id 24 at 5590df636930
[LOG] [CXDGSurfaceResource] xdg_surface 5590df34a500 requests geometry 0x0 800x600
[WARN] getMonitorFromVector called with empty monitor list

If I launch Hyprland in systemd using uwsm while there is no physical monitor attached, it immediately crashes. If I launch it directly with an equivalent config, it sits happily without a monitor until I run hyprctl -i 0 output create headless [name]. The only remarkable difference between the logs is that the log for the crashing instance contains as the final line [WARN] getMonitorFromVector called with empty monitor list.

Until just now, I was clueless as to why the systemd version had a problem with being launched without a monitor while the non-systemd version was just fine, but now I am taking this educated guess:

In the non-systemd version, the only autostarted programs are launched with exec-once in the hyprland config, which does not run until there actually is a monitor to display the content on (which I know to be true because of exec-once=hyprctl output create headless virt-1 not working to initialize a headless setup with output).

With systemd however, graphical systemd-services, including those defined by .desktop files in autostart directories (like, say, KeepassXC) are also executed, and they don’t care about no monitor being attached. Hyprland does care however, once it tries to assign the new window to a monitor. And it crashes.

Assuming my guess is correct, my question would now be the following:

Does Hyprland have some built-in way to add virtual outputs directly during startup, or do I need to do some more-or-less hacky workaround like inserting a systemd-service adding an output before any graphical systemd-service that is autostarted?

PS: My guess is almost certainly correct, since I just tried disabling all autostart entries, and now Hyprland launches in systemd. The above question still stands, however.

1 Like

Hm, we do have a way to prevent this, but I think it doesn’t kick in unless there is a monitor unplugged which then results in no monitors.

Try this
patch.txt (389 Bytes)

If I apply this patch, Hyprland always crashes after “Entering unsafe state”, even if started without systemd.

Exemplary crash report

Hyprland Crash Report

“stable”

Hyprland received signal 11(SEGV)
Version: 4e242d086e20b32951fdc0ebcbfb4d41b5be8dcc
Tag: v0.50.1
Date: Sat Jul 19 23:37:06 2025
Flags:

System info:
System name: Linux
Node name: adixdzx15arch
Release: 6.15.7-arch1-1
Version: #1 SMP PREEMPT_DYNAMIC Thu, 17 Jul 2025 21:05:29 +0000

GPU:
00:02.0 Display controller [0380]: Intel Corporation Raptor Lake-S GT1 [UHD Graphics 770] [8086:a780] (rev 04)
03:00.0 VGA compatible controller [0300]: Intel Corporation DG2 [Arc A770] [8086:56a0] (rev 08) (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=[SAD LINK]
SUPPORT_URL=[REDACTED]
BUG_REPORT_URL=[NOT_A_TEAPOT]
PRIVACY_POLICY_URL=[MEANIE_FORUM]
LOGO=archlinux-logo
Backtrace:
# | Hyprland(_Z12getBacktracev+0x46) [0x55ea5bf6c766]
getBacktrace()
??:?
#1 | Hyprland(_ZN14NCrashReporter18createAndSaveCrashEi+0xbca) [0x55ea5be90e2a]
NCrashReporter::createAndSaveCrash(int)
??:?
#2 | Hyprland(+0x3d45e7) [0x55ea5bdf55e7]
handleUnrecoverableSignal(int)
Compositor.cpp:?
#3 | /usr/lib/libc.so.6(+0x3def0) [0x7f058d155ef0]
??
??:0
#4 | Hyprland(_ZN11CCompositor16enterUnsafeStateEv+0x1f0) [0x55ea5be0f8d0]
CCompositor::enterUnsafeState()
??:?
#5 | Hyprland(_ZN11CCompositor10initServerENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi+0x12a3) [0x55ea5be1c0f3]
CCompositor::initServer(std::__cxx11::basic_string<char, std::char_traits, std::allocator >, int)
??:?
#6 | Hyprland(main+0xb19) [0x55ea5bd826d9]
main
??:?
#7 | /usr/lib/libc.so.6(+0x276b5) [0x7f058d13f6b5]
??
??:0
#8 | /usr/lib/libc.so.6(__libc_start_main+0x89) [0x7f058d13f769]
??
??:0
#9 | Hyprland(_start+0x25) [0x55ea5bdf4905]
_start
??:?

Log tail:
[LOG] Creating the XWaylandManager!
[LOG] Creating the SessionLockManager!
[LOG] Creating the HyprDebugOverlay!
[LOG] Creating the HyprNotificationOverlay!
[LOG] Creating the PluginSystem!
[LOG] Creating the DecorationPositioner!
[LOG] Creating the CursorManager!
[hc] CHyprcursorManager: attempting to find theme from env
[hc] themeNameFromEnv: env unset
[hc] CHyprcursorManager: attempting to find any theme
[hc] CHyprcursorManager: no themes matched
[ERR] Hyprcursor failed loading theme “”, falling back to Xcursor.
[LOG] XCursor scanning theme default
[LOG] XCursor parsing index.theme /home/adixdzx15/.icons/default/index.theme
[LOG] XCursor parsing index.theme /usr/share/icons/default/index.theme
[LOG] XCursor theme default inherits Adwaita
[LOG] XCursor scanning theme Adwaita
[LOG] XCursor using theme path /usr/share/icons/Adwaita/cursors
[LOG] XCursor parsing index.theme /usr/share/icons/Adwaita/index.theme
[LOG] XCursor theme Adwaita inherits AdwaitaLegacy
[LOG] XCursor theme Adwaita inherits hicolor
[LOG] XCursor scanning theme Adwaita
[LOG] XCursor using theme path /usr/share/icons/Adwaita/cursors
[LOG] XCursor parsing index.theme /usr/share/icons/Adwaita/index.theme
[LOG] XCursor theme Adwaita inherits AdwaitaLegacy
[LOG] XCursor theme Adwaita inherits hicolor
[LOG] XCursor scanning theme AdwaitaLegacy
[LOG] XCursor parsing index.theme /usr/share/icons/AdwaitaLegacy/index.theme
[LOG] XCursor theme AdwaitaLegacy inherits hicolor
[LOG] XCursor scanning theme hicolor
[LOG] XCursor parsing index.theme /usr/share/icons/hicolor/index.theme
[LOG] XCursor already has a shape default loaded, skipping
[LOG] XCursor already has a shape context-menu loaded, skipping
[LOG] XCursor already has a shape help loaded, skipping
[LOG] XCursor already has a shape pointer loaded, skipping
[LOG] XCursor already has a shape progress loaded, skipping
[LOG] XCursor already has a shape wait loaded, skipping
[LOG] XCursor failed to find a legacy shape with name plus, skipping
[LOG] XCursor already has a shape crosshair loaded, skipping
[LOG] XCursor already has a shape text loaded, skipping
[LOG] XCursor already has a shape vertical-text loaded, skipping
[LOG] XCursor failed to find a legacy shape with name dnd-link, skipping
[LOG] XCursor failed to find a legacy shape with name dnd-copy, skipping
[LOG] XCursor already has a shape move loaded, skipping
[LOG] XCursor failed to find a legacy shape with name dnd-none, skipping
[LOG] XCursor failed to find a legacy shape with name crossed_circle, skipping
[LOG] XCursor already has a shape grab loaded, skipping
[LOG] XCursor already has a shape grabbing loaded, skipping
[LOG] XCursor already has a shape e-resize loaded, skipping
[LOG] XCursor already has a shape n-resize loaded, skipping
[LOG] XCursor already has a shape ne-resize loaded, skipping
[LOG] XCursor already has a shape nw-resize loaded, skipping
[LOG] XCursor already has a shape s-resize loaded, skipping
[LOG] XCursor already has a shape se-resize loaded, skipping
[LOG] XCursor already has a shape sw-resize loaded, skipping
[LOG] XCursor already has a shape w-resize loaded, skipping
[LOG] XCursor already has a shape ew-resize loaded, skipping
[LOG] XCursor already has a shape ns-resize loaded, skipping
[LOG] XCursor already has a shape nesw-resize loaded, skipping
[LOG] XCursor already has a shape nwse-resize loaded, skipping
[LOG] XCursor already has a shape col-resize loaded, skipping
[LOG] XCursor already has a shape row-resize loaded, skipping
[LOG] XCursor already has a shape all-scroll loaded, skipping
[LOG] XCursor already has a shape zoom-in loaded, skipping
[LOG] XCursor already has a shape zoom-out loaded, skipping
[LOG] Creating the VersionKeeper!
[LOG] CVersionKeeperManager: Read version 0.50.1 matches or is older than running.
[LOG] Creating the DonationNag!
[LOG] DonationNag: last nag was 26 days ago, too early for a nag.
[LOG] Creating the ANRManager!
[LOG] Starting XWayland
[LOG] Starting up the XWayland server
[LOG] XWayland found a suitable display socket at DISPLAY: :0
[LOG] Entering unsafe state

Though I should probably add that I basically Frankenstein’ed this patch into my system by cloning, patching, making and installing Tag v0.50.1 into my pacman-managed hyprland structure. This should not cause trouble since I followed the Arch-official PKGBUILD (and as far as I know, installing via pacman does little more than copying prebuilt files into the filesystem), but I am am still mentioning it for the records.

derp
patch.txt (343 Bytes)

try this

That seems to have worked. Systemd-based Hyprland now starts with autostart programs in headless mode. Thanks!
And I even learned how to POSIX and automate the creation of headless outputs by now.

1 Like

I’ve committed the patch. Cheers.

1 Like