Skip to content

cksum: Don't panic when checked file returned EIO#10534

Merged
ChrisDryden merged 1 commit into
uutils:mainfrom
oech3:cksum-panic
Jan 30, 2026
Merged

cksum: Don't panic when checked file returned EIO#10534
ChrisDryden merged 1 commit into
uutils:mainfrom
oech3:cksum-panic

Conversation

@oech3

@oech3 oech3 commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

Closes #10175 .
We cannot add tests for device returning EIO and cannot backport corresponding GNU tests until we backport proper args managenent too.

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/shuf/shuf-reservoir (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/sort/sort-stale-thread-mem (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)

@ChrisDryden

Copy link
Copy Markdown
Collaborator

I was messing around with ways to make an integ test for this and I was able to replicate the conditions using /proc/self/mem . Will only work on linux but should give us regression coverage in the CI

  #[test]
  #[cfg(target_os = "linux")]
  fn test_check_file_with_io_error() {
      // /proc/self/mem causes EIO when read without proper seeking
      new_ucmd!()
          .arg("-a")
          .arg("md5")
          .arg("--check")
          .pipe_in("d8e8fca2dc0f896fd7cb4cb0031ba249  /proc/self/mem\n")
          .fails()
          .stderr_contains("Input/output error")
          .stdout_contains("FAILED open or read");
  }

@oech3

This comment was marked as outdated.

@oech3

oech3 commented Jan 28, 2026

Copy link
Copy Markdown
Contributor Author

After we found other bugs needed to dedup the code

@oech3

This comment was marked as off-topic.

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/shuf/shuf-reservoir (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/sort/sort-stale-thread-mem (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@oech3

oech3 commented Jan 28, 2026

Copy link
Copy Markdown
Contributor Author

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/shuf/shuf-reservoir (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/sort/sort-stale-thread-mem (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)

@oech3

oech3 commented Jan 28, 2026

Copy link
Copy Markdown
Contributor Author

Does not work as we expected. ignore

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/shuf/shuf-reservoir (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/sort/sort-stale-thread-mem (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)

@dezgeg

dezgeg commented Jan 29, 2026

Copy link
Copy Markdown
Contributor

Does not work as we expected. ignore

If you mean the /proc/self/mem trick, it fails on musl due to error message being different. #[cfg(all(target_os = "linux", not(target_env = "musl")))] should work.

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/shuf/shuf-reservoir (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/sort/sort-stale-thread-mem (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)
Congrats! The gnu test tests/basenc/bounded-memory is now passing!

@oech3

oech3 commented Jan 29, 2026

Copy link
Copy Markdown
Contributor Author

Thankyou

@ChrisDryden ChrisDryden merged commit 12193c5 into uutils:main Jan 30, 2026
130 checks passed
@ChrisDryden

Copy link
Copy Markdown
Collaborator

Thanks!

@oech3

oech3 commented Jan 31, 2026

Copy link
Copy Markdown
Contributor Author

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.

cksum, hashsum: --check'ing broken file cause panic

3 participants