{"record":{"id":"4dcfe2b1ebf114be","repo":"jruby/jruby","slug":"mark-is-invalidated","errorCode":null,"errorMessage":"Mark is invalidated.","messagePattern":"Mark is invalidated\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/jruby/embed/io/ReaderInputStream.java","lineNumber":467,"sourceCode":"     *     to subsequent callers of the <code>read</code> method depend on the\n     *     particular type of the input stream. </ul></ul>\n     *\n     * @exception  IOException  if this stream has not been marked or if the\n     *               mark has been invalidated.\n     * @see     java.io.InputStream#mark(int)\n     * @see     java.io.IOException\n     */\n    @Override\n    public synchronized void reset() throws IOException {\n        synchronized (lock) {\n            if (!isOpen) {\n                throw new IOException(\"This stream has been closed.\");\n            }\n            if (markedIndex < 0) {\n                throw new IOException(\"This stream is not marked.\");\n            }\n            if ((position - markedIndex) > readlimit) {\n                throw new IOException(\"Mark is invalidated.\");\n            }\n            position = markedIndex;\n        }\n    }\n\n    /**\n     * Skips over and discards <code>n</code> bytes of data from this input\n     * stream. The <code>skip</code> method may, for a variety of reasons, end\n     * up skipping over some smaller number of bytes, possibly <code>0</code>.\n     * This may result from any of a number of conditions; reaching end of file\n     * before <code>n</code> bytes have been skipped is only one possibility.\n     * The actual number of bytes skipped is returned.  If <code>n</code> is\n     * negative, no bytes are skipped.\n     *\n     * @param      n   the number of bytes to be skipped.\n     * @return     the actual number of bytes skipped.\n     * @exception  IOException  if the stream does not support seek,\n     *                          or if some other I/O error occurs.","sourceCodeStart":449,"sourceCodeEnd":485,"githubUrl":"https://github.com/jruby/jruby/blob/fb650c13e02b5a600fa66384655069d5ec30c362/core/src/main/java/org/jruby/embed/io/ReaderInputStream.java#L449-L485","documentation":"Error \"Mark is invalidated.\" thrown in jruby/jruby.","triggerScenarios":"Thrown at core/src/main/java/org/jruby/embed/io/ReaderInputStream.java:467 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["reset() was called after reading past the mark's read limit, invalidating the mark. Re-mark the stream, or call reset() before exceeding the readlimit."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fb650c13e02b5a600fa66384655069d5ec30c362","analyzedAt":"2026-08-23T07:18:57.479Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}