Repository navigation
fix(executor): scope in-process ${THIS_SH} child's exit-trap latch to the child (Refs #3605) - #3670
Merged
Merged
Conversation
… the child (Refs #3605) run-trap tail: ${THIS_SH} ./trap6.sub ran the child's EXIT trap on the shared executor, latching exit_trap_ran; the parent's later `trap 'echo exiting' 0; exit` then never fired. GNU: a `bash script` child is a fresh process (execute_cmd.c:6139 execute_disk_command forks and execs), and run_exit_trap (trap.c:1027-1050) keys on the child's own sigmodes[EXIT_TRAP] — its SIG_TRAPPED/SIG_INPROGRESS never touch the parent's. execute_direct_shell_script now parks the parent's latch and clears it for the fresh-shell child, restoring it after the child's run_exit_trap_for_status (external_finish.rs), mirroring the save/restore contract the other per-process state already holds at this boundary. Verified on macOS (niubash GNU gate): run-trap PASS (was: missing final 'exiting'), run-glob-bracket PASS, no regressions. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This was referenced Nov 15, 2026
Member
Author
|
【WIN-AGENT-AUDIT】 机制核查:
F 点:
腿(逐项给数字与名字):
F 点结论:F1 废钉是硬伤(规程:base 全绿的钉 = 废钉 = FAIL 点)。建议改法:把钉改成能进入 in-process 仿真的形状(库内 Executor/Session、不启用 real shell children;或 ENOEXEC 无 shebang 脚本在 CLI 下走的那条仿真),并让它在 base 上确实红。 未跑/VOID 的腿:钉的 Windows 原样运行为 0 tests( |
Member
Author
|
【WIN-AGENT-AUDIT】 机制核查:
腿(逐项给数字与名字):
F 点:无 续作记录:
未跑/VOID 的腿:无 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refs #3605 (macOS gate,
run-trap).trap.testsends withtrap 'echo exiting' 0; exit, but niu printed nothing: an earlier${THIS_SH} ./trap6.sub/./trap9.subrun had already fired an EXIT trap on the shared executor, latchingexit_trap_ran, so the parent's re-armed trap was dropped.bash scriptchild is a fresh process (execute_cmd.c:6139execute_disk_commandforks and execs);run_exit_trap(trap.c:1027-1050) keys on the child's ownsigmodes[EXIT_TRAP]— itsSIG_TRAPPED/SIG_INPROGRESSnever touch the parent.execute_direct_shell_script(src/executor/external_finish.rs) emulates that boundary in-process for library hosts: it now parks the parent'sexit_trap_ran, clears it for the fresh-shell child, and restores it after the child'srun_exit_trap_for_status— the same save/restore contract the other per-process state already holds at this boundary.Verified (macOS, niubash GNU gate)
run-trap: PASS (was: missing finalexiting— output now byte-identical totrap.right)run-glob-bracket: PASS, no regressiontests/issue3605_this_sh_child_exit_trap.rspins the parent-latch isolation across one and multiple in-process${THIS_SH}children.