You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug] Background job with redirect runs under --internal-bg-wrapper: signals never reach job traps #1033
P1-high高:核心语义或高频路径受损,影响日常使用/发布area:jobsjobs, signals, process ownership, coprocbugSomething isn't workingfamily:S9taxonomy S9: trap/job/signal - no subprocess ownership modelgnu-baselineTracked by the GNU Bash 5.3.0 true-baseline ledger
[bug] Background job WITH redirect runs under --internal-bg-wrapper: signals never reach the job's traps (HIGH)
# c.sh:trap'echo GOTTERM; exit 42' TERM
echo READY
sleep 30 &wait$!# driver (parent shell): <parent> c.sh >o.txt 2>&1 & P=$!; wait READY; kill -TERM $P; wait $P# bash parent: bg pid is the real job; GOTTERM printed; wait rc=42# niu parent: bg pid is `niu --internal-bg-wrapper=...`; NO GOTTERM; wait rc=143
Any redirect on the bg job (>o.txt, also 2>&1) triggers the wrapper; bare sleep 30 & runs direct and reaps clean. kill/wait act on the wrapper, the TERM never reaches the real job's trap. Observed fallout: orphaned sleep 30 with PPID=1 surviving minutes after the parent died (leaked processes).
Env: niubash 1.4.4 / rubash engine (master ~2026-10), GNU bash 5.3.20 aarch64-linux-android as oracle.
Verified fixed on master (a55e4d6) — fixed by 55cc97f 'fix(jobs): redirected simple background externals spawn directly, not via the -c wrapper (#1033)'.
Driver repro against release build of current master (rubash c.sh >o.txt 2>&1 & P=$!; kill -TERM $P; wait $P where c.sh traps TERM → 'echo GOTTERM; exit 42'):
wait-rc=42
READY
GOTTERM
Matches GNU bash 5.3.20 exactly: the bg pid is the real job, TERM reaches the trap, wait returns 42. No orphaned sleep observed (checked tasklist after the run).
P1-high高:核心语义或高频路径受损,影响日常使用/发布area:jobsjobs, signals, process ownership, coprocbugSomething isn't workingfamily:S9taxonomy S9: trap/job/signal - no subprocess ownership modelgnu-baselineTracked by the GNU Bash 5.3.0 true-baseline ledger
Activity
github-actions commentedon Oct 22, 2026
欢迎!这是你在本仓库的第一个 ISSUE 🎉 维护者会尽快跟进;报 bug 请附
rubash --version、系统平台与最小复现脚本。caomengxuan666 commentedon Oct 23, 2026
Verified fixed on master (a55e4d6) — fixed by 55cc97f 'fix(jobs): redirected simple background externals spawn directly, not via the -c wrapper (#1033)'.
Driver repro against release build of current master (
rubash c.sh >o.txt 2>&1 & P=$!; kill -TERM $P; wait $Pwhere c.sh traps TERM → 'echo GOTTERM; exit 42'):Matches GNU bash 5.3.20 exactly: the bg pid is the real job, TERM reaches the trap, wait returns 42. No orphaned sleep observed (checked tasklist after the run).