uutils/coreutils · error
Disabling rust signal handlers failed
Error message
Disabling rust signal handlers failed
What it means
The uucore proc-macro generated main calls uucore::disable_rust_signal_handlers() and unwraps with the panic message 'Disabling rust signal handlers failed'. This ensures the Rust runtime's default SIGSEGV/SIGABRT handlers (which prevent core dumps) are removed so processes dump core like GNU coreutils.
Solutions
- Check environment restrictions (seccomp/SELinux) that block sigaction and relax them
- If core dumps are unnecessary, build without the `signals` feature so the call is compiled out
- Inspect disable_rust_signal_handlers' underlying error to identify the failing signal
Example fix
// before
uucore::disable_rust_signal_handlers().expect("Disabling rust signal handlers failed");
// after
if let Err(e) = uucore::disable_rust_signal_handlers() { eprintln!("warning: {e}"); } Defensive patterns
Strategy: try-catch
Try / catch
// in your own bootstrap, avoid expect:
if let Err(e) = uucore::disable_rust_signal_handlers() {
eprintln!("warning: could not disable rust signal handlers: {e}");
} Prevention
- Test utilities inside the same container/seccomp profile used in production
- Enable core dumps (ulimit -c) to notice handler issues early
- Build without the `signals` feature if signal-handler manipulation is not required
When it happens
Trigger: Running any utility built with the `signals` feature on unix where disable_rust_signal_handlers returns Err — e.g. the runtime failed to reset a signal handler (sigaction failure) at startup.
Common situations: Restricted environments (seccomp/SELinux profiles, containers) blocking signal syscalls; exotic unix platforms where the handler-reset call fails.
Understand the failure class
Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.
Related errors
- csplit-write-split-not-created
- kill-error-unsupported-signal
- mv-error-permission-denied
- Too many levels of symbolic links
AI-assisted analysis of uutils/coreutils@92995feca2 (2026-09-20).
Data as JSON: /api/errors/88d24adeeaa347b6.
Report an issue: GitHub.
Appendix: source
Thrown at src/uucore_procs/src/lib.rs:53
// before main() to capture whether SIGPIPE was ignored by the parent process.
#[cfg(all(#signals, unix, not(any(target_os = "fuchsia", target_os = "haiku"))))]
uucore::init_startup_state_capture!();
pub fn uumain(args: impl uucore::Args) -> i32 {
#stream
// Restore SIGPIPE to default if it wasn't explicitly ignored by parent.
// The Rust runtime ignores SIGPIPE, but we need to respect the parent's
// signal disposition for proper pipeline behavior (GNU compatibility).
// needed even for true --version
#[cfg(all(unix, not(any(target_os = "fuchsia", target_os = "haiku"))))]
if !uucore::signals::sigpipe_was_ignored() {
let _ = uucore::signals::enable_pipe_errors();
}
// disable rust signal handlers (otherwise processes don't dump core after e.g. one SIGSEGV)
#[cfg(all(#signals, unix))]
uucore::disable_rust_signal_handlers().expect("Disabling rust signal handlers failed");
let result = uumain(args);
match result {
Ok(()) => uucore::error::get_exit_code(),
Err(e) => {
let s = format!("{e}");
if s != "" {
uucore::show_error!("{s}");
}
if e.usage() {
use std::io::{stderr, Write as _};
let _ = writeln!(stderr(),"Try '{} --help' for more information.", uucore::execution_phrase());
}
e.code()
}
}
}
);
View on GitHub (pinned to 92995feca2)