{"record":{"id":"8fa56a42d0033003","repo":"uutils/coreutils","slug":"unexpectedeof","errorCode":"UnexpectedEof","errorMessage":"tried to skip past end of input","messagePattern":"tried to skip past end of input","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"src/uu/od/src/multifile_reader.rs","lineNumber":156,"sourceCode":"    /// special file (e.g. `/dev/null`, which can be skipped past its empty end).\n    /// Everything else - proc/sys files that report a bogus size, pipes, stdin -\n    /// is advanced by reading and discarding. Skipping past the end of the whole\n    /// input is an error, matching GNU `od`.\n    pub fn skip(&mut self, mut n_skip: u64) -> io::Result<()> {\n        while n_skip > 0 {\n            let Some(curr) = self.curr_file.as_mut() else {\n                break;\n            };\n            n_skip = skip_in_file(curr, n_skip)?;\n            if n_skip == 0 {\n                break;\n            }\n            // Current file is exhausted; continue skipping in the next one.\n            self.next_file();\n        }\n\n        if n_skip > 0 {\n            return Err(io::Error::new(\n                io::ErrorKind::UnexpectedEof,\n                translate!(\"od-error-skip-past-end\"),\n            ));\n        }\n        Ok(())\n    }\n}\n\n/// Skip up to `n_skip` bytes within a single file. Returns the number of bytes\n/// that still need to be skipped (0 if the skip landed inside this file, or\n/// the remainder if the file ended first).\nfn skip_in_file(curr: &mut CurrentReader, n_skip: u64) -> io::Result<u64> {\n    #[cfg(unix)]\n    if let CurrentReader::File(f) = curr\n        && let Ok(meta) = f.metadata()\n    {\n        let size = meta.len();\n        let blksize = uucore::fs::sane_blksize::sane_blksize_from_metadata(&meta);","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/uutils/coreutils/blob/0b77ced48502a5f80c51dfa827af7e69f3687053/src/uu/od/src/multifile_reader.rs#L138-L174","documentation":"Error \"tried to skip past end of input\" thrown in uutils/coreutils.","triggerScenarios":"Occurs in od when a skip/seek offset requests skipping beyond the end of the concatenated input files.","commonSituations":"Using `od -j` with an offset larger than the total input size.","solutions":["Ensure the skip offset (-j/-N) is smaller than the input length.","Check the input file size before requesting a skip past its end."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0b77ced48502a5f80c51dfa827af7e69f3687053","analyzedAt":"2026-08-19T21:43:27.871Z","contentChangedAt":"2026-08-19T21:43:27.871Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}