{"record":{"id":"9f8801fb621d480e","repo":"oven-sh/bun","slug":"insufficientspace","errorCode":null,"errorMessage":"InsufficientSpace","messagePattern":"InsufficientSpace","errorType":"console","errorClass":"bun_exe_format::pe::Error","httpStatus":null,"severity":"warning","filePath":"src/exe_format/pe.rs","lineNumber":39,"sourceCode":"    #[error(\"InvalidPESignature\")]\n    InvalidPESignature,\n    #[error(\"UnsupportedPEFormat\")]\n    UnsupportedPEFormat,\n    #[error(\"InsufficientHeaderSpace\")]\n    InsufficientHeaderSpace,\n    #[error(\"TooManySections\")]\n    TooManySections,\n    #[error(\"SectionExists\")]\n    SectionExists,\n    #[error(\"InputIsSigned\")]\n    InputIsSigned,\n    #[error(\"InvalidSecurityDirectory\")]\n    InvalidSecurityDirectory,\n    #[error(\"SecurityDirInsideImage\")]\n    SecurityDirInsideImage,\n    #[error(\"UnexpectedOverlayPresent\")]\n    UnexpectedOverlayPresent,\n    #[error(\"InsufficientSpace\")]\n    InsufficientSpace,\n}\n\n/// Windows PE Binary manipulation for codesigning standalone executables\npub struct PEFile {\n    pub(crate) data: Vec<u8>,\n    // Store offsets instead of pointers to avoid invalidation after resize\n    pub(crate) pe_header_offset: usize,\n    pub(crate) optional_header_offset: usize,\n    pub(crate) section_headers_offset: usize,\n    pub(crate) num_sections: u16,\n}\n\n// PE/COFF on-disk header structs are byte-packed (no padding) per spec, and may\n// live at arbitrary byte offsets inside a `Vec<u8>` image, so `align_of` must be 1\n// for it to be sound to materialize references/pointers to them from the buffer.\n#[repr(C, packed)]\n#[derive(Copy, Clone)]","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/src/exe_format/pe.rs#L21-L57","documentation":"A declared 'not enough space' variant of the PE-manipulation error enum (src/exe_format/pe.rs:39-40). Grep shows no construction site anywhere in the workspace — space checks in pe.rs use the more specific InsufficientHeaderSpace, OutOfBounds and Overflow variants instead. It exists for API completeness/exhaustive matching of bun_exe_format::pe::Error.","triggerScenarios":"Not thrown by any current code path. You can still observe it as a value when pattern-matching the enum in downstream Rust code, or in older Bun builds whose injector used it as a catch-all space error.","commonSituations":"Writing `match` arms over the error enum (the compiler forces you to handle it); reading old release notes/logs where it was produced during .bun section injection on space-starved PEs.","solutions":["If it appears in a match, map it to the same handling as InsufficientHeaderSpace/OutOfBounds (free header slack or replace the base).","If you believe you saw it at runtime, you are likely on an old Bun — upgrade and re-test with the stock base exe.","Report a bug with the base executable attached if a current build genuinely produces it."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Know that this variant has no active throw sites — treat it as dead/reserved","In Rust matches, fold it into the same arm as InsufficientHeaderSpace","If it surfaces at runtime you are on an old build — upgrade first, debug second"],"tags":["windows","pe","dead-code","compile"],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}