{"record":{"id":"6a95d5c5d0bab55b","repo":"oracle/graal","slug":"error-stopping-measurements-for-event-set-d-s","errorCode":null,"errorMessage":"Error stopping measurements for event set %d: %s\n","messagePattern":"Error stopping measurements for event set (.+?): (.+?)\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/src/org.graalvm.papibridge/src/papibridge.c","lineNumber":157,"sourceCode":" * @param eventset The handle of the event set to be stopped.\n *\n * @return A Java long array containing the event counts, or NULL if an error occurs.\n */\nJNIEXPORT jlongArray JNICALL Java_jdk_graal_compiler_hotspot_replaycomp_HardwarePerformanceCounters_stop(JNIEnv *env, jclass cls, jint eventset) {\n    int numberOfEvents = 0;\n    int retval = PAPI_list_events(eventset, NULL, &numberOfEvents);\n    if (retval != PAPI_OK || numberOfEvents <= 0) {\n        fprintf(stderr, \"Error: unable to retrieve event count for event set %d: %s\\n\", eventset, PAPI_strerror(retval));\n        return NULL;\n    }\n    long long *counts = (long long *) malloc(numberOfEvents * sizeof(long long));\n    if (counts == NULL) {\n        fprintf(stderr, \"Error: out of memory for counts\\n\");\n        return NULL;\n    }\n    retval = PAPI_stop(eventset, counts);\n    if (retval != PAPI_OK) {\n        fprintf(stderr, \"Error stopping measurements for event set %d: %s\\n\", eventset, PAPI_strerror(retval));\n        free(counts);\n        return NULL;\n    }\n    jlongArray result = (*env)->NewLongArray(env, numberOfEvents);\n    if (result == NULL) {\n        fprintf(stderr, \"Error: could not allocate Java long array\\n\");\n        free(counts);\n        return NULL;\n    }\n    (*env)->SetLongArrayRegion(env, result, 0, numberOfEvents, (jlong *) counts);\n    free(counts);\n    return result;\n}\n","sourceCodeStart":139,"sourceCodeEnd":171,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/org.graalvm.papibridge/src/papibridge.c#L139-L171","documentation":"Error \"Error stopping measurements for event set %d: %s\n\" thrown in oracle/graal.","triggerScenarios":"Thrown at compiler/src/org.graalvm.papibridge/src/papibridge.c:157 when the library encounters an invalid state.","commonSituations":"Occurs when a caller violates the contract guarded by this check: Error stopping measurements for event set {}: {}","solutions":["Fix the condition reported by the error: Error stopping measurements for event set {}: {}","Check the throwing call site and ensure its documented preconditions (argument values, types, environment, or configuration) are satisfied before the call."],"exampleFix":"Validate inputs and environment so that the failing condition does not occur: Error stopping measurements for event set {}: {}","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}