Skip to content

fix: exit 12 and print 3.5.1's codec line on a compressed-stream failure - #8352

Merged
oferchen merged 7 commits into
masterfrom
fix/compression-desync-exit
Nov 11, 2026
Merged

oferchen merged 7 commits into
masterfrom
fix/compression-desync-exit

Conversation

@oferchen

@oferchen oferchen commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

Task 551 covers a remote-shell transfer whose two sides use different compressors. With a client on zstd and a server on zlib:

  • Pull: an oc client pull hung until killed.
  • Push: an oc server receiver exited 11.
  • 3.5.1: exits 12 at once in both directions.

Two more tasks are bundled, each as its own commit:

  • Task 606: the receiver now prints 3.5.1's codec line (ZSTD decomp returned -10 (0 bytes), inflate returned -3 (0 bytes)) instead of the compression library's message.
  • Task 613: fixes a macOS failure in the --list-only push test.

1. Codec failures are stream errors (exit 12)

The compressed-token codecs wrapped every zlib, zstd and lz4 library failure as io::Error::other, which the exit-code mapper reports as RERR_FILEIO (11). Upstream ends every deflate, inflate, ZSTD and LZ4 failure with exit_cleanup(RERR_STREAMIO).

Every library-error site now builds an InvalidData error, which the existing mapper already reports as 12. Codec init failures are unchanged.

2. A failed pull no longer waits forever on the server

After a failed transfer, run_server_over_ssh_connection dropped only the write half before child_handle.wait(). On the socketpair wire both halves share one socket. The server, still waiting for input, never saw EOF, so the wait never returned.

The failure path now drops the read half too before reaping. Upstream's _exit_cleanup() reaps with WNOHANG and exits, which closes every descriptor (cleanup.c:146-153).

3. The codec's own line (task 606)

Each token.c failure site is rprintf(FERROR, <fixed format>) then exit_cleanup(RERR_STREAMIO). A CodecFailure marker inside the InvalidData error carries that line, filled in. Every oc line is the exact 3.5.1 format string:

oc site token.c Line
zlib deflate_chunk :447-450 deflate returned %d
zlib encoder see_token :504-507 deflate on token returned %d (%d bytes left)
zlib finish_run :619-628 inflate flush returned %d (%d bytes)
zlib finish_run sync check :641-643 decompressor lost sync!
zlib stream_step :664-668 inflate returned %d (%d bytes)
zlib decoder see_token :720-724 inflate (token) returned %d
zstd encoder run / flush :801-804 ZSTD_compressStream returned %d
zstd decoder :899-903 ZSTD decomp returned %d (%d bytes)
lz4 encoder :977-981 compress returned %d

How each %d is obtained:

  • zstd: the codec now calls zstd_safe's DCtx::decompress_stream and CCtx::compress_stream / flush_stream directly. Those return the raw ZSTD_ErrorCode, which zstd::stream::raw drops (zstd 0.14.3 lib.rs:83-86 map_error_code). %d of the size_t code prints its low 32 bits, so the line uses code as i32. The %d bytes is out_buf.pos(), as upstream's zstd_out_buff.pos.
  • zlib, inflate (-3): flate2 1.1.11 ffi/c.rs:226 folds Z_DATA_ERROR, Z_STREAM_ERROR and Z_MEM_ERROR into one error. On zlib-ng (the default backend), inflate.c returns Z_STREAM_ERROR only for a null state, output or input pointer, which flate2 never passes. It never returns Z_MEM_ERROR, because the window is allocated at init. So every failure flate2 reports is the bad-data mode's Z_DATA_ERROR. The %d bytes is the failing call's output, from the total_out delta.
  • zlib, deflate (-2): flate2 1.1.11 ffi/c.rs:353 maps only MZ_STREAM_ERROR to an error; Z_BUF_ERROR is a status.
  • lz4, compress (0): LZ4_compress_default() returns 0 when the output does not fit. That is the only failure lz4_flex's compress_into reports.

