JDK-8189802 : [lworld] Non-flattened value type array is not initialized
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: repo-valhalla
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-10-23
  • Updated: 2021-07-27
  • Resolved: 2018-09-12
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
repo-valhallaFixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
ValueOopsMVT test crashes with -XX:-ValueArrayFlatten because C2 removes the array initialization code of an unused array while the array is still allocated and processed by the GC:

#  Internal Error (/oracle/valhalla/src/hotspot/share/oops/oop.inline.hpp:319), pid=23668, tid=23671
#  assert(check_obj_alignment(result)) failed: address not aligned: 0x00000000baadbabe

Stack: [0x00007f1fece3c000,0x00007f1fecf3c000],  sp=0x00007f1fecf398f0,  free space=1014k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x17b535c]  VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x18c
V  [libjvm.so+0x17b617f]  VMError::report_and_die(Thread*, char const*, int, char const*, char const*, __va_list_tag*)+0x2f
V  [libjvm.so+0xb5a8d2]  report_vm_error(char const*, int, char const*, char const*, ...)+0x112
V  [libjvm.so+0xa02432]  oopDesc::decode_heap_oop_not_null(unsigned int)+0xd2
V  [libjvm.so+0xa0419c]  void ExtendedOopClosure::verify<unsigned int>(unsigned int*)+0x6c
V  [libjvm.so+0xde334b]  void ObjArrayKlass::oop_oop_iterate<true, FastScanClosure>(oop, FastScanClosure*)+0x13b
V  [libjvm.so+0xdd7fb1]  ObjArrayKlass::oop_oop_iterate_nv(oop, FastScanClosure*)+0x41
V  [libjvm.so+0x15fbb81]  ContiguousSpace::oop_since_save_marks_iterate_nv(FastScanClosure*)+0x111
V  [libjvm.so+0xb6b6c3]  DefNewGeneration::oop_since_save_marks_iterate_nv(FastScanClosure*)+0x43
V  [libjvm.so+0xdce81d]  GenCollectedHeap::oop_since_save_marks_iterate(GenCollectedHeap::GenerationType, FastScanClosure*, FastScanClosure*)+0x3d
V  [libjvm.so+0xb6ecec]  DefNewGeneration::collect(bool, bool, unsigned long, bool)+0x56c
V  [libjvm.so+0xdd08d0]  GenCollectedHeap::collect_generation(Generation*, bool, unsigned long, bool, bool, bool, bool)+0x350
V  [libjvm.so+0xdd2017]  GenCollectedHeap::do_collection(bool, bool, unsigned long, bool, GenCollectedHeap::GenerationType)+0x347
V  [libjvm.so+0xa72f8d]  GenCollectorPolicy::satisfy_failed_allocation(unsigned long, bool)+0xed
V  [libjvm.so+0x17b6c1c]  VM_GenCollectForAllocation::doit()+0xdc
V  [libjvm.so+0x17f13a8]  VM_Operation::evaluate()+0x218
V  [libjvm.so+0x17ed6ea]  VMThread::evaluate_operation(VM_Operation*)+0x11a
V  [libjvm.so+0x17ee5c4]  VMThread::loop()+0x2e4
V  [libjvm.so+0x17eee0f]  VMThread::run()+0xcf
V  [libjvm.so+0x14257aa]  thread_native_entry(Thread*)+0xfa
Comments
http://hg.openjdk.java.net/valhalla/valhalla/rev/b826402f953a
12-09-2018

Roland said: "One thing we might consider is whether it's possible to make zeroing elimination work with an initialization value that's not zero. We could then piggy back on zeroing elimination to implement initialization of non flattened array value array better."
02-07-2018

I've pushed a workaround fix for this: http://hg.openjdk.java.net/valhalla/valhalla/rev/02ec88e82173
23-10-2017

ILW = Crash in GC code due to invalid oop in non-flattened value type array, with MVT and -XX:-ValueArrayFlatten, -XX:+ValueArrayFlatten = HLM = P3
23-10-2017