proc_spawn_exec_raw remaps stdin, stdout and stderr sequentially. _proc_dup_child_fd closes each source fd immediately after dup2. Passing the same nonstandard fd for both stdout and stderr therefore closes it after the first mapping; the second dup2 uses a closed fd and the child exits with PROC_EXIT_DUP_FAIL. Mappings that swap standard descriptors can also overwrite a source before it is used.
Combining stdout/stderr onto one pipe is a normal subprocess use case.
Code evidence:
Acceptance:
Audit status: static source inspection against canonical master ea74c2dafc31da876e5561f2d176ba719f5a0458 on 2026-09-10. No compiler build, test execution, implementation change or local reproduction was performed for this report. The examples describe the source-derived behavior to verify when implementing the fix.
proc_spawn_exec_rawremaps stdin, stdout and stderr sequentially._proc_dup_child_fdcloses each source fd immediately after dup2. Passing the same nonstandard fd for both stdout and stderr therefore closes it after the first mapping; the second dup2 uses a closed fd and the child exits with PROC_EXIT_DUP_FAIL. Mappings that swap standard descriptors can also overwrite a source before it is used.Combining stdout/stderr onto one pipe is a normal subprocess use case.
Code evidence:
Acceptance:
Audit status: static source inspection against canonical master
ea74c2dafc31da876e5561f2d176ba719f5a0458on 2026-09-10. No compiler build, test execution, implementation change or local reproduction was performed for this report. The examples describe the source-derived behavior to verify when implementing the fix.