{"record":{"id":"2958f50e16d682da","repo":"openai/codex","slug":"failed-to-create-stderr-pipe-for-bubblewrap-err","errorCode":null,"errorMessage":"failed to create stderr pipe for bubblewrap: {err}","messagePattern":"failed to create stderr pipe for bubblewrap: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/linux-sandbox/src/linux_run_main.rs","lineNumber":1429,"sourceCode":"///   command, and reads are bounded to a fixed max size.\nfn run_bwrap_in_child_capture_stderr(bwrap_args: crate::bwrap::BwrapArgs) -> String {\n    const MAX_PREFLIGHT_STDERR_BYTES: u64 = 64 * 1024;\n    let crate::bwrap::BwrapArgs {\n        args,\n        preserved_files,\n        synthetic_mount_targets,\n        protected_create_targets,\n    } = bwrap_args;\n    let setup_signal_mask = ForwardedSignalMask::block();\n    let synthetic_mount_registrations = register_synthetic_mount_targets(&synthetic_mount_targets);\n    let protected_create_registrations =\n        register_protected_create_targets(&protected_create_targets);\n\n    let mut pipe_fds = [0; 2];\n    let pipe_res = unsafe { libc::pipe2(pipe_fds.as_mut_ptr(), libc::O_CLOEXEC) };\n    if pipe_res < 0 {\n        let err = std::io::Error::last_os_error();\n        panic!(\"failed to create stderr pipe for bubblewrap: {err}\");\n    }\n    let read_fd = pipe_fds[0];\n    let write_fd = pipe_fds[1];\n\n    let pid = unsafe { libc::fork() };\n    if pid < 0 {\n        let err = std::io::Error::last_os_error();\n        panic!(\"failed to fork for bubblewrap: {err}\");\n    }\n\n    if pid == 0 {\n        reset_forwarded_signal_handlers_to_default();\n        setup_signal_mask.restore();\n        // Child: redirect stderr to the pipe, then run bubblewrap.\n        unsafe {\n            close_fd_or_panic(read_fd, \"close read end in bubblewrap child\");\n            if libc::dup2(write_fd, libc::STDERR_FILENO) < 0 {\n                let err = std::io::Error::last_os_error();","sourceCodeStart":1411,"sourceCodeEnd":1447,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/linux-sandbox/src/linux_run_main.rs#L1411-L1447","documentation":"Error \"failed to create stderr pipe for bubblewrap: {err}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/linux-sandbox/src/linux_run_main.rs:1429 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"}