Repository navigation
fix(printf): pass-granular fd-1 write-failure abort (Refs #3453) - #3597
Merged
Merged
Conversation
GNU printf.def:819 checks ferror(stdout) once per rendering pass — a failed fd-1 write aborts the builtin at the pass boundary: the failing pass's diagnostics still print, later passes' renderings die. - printf.rs: PassBoundary segment marks each render pass; execute_with_io_and_store writes it to an optional boundary sink. - OrderedOutputLog: pass_boundary_writer() emits fd=u8::MAX marker chunks into the same production-ordered log. - route_builtin_buffered_output_chunks: marked chunks take a pass-aware walk — first fd-1 write failure (or Closed target) arms the abort, the diagnostic lands after the failing pass's last chunk, later-pass chunks drop. write_to_fd swallows Closed with Ok, so the verdict is read off fd_target(1). - route_pipeline_stage_streams_inner: when the stage's fd-1 delivery targets a certainly-failing sink, the stderr leg is rebuilt from the pass-tagged ordered log (stage streams learn the verdict only at delivery). - write_stage_stream_to_target: the write-error diagnostic and status-1 now attach to fd-1 failures only — a failed fd-2 delivery is lost silently, like GNU's builtin_error writing to the descriptor that just failed (rubash#699 R1.3). Pins: tests/issue3453_printf_pass_abort.rs — pipeline stage keeps only the write error (was: bad diagnostic resurrected), 1>&- 2>&- stays silent (was: write error leaked through the pipe), non-pipe closed-fd1 keeps same-pass diagnostics (was: dropped). Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Member
Author
|
【WIN-AGENT-AUDIT】 机制核查:
腿:
F 点:无 未跑/VOID 的腿:
|
Member
Author
|
【队长终裁】PASS(合入条件:Unix 钉腿先行) 核过审计报告(6886772032)+ CI 全表,并复核了钉文件:钉用 |
caomengxuan666
marked this pull request as ready for review
November 15, 2026 02:05
This was referenced Nov 15, 2026
Closed
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
GNU printf.def:819 checks ferror(stdout) once per rendering pass — a
failed fd-1 write aborts the builtin at the pass boundary: the failing
pass's diagnostics still print, later passes' renderings die.
execute_with_io_and_store writes it to an optional boundary sink.
chunks into the same production-ordered log.
pass-aware walk — first fd-1 write failure (or Closed target) arms
the abort, the diagnostic lands after the failing pass's last chunk,
later-pass chunks drop. write_to_fd swallows Closed with Ok, so the
verdict is read off fd_target(1).
targets a certainly-failing sink, the stderr leg is rebuilt from the
pass-tagged ordered log (stage streams learn the verdict only at
delivery).
status-1 now attach to fd-1 failures only — a failed fd-2 delivery
is lost silently, like GNU's builtin_error writing to the
descriptor that just failed (rubash#699 R1.3).
Pins: tests/issue3453_printf_pass_abort.rs — pipeline stage keeps
only the write error (was: bad diagnostic resurrected), 1>&- 2>&-
stays silent (was: write error leaked through the pipe), non-pipe
closed-fd1 keeps same-pass diagnostics (was: dropped).
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>