claude -p $'\xff\xfe\x80abc\xc3\x28'
node : rc=1 "Not logged in · Please run /login"
perry: rc=134 (SIGABRT)
thread '<unnamed>' panicked at library/std/src/env.rs:878:51:
called `Result::unwrap()` on an `Err` value: "\xFF\xFE\x80abc\xC3("
std::env::args() panics on any argument that is not valid UTF-8. Non-UTF-8 filenames are ordinary on Linux, so this is reachable by a user simply passing a path, and the panic text leaks Rust internals into the program's stderr.
Fix: use std::env::args_os() and convert lossily (or preserve the bytes) at the boundary, matching node, which accepts the argument and proceeds.
A grep for env::args() elsewhere in the runtime is worthwhile — the same unwrap pattern may appear on other paths.
Found by a differential stress-test of cc 2.1.112 under perry 757beace0.
std::env::args()panics on any argument that is not valid UTF-8. Non-UTF-8 filenames are ordinary on Linux, so this is reachable by a user simply passing a path, and the panic text leaks Rust internals into the program's stderr.Fix: use
std::env::args_os()and convert lossily (or preserve the bytes) at the boundary, matching node, which accepts the argument and proceeds.A grep for
env::args()elsewhere in the runtime is worthwhile — the same unwrap pattern may appear on other paths.Found by a differential stress-test of cc 2.1.112 under perry
757beace0.