Skip to content

Fix panic in who > /dev/full #10801

Open
AntoxaBarin wants to merge 6 commits intouutils:mainfrom
AntoxaBarin:bug/who_panics_dev_full
Open

Fix panic in who > /dev/full #10801
AntoxaBarin wants to merge 6 commits intouutils:mainfrom
AntoxaBarin:bug/who_panics_dev_full

Conversation

@AntoxaBarin
Copy link

Fixes #10550

@github-actions
Copy link

github-actions bot commented Feb 8, 2026

GNU testsuite comparison:

Congrats! The gnu test tests/pr/bounded-memory is no longer failing!

@oech3

This comment was marked as resolved.

@github-actions
Copy link

github-actions bot commented Feb 8, 2026

GNU testsuite comparison:

Congrats! The gnu test tests/pr/bounded-memory is no longer failing!

@sylvestre
Copy link
Contributor

some jobs are failing

@github-actions
Copy link

github-actions bot commented Feb 9, 2026

GNU testsuite comparison:

Congrats! The gnu test tests/tail/tail-n0f is now passing!

@AntoxaBarin
Copy link
Author

AntoxaBarin commented Feb 9, 2026

@sylvestre, @oech3, now CI is passing. Should I add test with /dev/full?

use std::borrow::Cow;
use std::ffi::CStr;
use std::fmt::Write;
use std::io::{self, Write as _};
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove the "as _"

Copy link
Author

Choose a reason for hiding this comment

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

Then it would conflict with use std::fmt::Write;:

error[E0252]: the name `Write` is defined multiple times
  --> src/uu/who/src/platform/unix.rs:21:21
   |
20 | use std::fmt::Write;
   |     --------------- previous import of the trait `Write` here
21 | use std::io::{self, Write};
   |                     ^^^^^ `Write` reimported here
   |

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, just remove the declaration then ?!

Copy link
Contributor

Choose a reason for hiding this comment

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

No. needed for std{out,err}.

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/mv/mv-special-1. tests/mv/mv-special-1 is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/pr/bounded-memory is no longer failing!

@AntoxaBarin
Copy link
Author

@sylvestre, @oech3, please, take a look at this failing job: https://github.com/uutils/coreutils/actions/runs/21943316553/job/63375199339?pr=10801

Is it CI runner error?

@oech3
Copy link
Contributor

oech3 commented Feb 13, 2026

looks network err?

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/pr/bounded-memory. tests/pr/bounded-memory is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/factor/t27 is no longer failing!
Note: The gnu test tests/dd/no-allocate is now being skipped but was previously passing.
Congrats! The gnu test tests/printf/printf-surprise is now passing!

}
println!("{}", buf.trim_end());
let mut stdout = io::stdout().lock();
writeln!(stdout, "{}", buf.trim_end()).map_err_context(|| translate!("who-write-error"))?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This locale string doesn't exist it appears

&comment,
"",
);
)?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Mind just removing the semicolon in these cases instead of doing the ? Ok(). It appears this is the only result function being returned here

write!(buf, " {exit:<12}").unwrap();
}
println!("{}", buf.trim_end());
let mut stdout = io::stdout().lock();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Whats the reason for using the lock here if its only for one write?

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.

who > /dev/full panics

4 participants