oracle/graal · error

Error creating an event set: %s

Error message

Error creating an event set: %s

What it means

Error "Error creating an event set: %s " thrown in oracle/graal.

Source

Thrown at compiler/src/org.graalvm.papibridge/src/papibridge.c:64

    }
    return JNI_TRUE;
}

/**
 * Creates a new PAPI event set and adds the specified events to it.
 *
 * @param env The JNI environment.
 * @param cls The Java class that this native method belongs to.
 * @param eventNames An array of event names to be added to the event set.
 *
 * @return The handle of the created event set, or PAPI_NULL if an error occurs.
 */
JNIEXPORT jint JNICALL Java_jdk_graal_compiler_hotspot_replaycomp_HardwarePerformanceCounters_createEventSet(JNIEnv *env, jclass cls,
                                                                                                             jobjectArray eventNames) {
    int eventset = PAPI_NULL;
    int retval = PAPI_create_eventset(&eventset);
    if (retval != PAPI_OK) {
        fprintf(stderr, "Error creating an event set: %s\n", PAPI_strerror(retval));
        return PAPI_NULL;
    }
    jsize arrayLen = (*env)->GetArrayLength(env, eventNames);
    for (jsize i = 0; i < arrayLen; i++) {
        jstring eventNameString = (jstring) (*env)->GetObjectArrayElement(env, eventNames, i);
        const char *eventName = (*env)->GetStringUTFChars(env, eventNameString, 0);
        if ((retval = PAPI_add_named_event(eventset, eventName)) != PAPI_OK) {
            fprintf(stderr, "Error adding %s to event set %d: %s\n", eventName, eventset, PAPI_strerror(retval));
            (*env)->ReleaseStringUTFChars(env, eventNameString, eventName);
            (*env)->DeleteLocalRef(env, eventNameString);
            PAPI_destroy_eventset(&eventset);
            return PAPI_NULL;
        }
        (*env)->ReleaseStringUTFChars(env, eventNameString, eventName);
        (*env)->DeleteLocalRef(env, eventNameString);
    }
    return eventset;
}

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Fix the condition reported by the error: Error creating an event set: {}
  2. Check the throwing call site and ensure its documented preconditions (argument values, types, environment, or configuration) are satisfied before the call.

Example fix

Validate inputs and environment so that the failing condition does not occur: Error creating an event set: {}

When it happens

Trigger: Thrown at compiler/src/org.graalvm.papibridge/src/papibridge.c:64 when the library encounters an invalid state.

Common situations: Occurs when a caller violates the contract guarded by this check: Error creating an event set: {}


AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14). Data as JSON: /api/errors/bec1400ba3e76562. Report an issue: GitHub.