{"record":{"id":"880ca3acf434a054","repo":"openai/codex","slug":"too-many-fds","errorCode":null,"errorMessage":"too many fds: {}","messagePattern":"too many fds: (.+?)","errorType":"exception","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/shell-escalation/src/unix/socket.rs","lineNumber":212,"sourceCode":"            ),\n        ));\n    }\n    Ok(())\n}\n\nfn encode_length(len: usize) -> std::io::Result<[u8; LENGTH_PREFIX_SIZE]> {\n    let len_u32 = u32::try_from(len).map_err(|_| {\n        std::io::Error::new(\n            std::io::ErrorKind::InvalidInput,\n            format!(\"message too large: {len}\"),\n        )\n    })?;\n    Ok(len_u32.to_le_bytes())\n}\n\nfn make_control_message(fds: &[OwnedFd]) -> std::io::Result<Vec<u8>> {\n    if fds.len() > MAX_FDS_PER_MESSAGE {\n        Err(std::io::Error::new(\n            std::io::ErrorKind::InvalidInput,\n            format!(\"too many fds: {}\", fds.len()),\n        ))\n    } else if fds.is_empty() {\n        Ok(Vec::new())\n    } else {\n        let mut control = vec![0u8; control_space_for_fds(fds.len())];\n        unsafe {\n            let cmsg = control.as_mut_ptr().cast::<libc::cmsghdr>();\n            (*cmsg).cmsg_len =\n                libc::CMSG_LEN(size_of::<RawFd>() as c_uint * fds.len() as c_uint) as _;\n            (*cmsg).cmsg_level = libc::SOL_SOCKET;\n            (*cmsg).cmsg_type = libc::SCM_RIGHTS;\n            let data_ptr = libc::CMSG_DATA(cmsg).cast::<RawFd>();\n            for (i, fd) in fds.iter().enumerate() {\n                data_ptr.add(i).write(fd.as_raw_fd());\n            }\n        }","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/shell-escalation/src/unix/socket.rs#L194-L230","documentation":"Error \"too many fds: {}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/shell-escalation/src/unix/socket.rs:212 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}