Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8183654 | 8u161 | Unassigned | P2 | Resolved | Fixed | b01 |
JDK-8171502 | 8u152 | Zoltan Majo | P2 | Closed | Fixed | b01 |
JDK-8171158 | 8 | Zoltan Majo | P2 | Closed | Duplicate | |
JDK-8192218 | emb-8u161 | Unassigned | P2 | Resolved | Fixed | b01 |
JDK-8182986 | 7u171 | Shafi Ahmad | P2 | Closed | Fixed | b01 |
If the field targeted by a putfield/putstatic is non-existent, klass->find_field() returns NULL and fd is not initialized.
http://hg.openjdk.java.net/jdk9/hs/hotspot/file/a57e11acea79/src/share/vm/interpreter/rewriter.cpp#l429
However, as the return value of find_field() is not checked, data from the uninitialized field is read and that triggers an assert in set_has_initialized_final_field_update().
http://hg.openjdk.java.net/jdk9/hs/hotspot/file/a57e11acea79/src/share/vm/interpreter/rewriter.cpp#l433
# Internal Error (/opt/jprt/T/P1/120200.zmajo/s/hotspot/src/share/vm/runtime/handles.hpp:173), pid=8027, tid=0xe2eaeb40
# assert(_value != NULL) failed: resolving NULL _value
[...]
V [libjvm.so+0x9f021b] VMError::report_and_die()+0x17b
V [libjvm.so+0x392638] report_vm_error(char const*, int, char const*, char const*)+0x68
V [libjvm.so+0x8cbaa7] fieldDescriptor::set_has_initialized_final_update(bool)+0x97
V [libjvm.so+0x8c9be6] Rewriter::scan_method(Method*, bool, bool*)+0xa76
V [libjvm.so+0x8c9d44] Rewriter::rewrite_bytecodes(Thread*)+0xb4
V [libjvm.so+0x8ca1cb] Rewriter::Rewriter(instanceKlassHandle, constantPoolHandle, Array<Method*>*, Thread*)+0x31b
V [libjvm.so+0x8caef3] Rewriter::rewrite(instanceKlassHandle, Thread*)+0x123
V [libjvm.so+0x4d3c8e] InstanceKlass::rewrite_class(Thread*)+0x9e
V [libjvm.so+0x4d528a] InstanceKlass::link_class_impl(instanceKlassHandle, bool, Thread*)+0x60a
V [libjvm.so+0x4d550a] InstanceKlass::link_class(Thread*)+0x8a
V [libjvm.so+0x4d554c] InstanceKlass::initialize_impl(instanceKlassHandle, Thread*)+0x1c
V [libjvm.so+0x4d5b63] InstanceKlass::initialize(Thread*)+0x83
V [libjvm.so+0x62899d] find_class_from_class_loader(JNIEnv_*, Symbol*, unsigned char, Handle, Handle, unsigned char, Thread*)+0xed
V [libjvm.so+0x649b67] JVM_FindClassFromCaller+0x4d7
C [libjava.so+0xa46d] Java_java_lang_Class_forName0+0x14d
[...]
This bug was triggered with the vm/classfmt/vrf/vrfpsf202/vrfpsf20202m1 test; the test tries to access a non-existent field and is expected to fail with:
"Passed with runtime exception: java.lang.NoSuchFieldError: ibGlob"
The bug triggered while I was testing the 8u backport of
- backported by
-
JDK-8183654 Scanning method file for initialized final field updates can fail for non-existent fields
-
- Resolved
-
-
JDK-8192218 Scanning method file for initialized final field updates can fail for non-existent fields
-
- Resolved
-
-
JDK-8171158 Scanning method file for initialized final field updates can fail for non-existent fields
-
- Closed
-
-
JDK-8171502 Scanning method file for initialized final field updates can fail for non-existent fields
-
- Closed
-
-
JDK-8182986 Scanning method file for initialized final field updates can fail for non-existent fields
-
- Closed
-
- relates to
-
JDK-8161988 Compilers accept modification of final fields outside initializer methods
-
- Resolved
-