{"record":{"id":"18cd38bb369447ec","repo":"rust-lang/rust","slug":"process-groups-are-not-supported-on-espidf","errorCode":null,"errorMessage":"process groups are not supported on espidf","messagePattern":"process groups are not supported on espidf","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"library/std/src/os/unix/process.rs","lineNumber":582,"sourceCode":"\n#[unstable(feature = \"unix_send_signal\", issue = \"141975\")]\nimpl ChildExt for process::Child {\n    fn send_signal(&self, signal: i32) -> io::Result<()> {\n        self.handle.send_signal(signal)\n    }\n\n    fn send_process_group_signal(&self, signal: i32) -> io::Result<()> {\n        self.handle.send_process_group_signal(signal)\n    }\n\n    #[cfg(not(target_os = \"espidf\"))]\n    fn kill_process_group(&mut self) -> io::Result<()> {\n        self.handle.send_process_group_signal(libc::SIGKILL)\n    }\n\n    #[cfg(target_os = \"espidf\")]\n    fn kill_process_group(&mut self) -> io::Result<()> {\n        Err(io::Error::new(\n            io::ErrorKind::Unsupported,\n            \"process groups are not supported on espidf\",\n        ))\n    }\n}\n\n#[stable(feature = \"process_extensions\", since = \"1.2.0\")]\nimpl FromRawFd for process::Stdio {\n    #[inline]\n    unsafe fn from_raw_fd(fd: RawFd) -> process::Stdio {\n        let fd = sys::fd::FileDesc::from_raw_fd(fd);\n        let io = sys::process::Stdio::Fd(fd);\n        process::Stdio::from_inner(io)\n    }\n}\n\n#[stable(feature = \"io_safety\", since = \"1.63.0\")]\nimpl From<OwnedFd> for process::Stdio {","sourceCodeStart":564,"sourceCodeEnd":600,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/library/std/src/os/unix/process.rs#L564-L600","documentation":"ChildExt::kill_process_group sends SIGKILL to a child's process group. On the espidf target (ESP-IDF / FreeRTOS) the OS has no process-group concept, so the method is compiled (#[cfg(target_os = \"espidf\")]) but unconditionally returns Err(io::ErrorKind::Unsupported) (process.rs:580-586).","triggerScenarios":"Calling `child.kill_process_group()` in code compiled for `target_os = \"espidf\"` (e.g. ESP32 firmware).","commonSituations":"Cross-platform process-management code that calls kill_process_group unconditionally; targeting ESP32/ESP8266 boards.","solutions":["Gate the call with #[cfg(not(target_os = \"espidf\"))] and fall back to child.kill() on espidf.","At runtime, match on io::ErrorKind::Unsupported and degrade to child.kill().","Avoid kill_process_group entirely on no-process-group platforms."],"exampleFix":"// before\nchild.kill_process_group()?;\n// after\n#[cfg(not(target_os = \"espidf\"))]\nchild.kill_process_group()?;\n#[cfg(target_os = \"espidf\")]\nchild.kill()?","handlingStrategy":"validation","validationCode":"// Compile-time gate: only call kill_process_group where it is supported.\n#[cfg(not(target_os = \"espidf\"))]\nfn kill_group(child: &mut std::process::Child) -> std::io::Result<()> {\n    use std::os::unix::process::ChildExt;\n    child.kill_process_group()\n}\n#[cfg(target_os = \"espidf\")]\nfn kill_group(child: &mut std::process::Child) -> std::io::Result<()> {\n    child.kill() // no process groups on espidf\n}","typeGuard":null,"tryCatchPattern":"match child.kill_process_group() {\n    Ok(()) => {},\n    Err(e) if e.kind() == std::io::ErrorKind::Unsupported => {\n        let _ = child.kill();\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Centralize process-group kills behind a cfg-gated helper.","Document target support for any code using kill_process_group."],"tags":["rust","std","process","espidf","platform","unsupported"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}