JDK-8155635 : C2: Mixed unsafe oop accesses break alias analysis
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-04-28
  • Updated: 2019-04-24
  • Resolved: 2016-08-25
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.
JDK 8 JDK 9
8u202Fixed 9 b137Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Description
Unsafe accesses can produce untyped pointers:

#  Internal Error (/Users/vlivanov/ws/jdk/hs-comp9/hotspot/src/share/vm/opto/compile.cpp:1712), pid=61943, tid=22531
#  assert(flat != TypePtr::BOTTOM) failed: cannot alias-analyze an untyped ptr

ILW = MLH = P4
I = M: assert
L = L: observed only with modified JVM
W = H: no workaround
Comments
verified by nightly testing
26-07-2017

47: CastPP = Oop:java/lang/Object:NotNull * 56: CheckCastPP = Oop:SunMiscUnsafeAccessTestObject:NotNull * 40: Phi = Oop:SunMiscUnsafeAccessTestObject * 142: AddP = Oop:SunMiscUnsafeAccessTestObject+12 * [narrow]
28-04-2016

The problematic node is produced during split_if transformation. There's a Phi node which merges NULL & exact klass types from receiver null & exact type checks. AddP uses that Phi as a base and during through the Phi 2 new AddP nodes are created: for null base and for non-null base. Null-based AddP is not a raw pointer, but untyped ptr.
28-04-2016

# Internal Error (/Users/vlivanov/ws/jdk/hs-comp9/hotspot/src/share/vm/opto/compile.cpp:1712), pid=61987, tid=22531 # assert(flat != TypePtr::BOTTOM) failed: cannot alias-analyze an untyped ptr V [libjvm.dylib+0x56a168] Compile::find_alias_type(TypePtr const*, bool, ciField*)+0x188 V [libjvm.dylib+0x1bcae9] Compile::alias_type(TypePtr const*, ciField*)+0x29 V [libjvm.dylib+0x292551] Compile::get_alias_index(TypePtr const*)+0x21 V [libjvm.dylib+0x56dc68] Compile::final_graph_reshaping_impl(Node*, Final_Reshape_Counts&)+0x258 V [libjvm.dylib+0x570369] Compile::final_graph_reshaping_walk(Node_Stack&, Node*, Final_Reshape_Counts&)+0x1e9 V [libjvm.dylib+0x56ca31] Compile::final_graph_reshaping()+0x151 V [libjvm.dylib+0x566697] Compile::Optimize()+0xea7 V [libjvm.dylib+0x563f8e] Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, DirectiveSet*)+0xfee V [libjvm.dylib+0x5673fe] Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, DirectiveSet*)+0x8e V [libjvm.dylib+0x422f08] C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0x148
28-04-2016