Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
SLES10
Description
The function JNI_CreateJavaVM() causes Segmentation fault if it is called after the VM has been destroyed in the same process. The following test reproduces this issue:
#include "jni.h"
static JavaVM * p_vm;
static JNIEnv * p_env;
static void vm_create() {
JavaVMInitArgs vm_args;
JavaVMOption options[0];
JNI_GetDefaultJavaVMInitArgs(&vm_args);
vm_args.options = options;
vm_args.nOptions = 0;
vm_args.ignoreUnrecognized = JNI_TRUE;
vm_args.version = JNI_VERSION_1_2;
if (JNI_CreateJavaVM(&p_vm, &p_env, &vm_args) < 0)
{ printf("Failed to create VM\n"); } printf("VM created\n");
}
static void vm_destroy() {
if (p_vm == NULL)
if ((*p_vm)->DestroyJavaVM(p_vm) < 0)
{ printf("Failed to destroy VM\n"); } p_vm = NULL;
p_env = NULL;
printf("VM destroyed\n");
}
int main() {
vm_create();
vm_destroy();
vm_create();
return 0;
}
Attachments
Attachments
Issue Links
- depends upon
-
HARMONY-5508 [drlvm][shutdown] DRLVM doesn't unload all loaded libraries
- Open