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] Function-local ERR trap never fires (only checks final status) #1163
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] Function-local ERR trap never fires unless the failing command is the function's last and the function ends non-zero — HIGH
f() { trap'echo ERRTRAP' ERR;false;echo hello; }
f
echo outer-rc=$?# GNU bash 5.3: ERRTRAP / hello / outer-rc=0# niu: hello / outer-rc=0 (no fire)
Variants: false; true, $?-read after, two failures → bash fires twice / niu zero times, subshell failure inside function, bare-return action (bash E|outer-rc=1, niu inner|outer-rc=0), exit-action (bash exits 42, niu prints never|after-0). niu behaves as if it checks only the function's final status at exit instead of firing per failing command. Silent trap loss.
Env: niubash 1.4.4 / rubash engine (master ~2026-10), GNU bash 5.3.20 aarch64-linux-android as oracle.
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
caomengxuan666 commentedon Oct 23, 2026
Triage vs current master (e743db8, release build): no longer reproduces — function-local ERR trap now fires per failing command.
Fixed by #1181. Closing.