Skip to content

sort: strip the errno suffix from read errors - #13994

Open
MsfPablo wants to merge 1 commit into
uutils:mainfrom
MsfPablo:sort-strip-errno
Open

sort: strip the errno suffix from read errors#13994
MsfPablo wants to merge 1 commit into
uutils:mainfrom
MsfPablo:sort-strip-errno

Conversation

@MsfPablo

Copy link
Copy Markdown
Contributor

Fixes #13992.

sort /proc/self/mem prints:

sort: Input/output error (os error 5)

The SortError variants all run their io errors through strip_errno already; this one path does not. read_to_buffer in chunks.rs builds a USimpleError straight from e.to_string(), so the errno tail survives. Switched it to strip_errno, which is the only remaining to_string on an io error in the crate.

Tests: a unit test driving read_to_buffer with a reader that fails with EIO. It reproduces the reported message exactly on the old code and passes on the new one.

read_to_buffer built its error with e.to_string(), which carries the
"(os error N)" tail that GNU does not print. Every other io error in
sort already goes through strip_errno.

Fixes uutils#13992
@sylvestre

Copy link
Copy Markdown
Contributor

please only add a test in test_sort.rs

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/cut/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/date/resolution (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/csplit/csplit-heap is now being skipped but was previously passing.
Note: The gnu test tests/tail/tail-n0f is now being skipped but was previously passing.

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.

sort: i/o error should be stripped

2 participants