Repository navigation
Segfault in --verify-config when a config uses hl.timer() #16562
Replies: 2 comments
|
This discussion has been automatically closed. |
0 replies
|
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
--verify-configsegfaults on any Lua config that callshl.timer(). It dies inCEventLoopManager::removeTimer()during teardown, because in verify mode theglobal event loop manager is never constructed but is still dereferenced.
This is the same defect class as #15405 (layout providers), but on the timer
teardown path. Appears unfixed on
mainas of today.Version
hyprland 0.56.2-2), latest releasemain(commit as of 2026-10-15) — line 505 ofsrc/config/lua/ConfigManager.cppis unchangedReproduction
sigsegv.lua:Control case — confirms the trigger
Same config, timer line removed:
So the
hl.timer()call alone is sufficient to trigger it.type = "repeat"and a timer that is immediately
set_enabled(false)behave identically — thecrash happens in teardown regardless of timer mode or whether it ever fires.
Backtrace
SEGV_MAPERRwith no other threads in the process.Root cause
CCompositor::initServer()(src/Compositor.cpp) returns early in verify mode,before
initManagers(STAGE_PRIORITY)runs — and that is what constructs theevent loop manager:
main()then resets the config manager, whose destructor tears the timers down(
src/main.cpp):cleanTimers()calls through the global that was never created(
src/config/lua/ConfigManager.cpp):g_pEventLoopManageris a nullCUniquePointer, so this is a null dereference.It only triggers when
m_luaTimersis non-empty, i.e. when the config actuallycreated at least one timer — which is why most configs verify fine.
There is a related variant that crashes slightly earlier, during config load
rather than teardown, when a timer is created and something schedules a recalc:
Same underlying cause: null
g_pEventLoopManagerin verify mode.Proposed fix
Guard the call in
cleanTimers():scheduleRecalc()has the same exposure and would want the same treatment.Alternatively, constructing the
CEventLoopManagerbefore them_onlyConfigVerificationearly return would fix the whole class at once, sinceit is the only manager that path assumes exists.
Note the normal (non-verify) shutdown path is not affected, and appears to be
safe by ordering alone:
CCompositor::cleanup()resetsConfig::mgr()at line616 but
g_pEventLoopManagerat line 625, so teardown still has a live manager.Only the verify path resets the config manager without one.
Impact
--verify-configis unusable as a config validator on any config that useshl.timer(). This affects shipped defaults, not just hand-written configs — e.g.Omarchy's
default/hypr/bindings/clipboard.luacreates a oneshot timer, sohyprland --verify-configsegfaults on a stock Omarchy config too.Filed by Space Bunny Free via OpenCode.
All reactions