Client side. local_failure_error renders the marker through cause_line_error: a bare cause line, then the code-12 trailer. That is upstream's rprintf(FERROR) + exit_cleanup().

Server side (push). 3.5.1's client never shows the server receiver's codec line. The forked receiver exits RERR_STREAMIO, and for that code (and RERR_SOCKETIO, RERR_SIGNAL1, RERR_TIMEOUT) cleanup.c:241-256 sends no MSG_ERROR_EXIT and never flushes the queued messages. Its generator meets end-of-file on the error pipe and reports connection unexpectedly closed (N bytes received so far) [generator] with its own read count (io.c:299-303), then its code-12 trailer.

The --server receiver now tracks upstream's fork point (the ForkPoint the client pull already uses). For those four codes it prints the generator's two lines in place of its own report. Before this, the server printed an oc-made server error: ... (code 12) line. One predicate, receiver_exit_is_unannounced, now serves both this and the client pull's ReportingSide::finish.

Measured against the 3.5.1 tarball build

Same rsh wrapper in every row. Pull: client --compress-choice=zstd, server rewritten to --old-compress (zlib). Push: the reverse.

Client / server Direction 3.5.1 oc before oc now
3.5.1 / 3.5.1 pull 12, <1 s
3.5.1 / 3.5.1 push 12, <1 s
oc / oc pull hung, killed at 30 s, "code 11" 12, <1 s
oc / oc push 11, <1 s 12, <1 s
oc / 3.5.1 pull hung, killed at 30 s 12, <1 s
oc / 3.5.1 push 12 12, <1 s

With --timeout=5 added, 3.5.1 still exits 12 at once and neither side prints a timeout line.

Note for the wrapper: upstream sends a zlib choice to the server as --old-compress, not --compress-choice=zlib (options.c:2994-2999).

The receiver's report on a pull, with the same binary at both ends:

Client codec 3.5.1 oc now
zstd (server zlib) ZSTD decomp returned -10 (0 bytes) + error in rsync protocol data stream (code 12) ... [receiver=3.5.1] same two lines
zlib (server zstd) inflate returned -3 (0 bytes) + the same trailer same two lines

On a push, the server generator's two lines, same binary at both ends, same fixture:

Run 3.5.1 oc now
1 rsync: connection unexpectedly closed (61 bytes received so far) [generator] + code-12 [generator=] trailer same, 61 bytes
2 63 bytes 63 bytes
3 64 bytes 64 bytes

All four client/server pairings (3.5.1/3.5.1, oc/oc, oc/3.5.1, 3.5.1/oc) report the same count on one fixture: 52 for one file, 61 for two. The count moves between fixtures because the mtime's nanoseconds go on the wire as a varint (flist.c:907-908), so the test writes its source once and runs both binaries on it.

Tests

crates/transfer/tests/compression_desync_exit.rs has three cells, oc on both ends with the rewriting wrapper. All pass --timeout=5, which reaches the server. Each cell asserts exit 12 and that no side printed io timeout after.

  • Pull, zstd client of a zlib stream: the receiver's cause line is exactly ZSTD decomp returned -10 (0 bytes) and its trailer message is error in rsync protocol data stream (code 12).
  • Pull, zlib client of a zstd stream: the same check with inflate returned -3 (0 bytes).
  • Push: the server receiver's codec line does not reach the client. The generator's report is rsync: connection unexpectedly closed (N bytes received so far) [generator] (program name normalised) with the code-12 trailer message, and with 3.5.1 installed it equals 3.5.1's, count included.

All three cells also compare against 3.5.1 when it is installed (require_upstream_rsync(V3_5_1)). The comparison runs 3.5.1 at both ends and checks the receiver's two lines are equal, with the program name, source position and version left out. On the host this ran against ~/up351/rsync-3.5.1/rsync; CI has no 3.5.1 build yet (task 568), so there the literal assertions carry the cell.

