{"record":{"id":"e927d89c8da386e3","repo":"apache/hadoop","slug":"resetting-to-invalid-mark","errorCode":null,"errorMessage":"Resetting to invalid mark","messagePattern":"Resetting to invalid mark","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/file/tfile/BoundedRangeFileInputStream.java","lineNumber":125,"sourceCode":"\n  @Override\n  /*\n   * We may skip beyond the end of the file.\n   */\n  public long skip(long n) throws IOException {\n    long len = Math.min(n, end - pos);\n    pos += len;\n    return len;\n  }\n\n  @Override\n  public synchronized void mark(int readlimit) {\n    mark = pos;\n  }\n\n  @Override\n  public synchronized void reset() throws IOException {\n    if (mark < 0) throw new IOException(\"Resetting to invalid mark\");\n    pos = mark;\n  }\n\n  @Override\n  public boolean markSupported() {\n    return true;\n  }\n\n  @Override\n  public void close() {\n    // Invalidate the state of the stream.\n    in = null;\n    pos = end;\n    mark = -1;\n  }\n}\n","sourceCodeStart":107,"sourceCodeEnd":142,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/file/tfile/BoundedRangeFileInputStream.java#L107-L142","documentation":"Error \"Resetting to invalid mark\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/file/tfile/BoundedRangeFileInputStream.java:125 when the library encounters an invalid state.","commonSituations":"Occurs when reset() is called without a valid preceding mark() or after the mark was invalidated. Call mark() before reset() and avoid reading past the readlimit.","solutions":["Only call reset() after a valid mark() within the read limit; do not reset after reading past the mark limit."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}