oracle/graal · error
Call to uninitialized JNI function slot
Error message
Call to uninitialized JNI function slot
What it means
Error "Call to uninitialized JNI function slot" thrown in oracle/graal.
Source
Thrown at espresso/src/com.oracle.truffle.espresso.native/src/nespresso.c:492
// If there's an isolate-aware JavaVM, find it.
if ((*vm)->reserved1 == MOKA_AMERICANO) {
vm = (JavaVM*) (*vm)->reserved2;
// MOKA_AMERICANO JavaVM can only point to a MOKA_LATTE.
if ((*vm)->reserved1 != MOKA_LATTE) {
fprintf(stderr, "GetJavaVM: not a MOKA_LATTE" OS_NEWLINE_STR);
return JNI_ERR;
}
} else if ((*vm)->reserved1 != MOKA_RISTRETTO) {
fprintf(stderr, "GetJavaVM: not a MOKA_RISTRETTO" OS_NEWLINE_STR);
return JNI_ERR;
}
*vmPtr = vm;
return JNI_OK;
}
static void unset_function_error() {
fprintf(stderr, "Call to uninitialized JNI function slot" OS_NEWLINE_STR);
exit(-1);
}
JNIEXPORT JNIEnv* JNICALL initializeNativeContext(void* (*fetch_by_name)(const char *)) {
JNIEnv* env = (JNIEnv*) malloc(sizeof(*env));
struct JNINativeInterface_* jni_impl = malloc(sizeof(*jni_impl));
struct NespressoEnv* nespresso_env = (struct NespressoEnv*) malloc(sizeof(*nespresso_env));
jni_impl->reserved0 = nespresso_env;
jni_impl->reserved1 = NULL;
jni_impl->reserved2 = NULL;
jni_impl->reserved3 = NULL;
int fnCount = sizeof(*jni_impl) / sizeof(void*);
for (int i = 4; i < fnCount; ++i) {
((void**)jni_impl)[i] = &unset_function_error;
}
*env = jni_impl;View on GitHub (pinned to a66e9ccd1d)
Solutions
- Fix the condition reported by the error: Call to uninitialized JNI function slot
- 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: Call to uninitialized JNI function slot
When it happens
Trigger: Thrown at espresso/src/com.oracle.truffle.espresso.native/src/nespresso.c:492 when the library encounters an invalid state.
Common situations: Occurs when a caller violates the contract guarded by this check: Call to uninitialized JNI function slot
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/2cc9e08540c59181.
Report an issue: GitHub.