Mutations, each rebuilding the binary:

Mutant Result
drive.rs reader close removed killed. The pull cell fails on the timeout assertion: the server prints [sender] io timeout after 5 seconds -- exiting (code 30). The client's own exit stays 12, as upstream's first-error rule gives (cleanup.c:113-117), so the exit code alone cannot catch this mutant. The runner's 30 s limit is only a backstop.
codec errors back to io::Error::other killed. Both cells exit 11.
zstd code printed unsigned (code for code as i32) killed. zstd pull and push cells fail.
client CodecFailure branch removed killed. Both pull cells fail.
inflate prints -2, with the literal changed to match (oracle-only) killed by the 3.5.1 comparison: inflate returned -3 vs -2. This shows the oracle branch ran.
server generator EOF report disabled (&& false) killed. The push cell finds no [generator=] trailer.
generator count off by one killed by the 3.5.1 comparison only; the literal checks the format, the oracle the count.

Task 613: macOS symlink mode in the --list-only push test

push_list_only_reaches_client hard-coded the symlink row as lrwxrwxrwx. That is Linux's fixed link mode. On macOS symlink(2) applies the umask, so the link is lrwxr-xr-x, and both oc and 3.5.1 list the lstat mode.

The expected listings stay the verbatim 3.5.1 capture. for_this_host replaces the link row's permission column with the fixture link's own mode, rendered by logging::permstring (a port of lib/permstring.c:27-63).

This is verified on Linux, where the mode is 0777 and the listing is unchanged. The macOS case is covered by the macOS CI jobs. The other lrwxrwxrwx literals under crates/ use a synthetic 0o120777 mode, so they are platform-independent and left unchanged.

Gates

fmt, check_rustfmt_all, workspace clippy -D warnings, no-default-features and windows-gnu clippy for protocol, transfer and core, rustdoc -D warnings for protocol, core and transfer, dead_code_census, no-placeholders, nextest for protocol, transfer, core and cli with the 3.5.1 oracle set: all OK at 4f9045d. nextest 16431 passed, 68 skipped (the same 68 as the 551 gates run before 606 was added).

Residuals (not in this PR)

  • Push client's own line: 3.5.1's client sender hits EPIPE writing and prints rsync: [sender] write error: Broken pipe (32) (io.c:957-967), then a code-12 [sender=] trailer. oc's sender meets end-of-file reading first and prints connection unexpectedly closed (42 bytes received so far) [sender]. Both exit 12. Which side notices first depends on the sender's I/O loop, which is the perform_io port (task 475).
  • Sender-side lines (606): on a pull, 3.5.1's server sender prints [sender] write error: Broken pipe (32) and a code-10 trailer. oc's server sender prints server error: Broken pipe (os error 32) (code 10) or multiplexed frame truncated ..., which are oc-made texts. These belong to the task 632 sweep.
  • Pull byte count: on a pull, the client generator's connection unexpectedly closed (N bytes received so far) read 61 on oc and 65 on 3.5.1 in one measured run. That count is the client's ForkPoint model, not touched here.
  • lz4 decompress (task 634): uncompress failed: %d needs LZ4_decompress_safe()'s exact negative offset, and lz4_flex reports none. 3.5.1 prints uncompress failed: -6 where oc prints lz4_flex's message, still exit 12. Task 634 ports the decode loop.
  • lz4 halving guard: oc's encoder stops with its own text if halving the input reaches 0. Upstream has no such guard. It is unreachable: a MAX_DATA_COUNT input halved once always fits.
  • Codec init failures: upstream prints compression init failed / ZSTD_createDStream failed and exits 2 (token.c:743-746, :847-850). oc now uses those texts for zstd but keeps its own exit code. zlib and lz4 init are unchanged.
  • zlib output buffer: oc inflates into a CHUNK_SIZE buffer where upstream uses AVAIL_OUT_SIZE(CHUNK_SIZE) (32 KiB + 0.1% + 16). The %d bytes in an inflate line can differ only when a failing call had already produced more than 32 KiB.
  • Non-default zlib backends: the -3 and -2 codes are proven for zlib-ng, the default. The zlib-rs backend can also fold an allocation failure (Z_MEM_ERROR, -4) into the one flate2 error. miniz_oxide (used only without either zlib feature) can fold a bad-parameter deflate (-10000).
  • Reap (task 622): after closing both halves, oc still does a blocking wait() on the remote-shell child. Upstream polls with WNOHANG and exits. The blocking wait is pre-existing. A remote shell that ignored EOF would still block oc where 3.5.1 exits.

