Fix stty panic on glibc 2.42 (hotfix)
Catches panics from cfgetospeed() on glibc 2.42. Removes .expect() and .unwrap() calls in termios handling. Suppresses panic messages.
stty now gracefully skips speed display instead of crashing.
Temporary workaround pending upstream nix fix.
Fixes #8474
before
podman run -it --rm -v /coreutils:/workspace ubuntu:25.10 bash -c "cd /workspace && ./target/debug/stty 2>&1"
time="2025-11-25T10:05:03+07:00" level=warning msg="The input device is not a TTY. The --tty and --interactive flags might not work properly"
thread 'main' panicked at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.30.1/src/sys/termios.rs:767:70:
called `Result::unwrap()` on an `Err` value: EINVAL
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
line = 0;
-brkint ixon -imaxbel
---
After
podman run --rm -v /coreutils:/workspace ubuntu:25.10 bash -c "
cd /workspace
apt-get update -qq >/dev/null 2>&1
apt-get install -y cargo >/dev/null 2>&1
rm -f target/debug/stty target/debug/deps/uu_stty-*
cargo build -p uu_stty 2>&1 | tail -2
echo 'TESTING:'
./target/debug/stty 2>&1 | head -3
" 2>&1
Downloaded libc v0.2.175
Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.19s
TESTING:
stty: Inappropriate ioctl for device
i think you committed way too many files
@ChrisDryden Is this not conflicting with any your PRs?
GNU testsuite comparison:
Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)
😴
i forgot to unstage the docs generated when researching on the internet
GNU testsuite comparison:
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)
I patched your PR to main at Arch Linux. But fish: Job 1, ''/tmp/makepkg/uutils-coreutils-…' terminated by signal SIGABRT (Abort).
https://github.com/uutils/coreutils/pull/9483#issuecomment-3574827444
This project has release-{fast,small} with panic=abort.
@ChrisDryden Is this not conflicting with any your PRs?
This doesn't appear to conflict with any of the open PR's should be good to go.
i should contribute to nix instead fix the underlying API so cfgetospeed() returns Result rather than panicking. that's the real solution instead of catching panics globally. this workaround doesn't help with panic=abort anyway.
https://github.com/uutils/coreutils/pull/9483#issuecomment-3576973842 Thankyou.
https://github.com/uutils/coreutils/pull/9483#issuecomment-3578363347 nix rust-libc people are hesitating to use both of raw ioctl and versioned symbol of glibc BTW...
GNU testsuite comparison:
Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)
@naoNao89 https://github.com/nix-rust/nix/issues/2672#issuecomment-3601704006 with help of nix?
@oech3 Sorry for being AFK for a few days, i have been busy with some heists. See you in the next 16 hours :))