JDK-8058874 : Incorrect liveness info in oop map
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2014-09-22
  • Updated: 2019-05-02
  • Resolved: 2019-02-12
Related Reports
Relates :  
Description
InterpreterOopMap contains incorrect information about dead locals. 
Uninitialized locals can be erroneously marked as live. 

It manifests itself as an assertion failure trying to get/set uninitialized local variable using JVMTI. 
#  Internal Error (/scratch/vlivanov/jdk8u-dev/hotspot/src/share/vm/runtime/stackValue.hpp:64), pid=154856, tid=139709661439744
#  assert(type() == T_OBJECT) failed: type check

ILW = MLM = P4
I = M = assertion failure; may cause incorrect behavior during debugging w/ product binaries 
L = L = debugging bytecode w/o debug info running on top of non-product binaries
W = M = -XX:SupressErrorAt=...    
Comments
Runtime Triage: This is not on our current list of priorities. We will consider this feature if we receive additional customer requirements.
12-02-2019

This does not look as a JVMTI bug even though a fix is needed for JVMTI. Moving it to the hotspot/runtime to keep it under the Runtime team radar.
18-01-2018

This is nothing new, moving to 10. Running IDEA with fastdebug bits isn't something that a customer would do and getting and uninitialized variable will probably give the user junk in the debugger but not crash.
07-09-2016

ILW ?LM = P3 I: Unknown (High), Assert in debug, unknown in product L: Low, debugging bytecode w/o debug info W: Medium, -XX:SupressErrorAt=...
22-04-2016

How to reproduce: (1) compile jdk/test/java/lang/invoke/VarargsArrayTest.java w/o debug info (2) use IDEA (it has a feature to display locals when debug info is unavailable) to debug the test (3) once breakpoint at line 118 is hit, JVM crashes w/ the aforementioned assert
22-09-2014

Sample: jdk/test/java/lang/invoke/VarargsArrayTest.java http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/tip/test/java/lang/invoke/VarargsArrayTest.java Breakpoint @ line 118 (testTypedVarargsArray) (bci 145). Class file (VarargsArrayTest.class), bytecode disasm (testTypedVarargsArray.disasm.log), and trace output (oop_map.trace.145.log) are attached. Problematic VM_GetOrSetLocal operation: (gdb) print *this $2 = { <VM_Operation> = { <CHeapObj<(MemoryType)7>> = {<AllocatedObj> = {_vptr.AllocatedObj = 0x7f26d85176b0}, <No data fields>}, _calling_thread = 0x7f26d01c6800, _priority = NormPriority, _timestamp = 1411153738902, _next = 0x7f26d0151a40, _prev = 0x7f26d0151a40, static _names = 0x7f26d8563580}, _thread = 0x7f26d000e000, _calling_thread = 0x7f26d01c6800, _depth = 0, _index = 9, _type = T_OBJECT, _value = {z = 32 ' ', b = 32 ' ', c = 32, s = 32, i = 32, j = 34359738400, f = 4.48415509e-44, d = 1.6975966343532279e-313, l = 0x800000020}, _jvf = 0x7f25e80f11f0, _set = false, _result = JVMTI_ERROR_NONE} (gdb) print oop_mask $5 = { <ResourceObj> = {<AllocatedObj> = {_vptr.AllocatedObj = 0x7f26d851ed30}, _allocation_t = {18446604270762043279, 0}}, _method = 0x7f2673abfa38, _bci = 145, _mask_size = 34, _expression_stack_size = 0, _bit_mask = {86021, 0, 0, 0}, _resource_allocate_bit_mask = true} local # 8 7 6 5 4 3 2 1 0 86021 = 01 01 01 00 00 00 00 01 01 Querying local #9 when stopped at bci 145. At that point, local #9 is uninitialized. Relevant -XX:+TraceOopMapGeneration -XX:+TraceNewOopMapGeneration output: 145 vars = 'rrvvvvrrr ' stack = '' monitors = '' aload 145 vars = 'rrvvvvrrrrrrrrrrr' stack = '' monitors = '' aload Excerpt from bytecode (relevant basic block): 130: aload_0 131: iload 5 133: aload_1 134: invokestatic #45 // Method java/util/Collections.nCopies:(ILjava/lang/Object;)Ljava/util/List; 137: invokestatic #46 // Method java/lang/invoke/MethodType.methodType:(Ljava/lang/Class;Ljava/util/List;)Ljava/lang/invoke/MethodType; 140: aload 8 142: invokestatic #42 // Method assertEquals:(Ljava/lang/Object;Ljava/lang/Object;)V 145: aload 7 147: aload 6 149: invokevirtual #15 // Method java/lang/invoke/MethodHandle.invokeWithArguments:([Ljava/lang/Object;)Ljava/lang/Object; 152: astore 9 154: aload 9 156: invokevirtual #47 // Method java/lang/Object.getClass:()Ljava/lang/Class; 159: aload_0 160: invokestatic #42 // Method assertEquals:(Ljava/lang/Object;Ljava/lang/Object;)V 163: aload 9 165: invokestatic #48 // Method toArrayString:(Ljava/lang/Object;)Ljava/lang/String; 168: astore 10 170: aload 6 172: invokestatic #49 // Method java/util/Arrays.toString:([Ljava/lang/Object;)Ljava/lang/String; 175: aload 10 177: invokestatic #42 // Method assertEquals:(Ljava/lang/Object;Ljava/lang/Object;)V 180: aload 7 182: aload_0 183: iload 5 185: invokevirtual #50 // Method java/lang/invoke/MethodHandle.asSpreader:(Ljava/lang/Class;I)Ljava/lang/invoke/MethodHandle; 188: astore 11 190: aload 11 192: invokevirtual #40 // Method java/lang/invoke/MethodHandle.type:()Ljava/lang/invoke/MethodType; 195: astore 12 197: getstatic #51 // Field $assertionsDisabled:Z 200: ifne 221
22-09-2014