Skip to content

cksum: report a write error for raw output - #15557

Merged
sylvestre merged 1 commit into
uutils:mainfrom
ChihweiLHBird:zhiwei/cksum-raw-flush
Oct 22, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
ChihweiLHBird:zhiwei/cksum-raw-flush

Conversation

@ChihweiLHBird

Copy link
Copy Markdown
Contributor

cksum --raw writes the digest without a newline, so it stays in the writer's buffer until the writer is dropped, and a drop cannot report an error. On a full disk, cksum --raw f > out leaves an empty file and exits 0. GNU exits 1 with write error: No space left on device.

This flushes before the early return, so the error goes through the normal write-error path and sets the exit code. The new test sends raw output to /dev/full and expects exit 1 with that message.

Copilot AI balanced review requested due to automatic review settings October 21, 2026 05:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@codspeed

codspeed Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 28.55%

1 warning, 1 note

⚠️ 120 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

ℹ️ 1 benchmark has no flamegraph

The flamegraph wasn't generated: most of the time was spent in runtime internals, which would leave nothing useful to analyze.

See affected benchmarks

⚡ 2 improved benchmarks
✅ 399 untouched benchmarks
⏩ 70 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ CPU Simulation complex_relative_date 386.2 µs 277.7 µs +39.05%
⚡ CPU Simulation true_consecutive_calls 350.2 ns 294.7 ns +18.85%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing ChihweiLHBird:zhiwei/cksum-raw-flush (3d5d4e6) with main (4939cd4)2

Open in CodSpeed

Footnotes

  1. 70 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on main (2f8b194) during the generation of this report, so 4939cd4 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

Comment thread src/uucore/src/lib/features/checksum/compute.rs Outdated
@xtqqczze

Copy link
Copy Markdown
Collaborator

@ChihweiLHBird Is there an existing issue that covers this work?

@ChihweiLHBird
ChihweiLHBird force-pushed the zhiwei/cksum-raw-flush branch from 5d60f7a to 857c965 Compare October 21, 2026 15:42
Copilot AI balanced review requested due to automatic review settings October 21, 2026 15:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@ChihweiLHBird

Copy link
Copy Markdown
Contributor Author

@ChihweiLHBird Is there an existing issue that covers this work?

I didn't find any

@xtqqczze

Copy link
Copy Markdown
Collaborator

Fuzzing failures tracked by #15567.

The raw digest has no newline, so it stayed in the buffer until the writer was dropped, which discards the error. Flush before the return so a write error is reported and sets the exit code.

Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
Copilot AI balanced review requested due to automatic review settings October 22, 2026 00:28
@ChihweiLHBird
ChihweiLHBird force-pushed the zhiwei/cksum-raw-flush branch from 857c965 to 3d5d4e6 Compare October 22, 2026 00:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@sylvestre
sylvestre merged commit 18437af into uutils:main Oct 22, 2026
190 checks passed
@sylvestre

Copy link
Copy Markdown
Contributor

Thanks for your PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants