Skip to content

split: bad error message#12671

Open
Devel08 wants to merge 9 commits into
uutils:mainfrom
Devel08:fix-issue-12665
Open

split: bad error message#12671
Devel08 wants to merge 9 commits into
uutils:mainfrom
Devel08:fix-issue-12665

Conversation

@Devel08

@Devel08 Devel08 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

this pr resolves #12665

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

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

ubuntu has different message for os error 5.
Comment thread src/uu/split/src/split.rs Outdated
Strategy::Lines(chunk_size) => {
let mut writer = LineChunkWriter::new(chunk_size, settings)?;
copy(&mut reader, &mut writer)
match io::copy(&mut reader, &mut writer) {

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.

you should use if_err (or equivalent)

Comment thread src/uu/split/src/split.rs Outdated
copy(&mut reader, &mut writer)
match io::copy(&mut reader, &mut writer) {
Ok(_) => Ok(()),
Err(e) => Err(USimpleError::new(1, format!("{e}"))),

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.

use strip_errno to remove "(os error "

Comment thread tests/by-util/test_split.rs Outdated
new_ucmd!()
.arg("/proc/self/mem")
.fails_with_code(1)
.stderr_contains("(os error 5)\n");

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.

(os error
is something we are trying to remove
please try on the real error message

@sylvestre

Copy link
Copy Markdown
Contributor

a job is failing:


---- test_split::test_io_error stdout ----
bin: "/target/i686-unknown-linux-musl/debug/coreutils"
run: /target/i686-unknown-linux-musl/debug/coreutils split /proc/self/mem

thread 'test_split::test_io_error' panicked at tests/by-util/test_split.rs:2086:10:
assertion failed: `(left == right)`

Diff < left / right > :
<split: I/O error
>split: Input/output error
 


stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/panicking.rs:697:5
   1: core::panicking::panic_fmt
             at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/panicking.rs:75:14
   2: uutests::util::CmdResult::stderr_is
             at ./tests/uutests/src/lib/util.rs:647:9
   3: tests::test_split::test_io_error
             at ./tests/by-util/test_split.rs:2083:5
   4: tests::test_split::test_io_error::{{closure}}
             at ./tests/by-util/test_split.rs:2082:19
   5: core::ops::function::FnOnce::call_once
             at /rust/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
   6: core::ops::function::FnOnce::call_once
             at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


failures:
    test_split::test_io_error

test result: FAILED. 5181 passed; 1 failed; 85 ignored; 0 measured; 0 filtered out; finished in 61.28s

@Devel08

Devel08 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

a job is failing:


---- test_split::test_io_error stdout ----
bin: "/target/i686-unknown-linux-musl/debug/coreutils"
run: /target/i686-unknown-linux-musl/debug/coreutils split /proc/self/mem

thread 'test_split::test_io_error' panicked at tests/by-util/test_split.rs:2086:10:
assertion failed: `(left == right)`

Diff < left / right > :
<split: I/O error
>split: Input/output error
 


stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/std/src/panicking.rs:697:5
   1: core::panicking::panic_fmt
             at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/panicking.rs:75:14
   2: uutests::util::CmdResult::stderr_is
             at ./tests/uutests/src/lib/util.rs:647:9
   3: tests::test_split::test_io_error
             at ./tests/by-util/test_split.rs:2083:5
   4: tests::test_split::test_io_error::{{closure}}
             at ./tests/by-util/test_split.rs:2082:19
   5: core::ops::function::FnOnce::call_once
             at /rust/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
   6: core::ops::function::FnOnce::call_once
             at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


failures:
    test_split::test_io_error

test result: FAILED. 5181 passed; 1 failed; 85 ignored; 0 measured; 0 filtered out; finished in 61.28s

That happens on Ubuntu systems, because the error there is I/O instead of input/output, should we change the error in the locales to match Ubuntu?

@Devel08

Devel08 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Anyways, I'll just rewrite the test for both errors

@Devel08 Devel08 requested a review from sylvestre June 8, 2026 13:08
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.

split: bad error message

2 participants