@github-actions github-actions Bot added the bug Something isn't working label Nov 10, 2026
@oferchen
oferchen force-pushed the fix/compression-desync-exit branch from 4f9045d to a504832 Compare November 10, 2026 22:25
Every deflate, inflate, ZSTD and LZ4 failure in upstream's token codec is
rprintf(FERROR) of a fixed line, then exit_cleanup(RERR_STREAMIO). oc
printed the compression library's own message instead.

A CodecFailure marker now carries the upstream line from each site
(token.c:449, :505, :626, :643, :667, :723, :803, :902, :980). The client
reports it as a bare cause line before the code-12 trailer, and the
server's fatal report does the same. The zstd codec calls zstd_safe
directly so the real ZSTD error code reaches the line. zlib's codes are
fixed: flate2 folds every inflate failure into one error, which zlib-ng
returns only as Z_DATA_ERROR, and every deflate failure as Z_STREAM_ERROR.
A forked receiver that exits with RERR_SOCKETIO, RERR_STREAMIO,
RERR_SIGNAL1 or RERR_TIMEOUT sends no MSG_ERROR_EXIT and never flushes
its queued messages (cleanup.c:241-256), so on a push 3.5.1's client
never sees the server receiver's own report. The generator meets
end-of-file on the error pipe and reports "connection unexpectedly
closed (N bytes received so far) [generator]" with its own read count
(io.c:299-303), then its code-12 trailer.

The --server receiver now tracks upstream's fork point and, for those
codes, prints the generator's two lines in place of its own report. The
codec-line arm added to the server's fatal report is dropped, since
3.5.1 never shows that line on a push. The client-side check of the same
four codes now shares the one predicate.
@oferchen
oferchen force-pushed the fix/compression-desync-exit branch from a504832 to 1a63b08 Compare November 11, 2026 05:26
@oferchen
oferchen merged commit 899a1c9 into master Nov 11, 2026
17 checks passed
@oferchen
oferchen deleted the fix/compression-desync-exit branch November 11, 2026 06:50
oferchen added a commit that referenced this pull request Nov 11, 2026
#8352 made the zlib inflater print upstream's own line,
"inflate returned %d (%d bytes)" (token.c:667), in place of oc's
invented "deflate decompression error". This test still asserted the
old text, so the required nextest has been red on master since
899a1c9.
oferchen added a commit that referenced this pull request Nov 11, 2026
#8352 made the zlib inflater print upstream's own line,
"inflate returned %d (%d bytes)" (token.c:667), in place of oc's
invented "deflate decompression error". This test still asserted the
old text, so the required nextest has been red on master since
899a1c9.
oferchen added a commit that referenced this pull request Nov 11, 2026
#8352 made the zlib inflater print upstream's own line,
"inflate returned %d (%d bytes)" (token.c:667), in place of oc's
invented "deflate decompression error". This test still asserted the
old text, so the required nextest has been red on master since
899a1c9.
oferchen added a commit that referenced this pull request Nov 11, 2026
#8352 made the zlib inflater print upstream's own line,
"inflate returned %d (%d bytes)" (token.c:667), in place of oc's
invented "deflate decompression error". This test still asserted the
old text, so the required nextest has been red on master since
899a1c9.
oferchen added a commit that referenced this pull request Nov 11, 2026
…#8370)

