{"record":{"id":"efeffde0edbe91ae","repo":"apache/hadoop","slug":"zstddecompressctx-is-not-initialized","errorCode":null,"errorMessage":"ZstdDecompressCtx is not initialized","messagePattern":"ZstdDecompressCtx is not initialized","errorType":"exception","errorClass":"NullPointerException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/zstd/ZStandardDecompressor.java","lineNumber":254,"sourceCode":"    userBufferBytesToConsume = 0;\n  }\n\n  @Override\n  public void end() {\n    if (zstdJniCtx != null) {\n      zstdJniCtx.close();\n      zstdJniCtx = null;\n    }\n  }\n\n  @Override\n  protected void finalize() {\n    end();\n  }\n\n  private void checkStream() {\n    if (zstdJniCtx == null) {\n      throw new NullPointerException(\"ZstdDecompressCtx is not initialized\");\n    }\n  }\n\n  private int populateUncompressedBuffer(byte[] b, int off, int len, int n) {\n    n = Math.min(n, len);\n    uncompressedDirectBuf.get(b, off, n);\n    return n;\n  }\n\n  int inflateDirect(ByteBuffer src, ByteBuffer dst) {\n    assert (this instanceof ZStandardDecompressor.ZStandardDirectDecompressor);\n\n    int origDstPos = dst.position();\n    boolean done = zstdJniCtx.decompressDirectByteBufferStream(dst, src);\n    remaining = src.limit() - src.position();\n    // Mirror decompress(): only mark finished when the frame is done AND no\n    // more bytes remain (src may contain additional concatenated frames).\n    if (done && remaining == 0) {","sourceCodeStart":236,"sourceCodeEnd":272,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/zstd/ZStandardDecompressor.java#L236-L272","documentation":"Error \"ZstdDecompressCtx is not initialized\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/zstd/ZStandardDecompressor.java:254 when the library encounters an invalid state.","commonSituations":"Occurs when the native Zstd decompression context is not initialized. Initialize the decompressor before use and do not call decompress after close.","solutions":["Ensure the native zstd library loaded successfully and the decompressor context was initialized; do not use the decompressor after close()."],"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-23T01:17:44.959Z"}