-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
1.3.0
-
generic
-
generic
Name: dkC59003 Date: 11/05/99
Kestrel 1.3fcs-M VM (both win32 and solaris) crashes when JVMPI
function DisableGC is invoked within JVM_OnLoad function.
HotSpot 1.3fcs-N on win32 works OK.
To reproduce the bug on win32 run doit.bat in
GammaBase/Bugs/<this bug number>
When the test is running on winNT Dr.Watson window pops up
which reads:
An application error has occurred
and an application error log is being generated
java.exe
Exception: access violation (0xc0000005), Address: 0x50001383
Running on 1.3fcs-N (solaris) the test outputs:
$ java -classic -version
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-M)
Classic VM (build 1.3.0-M, green threads, nojit)
$ java -classic -Xrunendisgc001 endisgc001
Point c1
/home/dima/bin/rct.ksh[32]: 11997 Segmentation Fault(coredump)
--------------------------------------------------------------- endisgc001.java
import java.io.PrintStream;
public class endisgc001 {
public static void main(String[] args) {
System.exit(run(args, System.out) + 95/*STATUS_TEMP*/);
}
public static int run(String argv[], PrintStream ref) {
return 0;
}
}
--------------------------------------------------------------- endisgc001.c
#include <stdio.h>
#include "jvmpi.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
JVMPI_Interface *jvmpi;
jint result = 0;
int gc_on = 0;
void eventHook(JVMPI_Event *event) {
JNIEnv *env;
switch(event->event_type) {
case JVMPI_EVENT_GC_START:
printf("GC starting\n");
if (! gc_on) {
printf("GC starting when GC disabled\n");
result = 2/*STATUS_FAILED*/;
}
return;
}
}
JNIEXPORT jint JNICALL JVM_OnLoad(JavaVM *jvm, char *options, void *reserved) {
jint res;
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmpi),
JVMPI_VERSION_1);
if ( res < 0 ) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
}
jvmpi->NotifyEvent = eventHook;
printf("Point c1\n");
jvmpi->DisableGC();
printf("Point c2\n");
if ( jvmpi->EnableEvent(JVMPI_EVENT_GC_START, NULL) != JVMPI_SUCCESS) {
printf("Can not enable GC_START\n");
result = 2/*STATUS_FAILED*/;
}
return JNI_OK;
}
#ifdef __cplusplus
}
#endif
======================================================================
- relates to
-
JDK-4400212 JVM_OnLoad function called after most of JDK classes are loaded
-
- Closed
-