From a2526b416fb4ca7874fa41a3eb595f456703d486 Mon Sep 17 00:00:00 2001 From: hyd-dev Date: Tue, 29 Sep 2020 15:16:46 +0800 Subject: [PATCH] Use `rtassert!` instead of `assert!` from the child process after fork() in std::sys::unix::process::Command::spawn() `assert!` panics on failure, which is not signal-safe. --- library/std/src/sys/unix/process/process_unix.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/sys/unix/process/process_unix.rs b/library/std/src/sys/unix/process/process_unix.rs index 08efe154e4c..c3625d306ab 100644 --- a/library/std/src/sys/unix/process/process_unix.rs +++ b/library/std/src/sys/unix/process/process_unix.rs @@ -67,7 +67,7 @@ impl Command { // pipe I/O up to PIPE_BUF bytes should be atomic, and then // we want to be sure we *don't* run at_exit destructors as // we're being torn down regardless - assert!(output.write(&bytes).is_ok()); + rtassert!(output.write(&bytes).is_ok()); libc::_exit(1) } n => n,