United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6252173 : JVMTI Spec: SetJNIFunctionTable spec may not be achievable with the way that JNIEnv is declared

Details
Type:
Bug
Submit Date:
2005-04-07
Status:
Resolved
Updated Date:
2011-02-16
Project Name:
JDK
Resolved Date:
2005-09-22
Component:
hotspot
OS:
generic
Sub-Component:
jvmti
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports

Sub Tasks

Description
The specification for SetJNIFunctionTable states: 

"Set the JNI function table in all current and future JNI environments. As a result, all future JNI calls are directed to the specified functions."

However the assertion that all future JNI calls will be directs may conflict with the definition of JNIEnv in the standard jni.h header file:

struct JNIEnv_ {
    const struct JNINativeInterface_ *functions;
    :
}

#ifdef __cplusplus
typedef JNIEnv_ JNIEnv;
#else
typedef const struct JNINativeInterface_ *JNIEnv;
#endif

As "functions" is a pointer to a readonly function table it's possible that some compilers might optimize away the access to the table.

The JVMTI spec needs to be updated to make it clear that the future JNI calls will only be directed when JNI code re-fetches the function address.

###@###.### 2005-04-07 18:40:53 GMT

                                    

Comments
EVALUATION

Spec must be updated per Description.
                                     
2005-07-28



Hardware and Software, Engineered to Work Together