JDK-4993039 : extension of JVM_ACC_WRITTEN_FLAGS with ENUM bit brakes some jvmti/jni code
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-02-11
  • Updated: 2004-04-02
  • Resolved: 2004-02-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 b39Fixed
Related Reports
Relates :  
Description
###@###.### 2004-02-11

Extension of JVM_ACC_WRITTEN_FLAGS with ENUM flag (fix of the bug 4992284) 
shifted the JVM_ACC_FIELD_ACCESS_WATCHED bit inside of the mask
JVM_ACC_WRITTEN_FLAGS.

It cases some problems in jvmti code.

prims/jvmtiRedefineClasses.cpp:

    if ((old_flags ^ new_flags) & JVM_ACC_WRITTEN_FLAGS) {
      return JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED;
    }

The JVM_ACC_WRITTEN_FLAGS is supposed to mask watchpoints in the old_flags.
Now it does not mask the bit JVM_ACC_FIELD_ACCESS_WATCHED because now became
a part of JVM_ACC_WRITTEN_FLAGS.


The follwoing can be problems as well:

prims/jvm.cpp:

(1)
JVM_QUICK_ENTRY(jint, JVM_GetFieldIxModifiers(JNIEnv *env, jclass cls, int field_index))
  JVMWrapper("JVM_GetFieldIxModifiers");
  klassOop k = java_lang_Class::as_klassOop(JNIHandles::resolve_non_null(cls));
  typeArrayOop fields = instanceKlass::cast(k)->fields();
  return fields->ushort_at(field_index * instanceKlass::next_offset + 
instanceKlass::access_flags_offset) & JVM_ACC_WRITTEN_FLAGS;
JVM_END

(2)
JVM_QUICK_ENTRY(jint, JVM_GetCPFieldModifiers(JNIEnv *env, jclass cls, int cp_index, jclass called_cls))
...
          return fields->ushort_at(i + instanceKlass::access_flags_offset) & JVM_ACC_WRITTEN_FLAGS;
...
}

The code above intentionally masks the field watchpoints.

-Serguei

###@###.### 2004-02-13

This bug affects the following NSK tests:

nsk/jvmdi/RedefineClasses/redefclass027
nsk/jvmti/RedefineClasses/redefclass027

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-beta2 FIXED IN: tiger-beta2 INTEGRATED IN: tiger-b39 tiger-beta2 VERIFIED IN: tiger-beta2
14-06-2004

EVALUATION Most of the uses of JVM_ACC_WRITTEN_FLAGS in the VM should be replaced with JVM_RECOGNIZED_CLASS_MODIFIERS, JVM_RECOGNIZED_FIELD_MODIFIERS, or JVM_RECOGNIZED_METHOD_MODIFIERS. ###@###.### 2004-02-11 Fixed in 1.5, either b39 or b40. ###@###.### 2004-02-13
11-02-2004