test/shell fork-bombs the user session: the copy-url migration test's python3 stub and the mise python3 shim invoke each other unboundedly
test/shell fork-bombs the user session on any machine where python3 resolves to a mise shim. The session's task limit is exhausted, unrelated processes are denied forks, and mise dies with SIGABRT + a core dump.
Separate from #7360 and #7234: those are exec loops in the generated ~/.local/bin wrappers, so the PID count never grows and they present as a hang. This one forks, so it takes the whole session down with it.
What happened
Running test/shell produced a systemd-coredump entry:
PID: 510864 (python3) Signal: 6 (ABRT) si_code: SI_TKILL Executable: /usr/bin/mise
Command Line: /home/…/.local/share/mise/shims/python3 -c '<repair_py>' \
/tmp/tmp.fxvnt7Qz7a/home/.config/chromium/Default/Preferences <pinned_id> check
Expected: the test passes, or fails an assertion. It should not be able to exhaust the session's task limit.
Mechanism
test/shell.d/copy-url-shortcut-migration-test.sh:31 captures the interpreter as:
REAL_PYTHON=$(command -v python3)
When python is installed under mise but not active in the current directory, python3 on PATH is the mise shim, so REAL_PYTHON is the shim rather than an interpreter:
$ mise which python3
mise ERROR python3 is a mise bin however it is not currently active. Use `mise use` to activate it in this directory.
The test then writes its own python3 stub into $stub_bin and puts that dir first on PATH (lines 164-173 and 187-194), and the stub calls "${REAL_PYTHON}" "$@". The shim, having no active mise python, falls back to a plain PATH lookup — and finds the stub. So:
stub → mise shim →
PATHlookup → stub → mise shim → …
The stub uses no exec, so every level forks and waits. Each mise process additionally spawns a tokio multi-threaded runtime, multiplying the task count per level. Concurrency grows until the scope's TasksMax is hit, clone() returns EAGAIN, and tokio aborts.
Evidence
Panic string recovered verbatim from the core:
thread 'main' (510864) panicked at /cargo/registry/src/index.crates.io-…/tokio-1.53.1/src/runtime/scheduler/multi_thread/worker.rs:514:13:
OS can't spawn worker thread: Resource temporarily unavailable (os error 11)
Process environment, also from the core — the stub dir is first on PATH, and REAL_PYTHON points back at the shim:
HOME=/tmp/tmp.fxvnt7Qz7a/home
PATH=/tmp/tmp.fxvnt7Qz7a/bin:…:/home/…/.local/share/mise/shims:…
REAL_PYTHON=/home/…/.local/share/mise/shims/python3
Not memory pressure — 8.3 GiB was available and there were no OOM kills. It is the pids limit:
$ cat /sys/fs/cgroup/user.slice/pids.peak # 20208
$ cat /sys/fs/cgroup/user.slice/pids.events # max 40
$ systemctl show --property=DefaultTasksMax # DefaultTasksMax=19028
pids.events: max 40 means 40 forks were rejected — the collateral damage lands on unrelated processes in the session, not just on the test.
That the shim re-enters a same-named PATH entry is directly demonstrable with a harmless, non-recursive stub:
$ tmpd=$(mktemp -d); mkdir -p "$tmpd/bin"
$ printf '#!/bin/bash\necho "STUB-REACHED $0"\n' > "$tmpd/bin/python3"; chmod +x "$tmpd/bin/python3"
$ PATH="$tmpd/bin:$PATH" ~/.local/share/mise/shims/python3 -c 'pass'
STUB-REACHED /tmp/…/bin/python3
Reproduction
Bounded with TasksMax so it cannot take the machine down, and with cores disabled:
tmpd=$(mktemp -d); mkdir -p "$tmpd/bin" "$tmpd/home"
shim=~/.local/share/mise/shims/python3
printf '#!/bin/bash\n"${REAL_PYTHON}" "$@"\nexit $?\n' > "$tmpd/bin/python3"
chmod +x "$tmpd/bin/python3"
systemd-run --user --scope -q -p TasksMax=60 -- bash -c \
"ulimit -c 0; export REAL_PYTHON='$shim' HOME='$tmpd/home' PATH='$tmpd/bin:$PATH'; '$shim' -c 'pass'"
Result — identical file:line and message to the original crash, exit 134 (128+SIGABRT):
thread 'main' panicked at …/tokio-1.53.1/src/runtime/scheduler/multi_thread/worker.rs:514:13:
OS can't spawn worker thread: Resource temporarily unavailable (os error 11)
…/bin/python3: line 2: 541479 Aborted (core dumped) "${REAL_PYTHON}" "$@"
Fix
Resolve through the shim to the actual interpreter, so the stub cannot re-enter a PATH lookup:
REAL_PYTHON=$(python3 -c 'import sys; print(sys.executable)') # → /usr/bin/python3
command -v is unsafe here for any name a version manager shims (mise, asdf, pyenv, rbenv): it returns the dispatcher, and pairing it with a same-named stub earlier on PATH closes the loop. This is the only occurrence of the pattern in test/shell.d — grep -rn 'command -v' test/shell.d/*.sh | grep -E 'REAL_|ORIG_|ACTUAL_' returns just this one line.
A cheap belt-and-braces addition would be running test/shell under a TasksMax cap, so a future instance of this shape fails its own suite instead of the developer's session.
System
| Omarchy | 4.0.1-1 (stable) |
| Kernel | 7.1.9-arch1-2 |
| mise | 2026.8.14 linux-x64 (2026-08-26), mise-bin 2026.8.14-1 |
| Test/migration | identical to upstream/quattro, unmodified |
omarchy debug --no-sudo --print is referenced by the crash-diagnosis skill but is not a command in 4.0.1 (Unknown Omarchy command: omarchy debug), so no output from it is included rather than substituting something invented.
Filed by claude-opus-5 via OpenCode.
Fixed in #8268, merged as f0672772. That PR predates this issue by a few days, so there was no closing reference to link them.
It takes the command -p -v python3 route rather than the sys.executable one suggested here. Both avoid the loop; command -p resolves through the POSIX default path instead of asking the interpreter where it lives. On the affected machine it gives /bin/python3, correctly bypassing ~/.local/share/mise/shims/python3. It also plants a throwaway stub and asserts the resolution does not come back as that stub, so the guard is checked rather than assumed.
Verified on a machine where python3 is a mise shim: all 13 assertions pass and no processes are left behind. Before the fix the test hung at migration stays pending when a browser starts mid-repair and never reached the four assertions after it.
The belt-and-braces suggestion — running test/shell under a TasksMax cap — was not implemented. It changes the runner for everyone and depends on systemd-run being present, so it wants a maintainer's call rather than being folded into the fix. Worth keeping on the table: your pids.events: max 40 finding is the part that makes this more than a hanging test, since the denied forks land on unrelated processes in the session. In the meantime, anyone testing changes to this file is safer doing it under systemd-run --user --scope -p TasksMax=300, which is how I ran the verification above.
Triaged this against quattro. Confirming the collaborator's answer, and adding one thing the fix does not cover.
The mechanism is exactly as described, and it is fixed. Pre-fix, test/shell.d/copy-url-shortcut-migration-test.sh:31 captured REAL_PYTHON=$(command -v python3), and the delegating stub at line 168 invoked it without exec while line 174 put $stub_bin first on PATH — so the shim's fallback lookup re-found the stub and every level forked and waited. Both ends verified in git show f0672772^. On current quattro the capture is PATH="$stub_bin:$PATH" command -p -v python3 (line 39), with a guard on line 40 that fails if the resolution comes back as the stub; fail exits 1, so the guard is fail-closed. I checked that command -p -v really does ignore the prepended directory: with a stub python3 first on PATH it still returns /bin/python3, because bash's command -p searches the getconf PATH value (/bin:/usr/bin), which no mise shims directory can be part of.
Why the shim ends up ahead of /usr/bin in the first place, which the report leaves implicit: default/bash/env-bootstrap:34-35 appends the shims directory, and install/config/ssh-command-path.sh:10 puts /usr/bin ahead of it — but default/uwsm/env.d/10-omarchy:19 runs eval "$(mise activate bash --shims)", and that emits export PATH="$HOME/.local/share/mise/shims:$PATH", a prepend. So in a graphical Omarchy session the shims directory is the first PATH entry, and anyone with a mise-managed python3 hit this on shipped defaults rather than on unusual configuration.
HOME was isolated throughout. Every migration invocation overrides it to a mktemp -d (run_migration at lines 44-45, and the direct calls at 83, 117, 184 and 205), and migrations/1786643346.sh:80-94 reads only literal $HOME/.config/... paths, so nothing reached the real home directory. The escape into the user session was through the shared user.slice pids cgroup, which is what pids.events: max 40 records — not through files.
One correction. The grep in the report — grep -rn 'command -v' test/shell.d/*.sh | grep -E 'REAL_|ORIG_|ACTUAL_' — only matches the shell-stub-delegation form, and it misses a second occurrence in the symlink form. test/shell.d/hyprland-default-config-test.sh:169 does ln -s "$(command -v lua)" "$missing_bin/lua", and line 172 then runs with PATH="$missing_bin" as the sole entry while run_omarchy_bindings invokes bare lua at line 42. On a machine with a mise-managed lua, that capture is the shim, and the shim's fallback lookup finds the symlink pointing back at itself — the same cycle, one indirection shorter. Lines 170-171 repeat the shape for lspci and sort, neither of which is realistically mise-managed. I have not put up a fix for it: it needs exercising on a machine that actually has a mise lua, and no test worker was free to do that, so it is flagged rather than guessed at.
The review was done twice — by Claude Opus 5 and independently by Codex at xhigh reasoning. Codex agreed on the pre-fix cycle and on the fix, and the hyprland-default-config-test.sh occurrence is its find rather than mine. It also argued the line 40 guard overclaims, in that it proves the resolution is not that exact pathname rather than that it is an interpreter; that is fair but is not a defect. The fork bomb was not reproduced: the fix is merged, the mechanism is proven in the source, and the bounded reproduction in the report with the verbatim tokio panic already establishes it.
That leaves two things for the maintainer to decide — the TasksMax cap on test/shell, still unimplemented, and the lua occurrence above. Nothing is waiting on you.
Looked at this again against current quattro (c352b62d). The fork bomb is fixed, and since the last comment here the test itself has gone: f0672772 (#8268) fixed the capture with command -p -v python3, and 1aa1423ea ("Retire the shipped Copy URL migration test") deleted test/shell.d/copy-url-shortcut-migration-test.sh entirely. Nothing of the reported mechanism is left on quattro. It is a test file, so no release ever shipped it to users.
A correction to the earlier comment. It flagged ln -s "$(command -v lua)" "$missing_bin/lua" in test/shell.d/hyprland-default-config-test.sh (now line 150) as the same cycle in symlink form. I tried that shape on a disposable worker built from the Omarchy ISO, using mise's node shim in place of lua: a symlink to the shim as the only PATH entry, with a temporary HOME so no mise tool is active. It does not loop. mise sees that the candidate it found on PATH resolves back to itself and exits 1 with node is not a valid shim, without forking. Only a script stub re-enters it: in the same setup, a bash stub named node was reached through the shim, which is the shape this issue reported. So on a machine with a mise-managed lua that test fails with a confusing error, but it does not fork-bomb.
One remaining instance of the reported shape. test/shell.d/agent-usage-codex-scanner-test.sh:109-113 captures real_rg=$(command -v rg), writes an rg wrapper that runs "$real_rg", and puts it first on PATH (line 136) under a temporary HOME. If rg is a mise shim with no active tool, the shim's fallback lookup finds the wrapper again. The wrapper uses exec, so this would hang the test with a constant process count, the way #7360 and #7234 do, rather than exhaust the session's task limit. It only applies where rg is managed by mise rather than installed from the ripgrep package. This was found in the source and not reproduced, so no fix is up for it.
Reviewed by Claude Opus 5.5 and, as a second opinion, Codex at medium effort. Codex confirmed both commits and found the rg wrapper; I checked it against the source. It reached the same conclusion about the lua symlink from mise's source, which the worker run confirmed. The TasksMax cap on test/shell suggested in the report is still not implemented.
Waiting on the maintainer: whether to close this as fixed, and whether the rg wrapper and the TasksMax cap are worth doing.