openjdk/jdk · error

*** java.lang.instrument ASSERTION FAILED ***: \"%s\" at %s

Error message

*** java.lang.instrument ASSERTION FAILED ***: \"%s\" at %s line: %d\n

What it means

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.

Source

Thrown at src/java.instrument/share/native/libinstrument/JPLISAssert.c:45

 * Copyright 2003 Wily Technology, Inc.
 */

#include    <jni.h>

#include    "JPLISAssert.h"

/*
 *  Super-cheesy assertions that aren't efficient when they are turned on, but
 *  are free when turned off (all pre-processor stuff)
 */

void
JPLISAssertCondition(   jboolean        condition,
                        const char *    assertionText,
                        const char *    file,
                        int             line) {
    if ( !condition ) {
        fprintf(stderr, "*** java.lang.instrument ASSERTION FAILED ***: \"%s\" at %s line: %d\n",
                                            assertionText,
                                            file,
                                            line);
    }
}


void
JPLISAssertConditionWithMessage(    jboolean        condition,
                                    const char *    assertionText,
                                    const char *    message,
                                    const char *    file,
                                    int             line) {
    if ( !condition ) {
        fprintf(stderr, "*** java.lang.instrument ASSERTION FAILED ***: \"%s\" with message %s at %s line: %d\n",
                                            assertionText,
                                            message,
                                            file,

View on GitHub (pinned to 88dfb74bbe)

Solutions

  1. Capture the file/line from the message and search the JDK bug database (bugs.openjdk.org) for it
  2. Ensure the JDK installation is consistent (one JAVA_HOME, no copied native libs)
  3. Reproduce on the latest patch release of that JDK line and upgrade if fixed
  4. Report to the JDK team with the exact assertion text and reproduction if it persists
Defensive patterns

Strategy: fallback

Prevention

When it happens

Trigger: 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.

Common situations: Custom or fastdebug JDK builds; mixing a libinstrument.so from one JDK with the runtime of another; JDK bugs after an upgrade.

Related errors


AI-assisted analysis of openjdk/jdk@88dfb74bbe (2026-08-14). Data as JSON: /api/errors/43e50f936424ec99. Report an issue: GitHub.