Skip to content

Conversation

@naoNao89
Copy link

stty panics on Ubuntu 25.10 (glibc 2.42) with EINVAL in cfgetospeed/cfgetispeed.

Solution: Replace .unwrap() -> .unwrap_or(BaudRate::B0) to handle conversion errors gracefully.

Fixes #2672, uutils/coreutils#8474

Replace .unwrap() with .unwrap_or(BaudRate::B0) to gracefully handle
conversion errors on glibc 2.42+. Fixes nix-rust#2672 and
uutils/coreutils#8474.

- src/sys/termios.rs: cfgetospeed() and cfgetispeed()
- test/sys/test_termios.rs: 4 new integration tests
@naoNao89 naoNao89 force-pushed the fix/glibc-2.42-termios branch from f75f8ef to 172e1d9 Compare November 27, 2025 01:25
@oech3
Copy link

oech3 commented Nov 27, 2025

Is there natural cargo's system to backport this patch to uutils's main? It seems this path is working well.

@oech3
Copy link

oech3 commented Nov 27, 2025

I'm not sure is it possible. But GNU coreutils stty returns speed 38400 baud; while uutils/stty with this patch returns speed 0 baud;. Is .unwrap_or(BaudRate::B38400) impossible on glibc 2.42?

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.

cfgetospeed(): called Result::unwrap() on an Err value: EINVAL

2 participants