Proof Portal
Omarchy
ProbeLabs65 findings · 95 requirementsA proof layer — requirements, tests and verified fixes — for two of Omarchy's subsystems: the application menu (launcher scripts, QML model, JSONC config, search and selection) and the lock screen (lock scripts, QML, PAM authentication). Scope is deliberately limited to those components of omacom/omarchy; the rest of the distribution is not covered.
Plugin watcher outlives a shell crash, leaking an inotifywait each time until inotify instances are exhausted
Reported by chadmandoo · filed Sep 11, 2026Closed upstream on 2026-09-21 by bjarneo via an automated message, as a duplicate of #7150 (R-1759). GitHub close reason: completed.
At a glance
- 1 · What is claimed?
- Only the report text below — no validator has restated it as checkable claims yet.
- 2 · What does it affect?
- Not yet mapped to any requirement or component.
- 3 · Is it reproducible?
- No validation has been run yet.
- 4 · What remains unclear?
- Not validated yet: no claims, no reproducer.
- 5 · What happens next?
- Our staff decide whether the report is valid. Where this project allows it, agents decide whether it duplicates another report or a known issue. No decision has been recorded yet.
Original report
PluginRegistry spawns the local-plugin watcher as a Quickshell Process, but nothing ties that child to the shell's lifetime. When the shell exits without running destructors, the inotifywait survives and is reparented to systemd --user. Every such exit strands one more.
They accumulate against fs.inotify.max_user_instances (1024 per UID). Once it fills, inotify_init1() returns EMFILE for the whole user session, and the failure surfaces in whatever application next asks for a watch. In my case that was Alacritty refusing to start with "too many open files" — Alacritty was the messenger, not the cause.
Why the child outlives the shell
shell/services/PluginRegistry.qml:
property Process localPluginWatcher: Process {
command: [
"inotifywait", "-m", "-r", "-q",
"-e", "close_write,create,delete,move",
"--format", "%w%f",
registry.pluginsDir
]
...
onExited: localPluginWatcherRestart.restart()
}An in-process cleanup can't cover this, because the relevant exits are exactly the ones that skip destructors. bin/omarchy-launch-shell already documents the mode:
Quickshell relaunches itself from its signal handlers, but Qt leaves through _exit() when the Wayland connection fails, raising no signal: no crash report, no relaunch, no bar.A deliberate omarchy-restart-shell does stop the watcher cleanly — I measured an unpatched shell across a restart and it left no orphan — so this is the crash path specifically, where no destructor runs.
Reproduction
Three lines of QML, no Omarchy needed:
// /tmp/leaktest/shell.qml
import Quickshell
import Quickshell.Io
ShellRoot {
Process { running: true; command: ["sleep", "873"] }
}quickshell -p /tmp/leaktest/shell.qml &
QS=$!
sleep 3
pgrep -f 'sleep 873' # child exists
kill -9 $QS # die without destructors
sleep 2
pgrep -f 'sleep 873' # still there, now reparented to systemd --userObserved
One shell instance (single Shell ID), 4437 relaunches over roughly 24 hours, driven by a lock-path crash loop while the session sat locked. That left 979 stranded inotifywait processes, all watching ~/.config/omarchy/plugins, all reparented to systemd --user, and the user at 1025 of 1024 inotify instances.
Counting them:
find /proc/[0-9]*/fd -lname 'anon_inode:inotify' 2>/dev/null | wc -l
pgrep -u "$UID" -x inotifywait | wc -lWorth noting the existing relaunch limiter in bin/omarchy-launch-shell does not catch this. It allows 5 relaunches per 60-second window before giving up, and resets the window on expiry. The loop I hit crashed about every 13 seconds, so attempts never reached 6 before window_started reset. A loop slower than 5/minute can run indefinitely inside the limit, which is what turned one crash into 4437.
Proposed fix
Have the kernel do it, since it's the only thing guaranteed to run when Qt calls _exit():
command: [
"setpriv", "--pdeathsig", "TERM",
"inotifywait", "-m", "-r", "-q",
...
]setpriv is part of util-linux, so it's already present.
Tested both ways through Quickshell's real spawn path with the reproduction above (Quickshell 0.3.1, Omarchy 4.0.3):
child after kill -9 of the shell | |
|---|---|
| current | survives — leaked |
with --pdeathsig TERM | dies with the shell |
Also verified that it doesn't regress the watcher: inotifywait under setpriv still reports create and close_write events normally, and the child was still alive after 12 seconds with the shell running, so PDEATHSIG isn't firing early on the spawning thread.
PR follows.
Out of scope here
The crash that drove my loop looks like it belongs to Quickshell, not Omarchy — the shell dies in lock-surface creation when the session is locked and the compositor has no valid Wayland output (Could not create EGL surface (EGL error 0x3000), then The Wayland connection experienced a fatal error: Invalid argument). That string isn't in this repo. This issue is only about the watcher outliving the shell, which is worth fixing regardless of what kills it.
View raw text
`PluginRegistry` spawns the local-plugin watcher as a Quickshell `Process`, but nothing ties that child to the shell's lifetime. When the shell exits without running destructors, the `inotifywait` survives and is reparented to `systemd --user`. Every such exit strands one more.
They accumulate against `fs.inotify.max_user_instances` (1024 per UID). Once it fills, `inotify_init1()` returns `EMFILE` for the whole user session, and the failure surfaces in whatever application next asks for a watch. In my case that was Alacritty refusing to start with "too many open files" — Alacritty was the messenger, not the cause.
## Why the child outlives the shell
`shell/services/PluginRegistry.qml`:
```qml
property Process localPluginWatcher: Process {
command: [
"inotifywait", "-m", "-r", "-q",
"-e", "close_write,create,delete,move",
"--format", "%w%f",
registry.pluginsDir
]
...
onExited: localPluginWatcherRestart.restart()
}
```
An in-process cleanup can't cover this, because the relevant exits are exactly the ones that skip destructors. `bin/omarchy-launch-shell` already documents the mode:
> Quickshell relaunches itself from its signal handlers, but Qt leaves through `_exit()` when the Wayland connection fails, raising no signal: no crash report, no relaunch, no bar.
A deliberate `omarchy-restart-shell` does stop the watcher cleanly — I measured an unpatched shell across a restart and it left no orphan — so this is the crash path specifically, where no destructor runs.
## Reproduction
Three lines of QML, no Omarchy needed:
```qml
// /tmp/leaktest/shell.qml
import Quickshell
import Quickshell.Io
ShellRoot {
Process { running: true; command: ["sleep", "873"] }
}
```
```bash
quickshell -p /tmp/leaktest/shell.qml &
QS=$!
sleep 3
pgrep -f 'sleep 873' # child exists
kill -9 $QS # die without destructors
sleep 2
pgrep -f 'sleep 873' # still there, now reparented to systemd --user
```
## Observed
One shell instance (single Shell ID), 4437 relaunches over roughly 24 hours, driven by a lock-path crash loop while the session sat locked. That left 979 stranded `inotifywait` processes, all watching `~/.config/omarchy/plugins`, all reparented to `systemd --user`, and the user at 1025 of 1024 inotify instances.
Counting them:
```bash
find /proc/[0-9]*/fd -lname 'anon_inode:inotify' 2>/dev/null | wc -l
pgrep -u "$UID" -x inotifywait | wc -l
```
Worth noting the existing relaunch limiter in `bin/omarchy-launch-shell` does not catch this. It allows 5 relaunches per 60-second window before giving up, and resets the window on expiry. The loop I hit crashed about every 13 seconds, so `attempts` never reached 6 before `window_started` reset. A loop slower than 5/minute can run indefinitely inside the limit, which is what turned one crash into 4437.
## Proposed fix
Have the kernel do it, since it's the only thing guaranteed to run when Qt calls `_exit()`:
```qml
command: [
"setpriv", "--pdeathsig", "TERM",
"inotifywait", "-m", "-r", "-q",
...
]
```
`setpriv` is part of util-linux, so it's already present.
Tested both ways through Quickshell's real spawn path with the reproduction above (Quickshell 0.3.1, Omarchy 4.0.3):
| | child after `kill -9` of the shell |
|---|---|
| current | survives — leaked |
| with `--pdeathsig TERM` | dies with the shell |
Also verified that it doesn't regress the watcher: `inotifywait` under `setpriv` still reports `create` and `close_write` events normally, and the child was still alive after 12 seconds with the shell running, so `PDEATHSIG` isn't firing early on the spawning thread.
PR follows.
## Out of scope here
The crash that drove my loop looks like it belongs to Quickshell, not Omarchy — the shell dies in lock-surface creation when the session is locked and the compositor has no valid Wayland output (`Could not create EGL surface (EGL error 0x3000)`, then `The Wayland connection experienced a fatal error: Invalid argument`). That string isn't in this repo. This issue is only about the watcher outliving the shell, which is worth fixing regardless of what kills it.
Validation
Not checked yet. A validator will restate this report as checkable claims, map it to the project's requirements and write a reproducer that the proof engine runs.
Linked
Not linked to any known issue, other report or change yet.
Decision
Decisions are recorded by our staff — or, where this project allows it, by agents: checked by a second, independent agent, or by a single agent where the project's policy says so. Any decision reached so far is shown below.
No decision has been recorded yet.