{"record":{"id":"43e50f936424ec99","repo":"openjdk/jdk","slug":"java-lang-instrument-assertion-failed","errorCode":null,"errorMessage":"*** java.lang.instrument ASSERTION FAILED ***: \\\"%s\\\" at %s line: %d\\n","messagePattern":"\\*\\*\\* java\\.lang\\.instrument ASSERTION FAILED \\*\\*\\*: \\\\\"(.+?)\\\\\" at (.+?) line: (.+?)\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/java.instrument/share/native/libinstrument/JPLISAssert.c","lineNumber":45,"sourceCode":" * Copyright 2003 Wily Technology, Inc.\n */\n\n#include    <jni.h>\n\n#include    \"JPLISAssert.h\"\n\n/*\n *  Super-cheesy assertions that aren't efficient when they are turned on, but\n *  are free when turned off (all pre-processor stuff)\n */\n\nvoid\nJPLISAssertCondition(   jboolean        condition,\n                        const char *    assertionText,\n                        const char *    file,\n                        int             line) {\n    if ( !condition ) {\n        fprintf(stderr, \"*** java.lang.instrument ASSERTION FAILED ***: \\\"%s\\\" at %s line: %d\\n\",\n                                            assertionText,\n                                            file,\n                                            line);\n    }\n}\n\n\nvoid\nJPLISAssertConditionWithMessage(    jboolean        condition,\n                                    const char *    assertionText,\n                                    const char *    message,\n                                    const char *    file,\n                                    int             line) {\n    if ( !condition ) {\n        fprintf(stderr, \"*** java.lang.instrument ASSERTION FAILED ***: \\\"%s\\\" with message %s at %s line: %d\\n\",\n                                            assertionText,\n                                            message,\n                                            file,","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/openjdk/jdk/blob/88dfb74bbeefcf2b0aa11835183bcd949998fc8f/src/java.instrument/share/native/libinstrument/JPLISAssert.c#L27-L63","documentation":"A libinstrument internal assertion (compiled in when debugging checks are on) failed: an invariant expected by the instrument library did not hold at the given file/line. This signals a bug inside the JDK's instrument code or a corrupted JVM/native state, not a user configuration error. Execution continues after printing.","triggerScenarios":"Running a debug/checked build of libinstrument where jplis_assert conditions fail: unexpected JVMTI return values, invariant violations in agent bookkeeping, mismatched library vs JVM builds.","commonSituations":"Custom or fastdebug JDK builds; mixing a libinstrument.so from one JDK with the runtime of another; JDK bugs after an upgrade.","solutions":["Capture the file/line from the message and search the JDK bug database (bugs.openjdk.org) for it","Ensure the JDK installation is consistent (one JAVA_HOME, no copied native libs)","Reproduce on the latest patch release of that JDK line and upgrade if fixed","Report to the JDK team with the exact assertion text and reproduction if it persists"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run release builds of the JDK in production (assertions in libinstrument are debug-time checks)","Keep a consistent single-JDK installation and upgrade patch versions when assertions are reported"],"tags":["java-instrument","assertion","jdk-bug","diagnostics","c"],"backgroundTag":null,"analyzedSha":"88dfb74bbeefcf2b0aa11835183bcd949998fc8f","analyzedAt":"2026-08-14T11:45:09.665Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}