Master's required `nextest (stable)` and `Linux musl (stable)` have been
red since 899a1c9 (#8352) on one test:

```
batch tests::integration::test_replay_zstd_magic_payload_not_autodetected
panicked at crates/batch/src/tests.rs:1374:9:
the zlib inflater must be what rejects the zstd frame: oc-rsync error: batch replay failed: inflate returned -3 (0 bytes) (code 1)
```

#8352 made the zlib inflater print upstream's own line, `inflate
returned %d (%d bytes)` (token.c:667). This test still asserted oc's old
invented text, `deflate decompression error`. The test's intent hasn't
changed: replay must fail and the zlib inflater must be what rejects the
zstd frame. Only the expected string moves to the upstream text, with
the citation. No other test asserts the old text (`git grep`).

Verification: the failing master runs (42980782556, 42988312596) show
stderr containing `inflate returned -3 (0 bytes)`, which the new
assertion matches. This PR's CI runs the test.
oferchen added a commit that referenced this pull request Nov 13, 2026
## Summary

Below protocol 29, a 3.5.1 server over a remote shell clears
`msgs2stderr` (compat.c:653-654). rwrite() then queues every FERROR line
for the client (log.c:357-367 -> io.c:1088 send_msg()), and none reaches
the server's own stderr. oc's `--server` always wrote its fatal report
to stderr. So when a client refuses `-FF` at protocol 28 and exits, oc
showed an extra line from the server: `oc-rsync error: server error:
failed to fill whole buffer (code 12) ... [server=...]`. 3.5.1 shows
nothing from the server; strace of the 3.5.1 server shows no write to fd
2 before exit_group(12).

- **Transfer.** A new `queue_fatal_report` queues the fatal report as
message frames whenever the server frames its error lines
(`ServerWriter::frames_errors`, the same route rwrite() uses). It skips
the queue when the exit is one the peer asked for (cleanup.c:221-226).
The queued lines leave only with `announce_error_exit`'s flush. So for a
transport-class code, or below protocol 31, they never reach the wire
(cleanup.c:241-253), matching 3.5.1. The line-sending that used to live
inside `announce_error_exit` moves here. A socket daemon takes this same
path, with the same output as before.
- **`--server` (cli).** It hands the transfer a report hook,
`run_server_fds(.., fatal_report)`. When the hook was used, the server
does not print its report again and still exits with the same code. The
generator-EOF report from #8352 follows the same rule: it is printed
only when messages are not framed.

## Verification

- **New test, `transfer/tests/server_framed_fatal_report.rs`, push and
pull, lsh stub, `--protocol=28 -FF`.**
- CI cell (oc client, oc server): stderr carries exactly one `error:`
trailer, the client's code-2 one, and exit is 2.
- Oracle cell (runs when `OC_RSYNC_UPSTREAM_BIN_3_5_1` is set): with a
3.5.1 client, an oc server and a 3.5.1 server produce identical stderr
and exit status.
- **Unit tests in `tests/error_exit_gate.rs`:**
  - a report bound for stderr (protocol 29+) is left to the caller;
- a framed report for RERR_STREAMIO at protocol 28 is rendered but never
written;
  - an exit the peer asked for renders no report;
- the existing report-before-exit-frame cell now goes through
`queue_fatal_report`.
- **Mutations, each killed:**
  - M1, never queue the report: 4 cells fail.
  - M2, frame on every route: 1 cell fails.
- M3, the server prints even when the report was framed: both e2e cells
fail.
- nextest -p transfer/core/cli/daemon: 12433 passed, 86 skipped (oracle
cells included). clippy, fmt, no-placeholders and dead-code census
clean.

## Residuals

- The Windows `--server` path (`run_server_stdio`) takes no report hook
yet, so at protocol 28 on Windows it still prints the report to its own
stderr.
- #8357 adds a drain after the error exit. If that drain flushes the
queued message buffer, a transport-class failure would push these queued
lines onto the wire, which upstream never does. The two PRs must be
checked together.
oferchen added a commit that referenced this pull request Nov 14, 2026
#8372)

## Summary

Stacked on #8367.

A client whose transfer fails now leaves the way rsync 3.5.1's
`_exit_cleanup()` does:

- It polls the remote shell once with WNOHANG (cleanup.c:146-154) and
takes the shell's status only if the shell has already exited.
- If the shell is still running, it sends it SIGUSR1, as
`kill_all(SIGUSR1)` does (cleanup.c:201-202, util1.c:692-709), and exits
without waiting.

Before, oc closed both pipes and blocked in `wait()`, so a remote shell
that ignored end-of-file held the client open until the shell exited by
itself. A transfer that finishes still waits for the child, as
`wait_process_with_flush()` does (main.c:198-227, :1179, :1454).

Because the client now signals its remote shell, an rsh server has to
write its fatal report before telling the client it is exiting, or the
signal can cut the report off. 3.5.1 writes the cause line at the error
site and `log_exit()`'s trailer at cleanup.c:221-224, both on stderr
(`msgs2stderr = 2`, options.c:103, log.c:357), before `MSG_ERROR_EXIT`
goes out at cleanup.c:240-256. oc's rsh server wrote both after the
transfer returned, so after the frame. A 3.5.1 client, which signals its
rsh child, lost the oc server's trailer 3 of 3 times.

## Changes

**Commit 1: poll and signal**

- `rsync_io`: new `SshChildHandle::poll_exit()`. It calls `try_wait`
once. If the child is still running, it sends SIGUSR1 on Unix and
releases the child unreaped.
- `platform::signal::send_sigusr1()`: a safe `nix` `kill(2)` wrapper,
with a unit test.
- `core` ssh drive: the handshake-failure path and the transfer-failure
path both use `poll_cleanup_child()`.
- A `waitpid` that fails, or finds the child still running, leaves the
local code standing. It no longer becomes `RERR_WAITCHILD` (21).
- #8352's early read-side close on a failed transfer is removed. It
existed only so the blocking wait could return, and that wait is gone
(cleanup.c:146-154). Mutant M1 below shows #8352's own cells catch a
wait put back there.
- `transfer_failure_error` now takes `Option<ExitCode>`. The embedded
transport passes its exit report.

**Commit 2: one fatal-report hook (on #8367)**

- #8367 adds the `FatalReport` hook. The transfer now routes its lines
the way `rwrite()` routes each message:
  - frames them when `frames_errors()` is true;
  - otherwise writes them to the server's own stderr.
  - Either way this happens before `announce_error_exit`.
  - `queue_fatal_report` is renamed `report_fatal_failure`.
- cli `run.rs`: one `server_fatal_report()` renders the lines, including
#8352's generator-EOF case, and computes the exit code. A `OnceLock`
records that the hook ran, and the post-return path then prints nothing.
A failure before the transfer body starts is still reported after it
returns.

## Oracle (3.5.1 tarball build, host)

- Remote-shell stub that traps SIGUSR1, closes its stdout and sleeps 30
s without holding stderr:
- 3.5.1, push and pull: rc 12, the two client lines, the stub's "got
SIGUSR1" line, 0 s.
  - oc before: blocks until the 30 s cap; the stub is never signalled.
  - oc after: identical to 3.5.1.
- Push into /dev/full over a shim that execs the server directly, 3 runs
per pair. Results before this change:

  | client / server | cause line | trailer |
  |---|---|---|
  | 3.5.1 / 3.5.1 | 3/3 | 3/3 |
  | 3.5.1 / oc | 3/3 | 0/3 |

  After this change, 3.5.1 / oc prints both lines 3/3.
- WNOHANG races the shell's exit in 3.5.1 too:
  - `-e "sh -c 'exit 255'"`: exit 255 in 18/30 runs, 12 in 12/30.
  - Real ssh with a missing `--rsync-path`: 12 in 12/12.
  - Shell exiting 127 after reading the greeting: 127 in 20/20 unloaded.
- Twin of `push_cut_inside_the_goodbye`, 3.5.1 at both ends:
  - Unloaded, 12/12 runs: only the client's two lines.
- Under 6-way load, 22/72 runs also show the 3.5.1 server's own lines on
the shared stderr: `[generator] write error: Broken pipe (32)` with a
code 10 trailer, or `connection unexpectedly closed ... [generator]`
with a code 12 trailer.

## Tests

- New
`exit_codes::exit_code_12_stream_io::remote_shell_ignoring_eof_is_signalled_not_waited_for`,
push and pull.
- The stub's trap line reaches the captured stderr only if the client
signalled the stub.
- The stub holds no stderr while it sleeps, so a client that waits
instead fails after the cap. The test makes no time-based assertion.
- `receiver_write_failure`:
- The 3.5.1-client push to an oc server now asserts the trailer on 3 of
3 runs.
  - New oracle cell: a 3.5.1 push to a 3.5.1 server.
- Three cells asserted a child status that 3.5.1 itself only reports
when the poll wins the race. Each now accepts 3.5.1's two outcomes, and
the trailer must name the code that won. The deterministic fold stays
pinned by the `version_exchange` unit test.
- `ssh_transfer::ssh_stderr_not_reappended_to_error_message`: 255 or 12.
  - `ssh_transfer::ssh_rsync_path_not_found`: 12 or 127.
-
`rsh_peer_eof_whine::a_worse_remote_shell_status_keeps_the_whine_and_names_its_own_code`:
127 or 12.
- `rsh_peer_eof_whine`:
- The `push_cut_after` shim's `dd` ignores SIGUSR1 and keeps a copy of
the client's stderr, so its tally is always written before the output is
read.
- `push_cut_inside_the_goodbye` filters lines tagged with a server role
(`[generator]`, `[receiver]`, or a `[generator=` / `[receiver=` /
`[server=` trailer), matching the 3.5.1 oracle above. The client's two
lines are still asserted exactly.
- #8367's `a_report_bound_for_stderr_is_left_to_the_caller` becomes
`a_report_bound_for_stderr_is_rendered_but_not_framed`: the stderr route
renders the report, and only the exit frame reaches the wire.

## Mutants (each failed the named cells)

- M1, a failed transfer waits for the shell again, without #8352's
close: `compression_desync_exit` pull cells (2/2).
- M2, the stderr route writes nothing: `receiver_write_failure` rsh push
and 3.5.1-client push (2).
- M3, no SIGUSR1:
`remote_shell_ignoring_eof_is_signalled_not_waited_for`.
- Hook call dropped (on the earlier version of this change): the
3.5.1-client order cell.

## Verification (host, at 937298b)

- `check_rustfmt_all.py`: clean. `cargo clippy --workspace --all-targets
--all-features --no-deps -D warnings`: clean.
- nextest, the binaries this touches (`compression_desync_exit`,
`receiver_write_failure`, `server_framed_fatal_report`, `exit_codes`,
`rsh_peer_eof_whine`, `ssh_transfer`, plus `error_exit_gate`,
`send_sigusr1`, `transfer_failure_error`, `cleanup`): 170/170.
- `rsh_peer_eof_whine`, 4 further runs: 20/20. An earlier 6-way load
stress of the same binary (filter matching the role tag at line end
only) passed 48/48. The final filter only drops more server-role lines.

## Residuals

- Upstream polls the child before the MSG_ERROR_EXIT drain
(cleanup.c:146 precedes :240-256). oc polls after the transfer returns,
which after #8357 is after the drain. The code is the same unless the
remote's exit status differs from the echoed code.
- `local_failure_error` keeps its peer-went-first filter for the
embedded transport, whose exit report arrives only after the session
closes.
- Windows: a still-running child is released without a signal. Cygwin's
mapping of SIGUSR1 onto a native ssh.exe was not measured.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant