{"record":{"id":"2cc9e08540c59181","repo":"oracle/graal","slug":"call-to-uninitialized-jni-function-slot","errorCode":null,"errorMessage":"Call to uninitialized JNI function slot","messagePattern":"Call to uninitialized JNI function slot","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"espresso/src/com.oracle.truffle.espresso.native/src/nespresso.c","lineNumber":492,"sourceCode":"  // If there's an isolate-aware JavaVM, find it.\n  if ((*vm)->reserved1 == MOKA_AMERICANO) {\n    vm = (JavaVM*) (*vm)->reserved2;\n    // MOKA_AMERICANO JavaVM can only point to a MOKA_LATTE.\n    if ((*vm)->reserved1 != MOKA_LATTE) {\n      fprintf(stderr, \"GetJavaVM: not a MOKA_LATTE\" OS_NEWLINE_STR);\n      return JNI_ERR;\n    }\n  } else if ((*vm)->reserved1 != MOKA_RISTRETTO) {\n    fprintf(stderr, \"GetJavaVM: not a MOKA_RISTRETTO\" OS_NEWLINE_STR);\n    return JNI_ERR;\n  }\n\n  *vmPtr = vm;\n  return JNI_OK;\n}\n\nstatic void unset_function_error() {\n  fprintf(stderr, \"Call to uninitialized JNI function slot\" OS_NEWLINE_STR);\n  exit(-1);\n}\n\nJNIEXPORT JNIEnv* JNICALL initializeNativeContext(void* (*fetch_by_name)(const char *)) {\n  JNIEnv* env = (JNIEnv*) malloc(sizeof(*env));\n  struct JNINativeInterface_* jni_impl = malloc(sizeof(*jni_impl));\n  struct NespressoEnv* nespresso_env = (struct NespressoEnv*) malloc(sizeof(*nespresso_env));\n\n  jni_impl->reserved0 = nespresso_env;\n  jni_impl->reserved1 = NULL;\n  jni_impl->reserved2 = NULL;\n  jni_impl->reserved3 = NULL;\n  int fnCount = sizeof(*jni_impl) / sizeof(void*);\n  for (int i = 4; i < fnCount; ++i) {\n    ((void**)jni_impl)[i] = &unset_function_error;\n  }\n\n  *env = jni_impl;","sourceCodeStart":474,"sourceCodeEnd":510,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso/src/com.oracle.truffle.espresso.native/src/nespresso.c#L474-L510","documentation":"Error \"Call to uninitialized JNI function slot\" thrown in oracle/graal.","triggerScenarios":"Thrown at espresso/src/com.oracle.truffle.espresso.native/src/nespresso.c:492 when the library encounters an invalid state.","commonSituations":"Occurs when a caller violates the contract guarded by this check: Call to uninitialized JNI function slot","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."],"exampleFix":"Validate inputs and environment so that the failing condition does not occur: Call to uninitialized JNI function slot","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-15T22:17:37.221Z"}