openai/codex · error

invalid system bubblewrap path

Error message

invalid system bubblewrap path: {err}

What it means

The resolved system bubblewrap binary path contained an interior NUL byte, so it could not be converted to a C string for execv. This panic in exec_system_bwrap is a defensive guard on a path that should never occur for filesystem-derived paths on Linux; if it fires, the bwrap program path itself is corrupted or was constructed from invalid input.

Solutions

  1. Check how the bwrap path was resolved (env override or PATH lookup) and remove embedded NUL bytes or invalid input
  2. Verify the bwrap binary path with `ls -l` and `file` to confirm it is a normal executable
  3. Reinstall bubblewrap if its path on disk appears corrupted
  4. Report as a bug if it reproduces with a stock installation
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/linux-sandbox/src/launcher.rs:217 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/7d8a96ff34817907. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/linux-sandbox/src/launcher.rs:217

    }
    Some(SystemBwrapCapabilities {
        supports_argv0: stdout.contains("--argv0") || stderr.contains("--argv0"),
        supports_perms: stdout.contains("--perms") || stderr.contains("--perms"),
        supports_ro_bind_fd: stdout.contains("--ro-bind-fd") || stderr.contains("--ro-bind-fd"),
    })
}

fn exec_system_bwrap(
    program: &AbsolutePathBuf,
    argv: Vec<String>,
    preserved_files: Vec<File>,
) -> ! {
    // System bwrap runs across an exec boundary, so preserved fds must survive exec.
    make_files_inheritable(&preserved_files);

    let program_path = program.as_path().display().to_string();
    let program = CString::new(program.as_path().as_os_str().as_bytes())
        .unwrap_or_else(|err| panic!("invalid system bubblewrap path: {err}"));
    let cstrings = argv_to_cstrings(&argv);
    let mut argv_ptrs: Vec<*const c_char> = cstrings
        .iter()
        .map(CString::as_c_str)
        .map(CStr::as_ptr)
        .collect();
    argv_ptrs.push(std::ptr::null());

    // SAFETY: `program` and every entry in `argv_ptrs` are valid C strings for
    // the duration of the call. On success `execv` does not return.
    unsafe {
        libc::execv(program.as_ptr(), argv_ptrs.as_ptr());
    }
    let err = std::io::Error::last_os_error();
    panic!("failed to exec system bubblewrap {program_path}: {err}");
}

#[cfg(test)]

View on GitHub (pinned to 339751715c)