{"record":{"id":"803041165f5ff06b","repo":"vosen/ZLUDA","slug":"failed-to-read-803041","errorCode":null,"errorMessage":"Failed to read {}: {}","messagePattern":"Failed to read (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ptx/build.rs","lineNumber":18,"sourceCode":"use std::fs::File;\nuse std::io::Read;\n\nfn main() {\n    let bc_path = \"lib/zluda_ptx_impl.bc\";\n    let bc_constrained_path = \"lib/zluda_ptx_impl_constrained.bc\";\n    println!(\"cargo:rerun-if-changed={}\", bc_path);\n    println!(\"cargo:rerun-if-changed={}\", bc_constrained_path);\n    check_lfs_file(bc_path);\n    check_lfs_file(bc_constrained_path);\n}\n\nfn check_lfs_file(bc_path: &str) {\n    let mut magic = [0u8; 2];\n    File::open(bc_path)\n        .unwrap_or_else(|e| panic!(\"Failed to open {}: {}\", bc_path, e))\n        .read_exact(&mut magic)\n        .unwrap_or_else(|e| panic!(\"Failed to read {}: {}\", bc_path, e));\n    assert!(\n        &magic == b\"BC\",\n        \"{} is a git lfs stub and not the actual file. Run `git lfs pull` to fetch it\",\n        bc_path\n    );\n}\n","sourceCodeStart":1,"sourceCodeEnd":25,"githubUrl":"https://github.com/vosen/ZLUDA/blob/9c8b43f242985150f86a7f485218b7b82c3e96ca/ptx/build.rs#L1-L25","documentation":"ptx build-script panic in check_lfs_file: opening the .bc file succeeded but reading the 2-byte magic header failed. Since only 2 bytes are requested, this indicates a zero-length file or an I/O error — most commonly an aborted LFS smudge leaving an empty or unreadable file for lib/zluda_ptx_impl*.bc.","triggerScenarios":"Thrown at ptx/build.rs:18 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the .bc file is not zero-length; re-pull with `git lfs pull` if it is","Ensure the file is a regular file with read permissions","Retry the build after fixing LFS hooks (`git lfs install`)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9c8b43f242985150f86a7f485218b7b82c3e96ca","analyzedAt":"2026-09-06T09:21:08.049Z","contentChangedAt":"2026-09-06T09:21:08.049Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}