JDK-8215708 : ZGC: Add missing LoadBarrierNode::size_of()
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,12,13
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2018-12-20
  • Updated: 2023-07-21
  • Resolved: 2019-01-09
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 11 JDK 12 JDK 13
11.0.6-oracleFixed 12 b27Fixed 13Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Description
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f01b4d53636, pid=23932, tid=23965
#
# JRE version: Java(TM) SE Runtime Environment (12.0) (build 12-internal+0-jdk12-jdk.1150)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (12-internal+0-jdk12-jdk.1150, mixed mode, tiered, z gc, linux-amd64)
# Problematic frame:
# J 52300 c2 java.lang.ClassLoader.getNamedPackage(Ljava/lang/String;Ljava/lang/Module;)Ljava/lang/NamedPackage; java.base@12-internal (73 bytes) @ 0x00007f01b4d53636 [0x00007f01b4d53120+0x0000000000000516]
#

---------------  S U M M A R Y ------------

Command Line: -XX:MaxRAMPercentage=8 -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:+CreateCoredumpOnCrash -XX:-UseCompressedOops --add-opens=java.base/java.net=ALL-UNNAMED -Dseed=4499338585598492 -XX:MaxRAMPercentage=50 applications.runthese.Runner -duration 30 -runlist RunTheseTestList.dat

Host: Intel(R) Xeon(R) CPU E5-2690 0 @ 2.90GHz, 6 cores, 29G, Oracle Linux Server release 7.1
Time: Wed Dec 19 05:34:02 2018 PST elapsed time: 131 seconds (0d 0h 2m 11s)

---------------  T H R E A D  ---------------

Current thread (0x00007f01c439f990):  JavaThread "RunThese-TestRunner-Thread-2" daemon [_thread_in_Java, id=23965, stack(0x00007eff76fcb000,0x00007eff770cc000)]

Stack: [0x00007eff76fcb000,0x00007eff770cc000],  sp=0x00007eff770c98f0,  free space=1018k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
J 52300 c2 java.lang.ClassLoader.getNamedPackage(Ljava/lang/String;Ljava/lang/Module;)Ljava/lang/NamedPackage; java.base@12-internal (73 bytes) @ 0x00007f01b4d53636 [0x00007f01b4d53120+0x0000000000000516]
J 58644 c2 java.net.URLClassLoader.defineClass(Ljava/lang/String;Ljdk/internal/loader/Resource;)Ljava/lang/Class; java.base@12-internal (224 bytes) @ 0x00007f01b52b6b38 [0x00007f01b52b5a20+0x0000000000001118]
J 40735 c1 java.net.URLClassLoader$1.run()Ljava/lang/Class; java.base@12-internal (63 bytes) @ 0x00007f01af21fec4 [0x00007f01af21fda0+0x0000000000000124]
J 58975 c1 java.net.URLClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class; java.base@12-internal (47 bytes) @ 0x00007f01af0a24cc [0x00007f01af0a2240+0x000000000000028c]
J 40667 c1 java.lang.ClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class; java.base@12-internal (122 bytes) @ 0x00007f01af204454 [0x00007f01af2041a0+0x00000000000002b4]
J 6275 c1 java.lang.ClassLoader.loadClass(Ljava/lang/String;)Ljava/lang/Class; java.base@12-internal (7 bytes) @ 0x00007f01b4732a1c [0x00007f01b47329c0+0x000000000000005c]
v  ~StubRoutines::call_stub
V  [libjvm.so+0x867189]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x3c9
V  [libjvm.so+0x8654ed]  JavaCalls::call_virtual(JavaValue*, Handle, Klass*, Symbol*, Symbol*, Handle, Thread*)+0x1dd
V  [libjvm.so+0xd76736]  SystemDictionary::load_instance_class(Symbol*, Handle, Thread*)+0x246
V  [libjvm.so+0xd756a6]  SystemDictionary::resolve_instance_class_or_null(Symbol*, Handle, Handle, Thread*)+0x906
V  [libjvm.so+0xd78104]  SystemDictionary::resolve_or_fail(Symbol*, Handle, Handle, bool, Thread*)+0x54
V  [libjvm.so+0x91b610]  find_class_from_class_loader(JNIEnv_*, Symbol*, unsigned char, Handle, Handle, unsigned char, Thread*)+0x30
V  [libjvm.so+0x91cecf]  JVM_FindClassFromCaller+0x15f
C  [libjava.so+0xe2d8]  Java_java_lang_Class_forName0+0x158
J 1325  java.lang.Class.forName0(Ljava/lang/String;ZLjava/lang/ClassLoader;Ljava/lang/Class;)Ljava/lang/Class; java.base@12-internal (0 bytes) @ 0x00007f01b46d076b [0x00007f01b46d0660+0x000000000000010b]
J 8281 c2 java.lang.Class.forName(Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class; java.base@12-internal (47 bytes) @ 0x00007f01b49e8bbc [0x00007f01b49e8b40+0x000000000000007c]
J 5623 c1 applications.runthese.Runner$TestRunner.runTest(Ljava/lang/String;J)V (471 bytes) @ 0x00007f01ad223974 [0x00007f01ad222e60+0x0000000000000b14]
j  applications.runthese.Runner$TestRunner.run()V+104
j  java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V+92 java.base@12-internal
j  java.util.concurrent.ThreadPoolExecutor$Worker.run()V+5 java.base@12-internal
j  java.lang.Thread.run()V+11 java.base@12-internal
v  ~StubRoutines::call_stub
V  [libjvm.so+0x867189]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x3c9
V  [libjvm.so+0x8652bd]  JavaCalls::call_virtual(JavaValue*, Handle, Klass*, Symbol*, Symbol*, Thread*)+0x1cd
V  [libjvm.so+0x911d0c]  thread_entry(JavaThread*, Thread*)+0x6c
V  [libjvm.so+0xdc727f]  JavaThread::thread_main_inner()+0x22f
V  [libjvm.so+0xdc40bf]  Thread::call_run()+0x16f
V  [libjvm.so+0xbf32be]  thread_native_entry(Thread*)+0xee


siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000010

Register to memory mapping:

RAX=0x00000803a3687168 is an oop: java.util.concurrent.ConcurrentHashMap 
{0x00000803a3687168} - klass: 'java/util/concurrent/ConcurrentHashMap'
RBX=0x0 is NULL
RCX=0x00000000f8559210 is an unknown value
RDX=0x00000801e9be8f70 is an oop: java.lang.String 
{0x00000801e9be8f70} - klass: 'java/lang/String'
RSP=0x00007eff770c98f0 is pointing into the stack for thread: 0x00007f01c439f990
RBP=0x00000803a368fc80 is an oop: java.lang.String 
{0x00000803a368fc80} - klass: 'java/lang/String'
RSI=0x00000803a368fca0 is an oop: [B 
{0x00000803a368fca0} - klass: {type array byte}
 - length: 30
RDI=0x0 is NULL
R8 =0x00000803a368fda0 is an oop: java.util.concurrent.ConcurrentHashMap$Node 
{0x00000803a368fda0} - klass: 'java/util/concurrent/ConcurrentHashMap$Node'
R9 =0x000008000b200878 is an oop: java.lang.NullPointerException 
{0x000008000b200878} - klass: 'java/lang/NullPointerException'
R10=0x000000000000001e is an unknown value
R11=0x0000000078556a45 is an unknown value
R12=0x00007eff770c9e70 is pointing into the stack for thread: 0x00007f01c439f990
R13=0x00007f01ac386b70 is a pointer to class: 
java.lang.String {0x00007f01ac386b70}
R14=0x00000801e9be8f70 is an oop: java.lang.String 
{0x00000801e9be8f70} - klass: 'java/lang/String'
R15=0x00007f01c439f990 is a thread


Registers:
RAX=0x00000803a3687168, RBX=0x0000000000000000, RCX=0x00000000f8559210, RDX=0x00000801e9be8f70
RSP=0x00007eff770c98f0, RBP=0x00000803a368fc80, RSI=0x00000803a368fca0, RDI=0x0000000000000000
R8 =0x00000803a368fda0, R9 =0x000008000b200878, R10=0x000000000000001e, R11=0x0000000078556a45
R12=0x00007eff770c9e70, R13=0x00007f01ac386b70, R14=0x00000801e9be8f70, R15=0x00007f01c439f990
RIP=0x00007f01b4d53636, EFLAGS=0x0000000000010246, CSGSFS=0x0000000000000033, ERR=0x0000000000000004
  TRAPNO=0x000000000000000e

Top of Stack: (sp=0x00007eff770c98f0)
0x00007eff770c98f0:   00000803a3686f58 00007f01b46a377d
0x00007eff770c9900:   00000803a36871d0 00000803a3694578
0x00007eff770c9910:   0101010101010101 0000000000000038
0x00007eff770c9920:   00007f01c439f990 00000801e9be9010 

Instructions: (pc=0x00007f01b4d53636)
0x00007f01b4d53616:   85 fe 04 00 00 49 8b 7e 10 49 85 7f 20 0f 85 fe
0x00007f01b4d53626:   04 00 00 45 85 d2 0f 85 64 01 00 00 44 8b 56 10
0x00007f01b4d53636:   8b 4f 10 41 3b ca 0f 85 f3 04 00 00 48 83 c7 18
0x00007f01b4d53646:   48 83 c6 18 85 c9 0f 84 a3 00 00 00 8b c1 83 e0 

Stack slot to memory mapping:
stack at sp + 0 slots: 0x00000803a3686f58 is an oop: applications.runthese.Runner$DirectoryClassLoader 
{0x00000803a3686f58} - klass: 'applications/runthese/Runner$DirectoryClassLoader'
stack at sp + 1 slots: 0x00007f01b46a377d is at entry_point+189 in (nmethod*)0x00007f01b46a3510
stack at sp + 2 slots: 0x00000803a36871d0 is an oop: java.lang.Module 
{0x00000803a36871d0} - klass: 'java/lang/Module'
stack at sp + 3 slots: 0x00000803a3694578 is an oop: java.lang.Class 
{0x00000803a3694578} - klass: 'java/lang/Class'
stack at sp + 4 slots: 0x0101010101010101 is an unknown value
stack at sp + 5 slots: 0x0000000000000038 is an unknown value
stack at sp + 6 slots: 0x00007f01c439f990 is a thread
stack at sp + 7 slots: 0x00000801e9be9010 is an oop: java.lang.String 
{0x00000801e9be9010} - klass: 'java/lang/String'
Comments
Fix Request (11u) This fixes ZGC bug and keeps codebases in sync (I see 11.0.6-oracle). Patch applies cleanly to 11u, passes tier1, hotspot_gc (with ZGC).
03-09-2019

URL: http://hg.openjdk.java.net/jdk/jdk12/rev/df6cbf676c70 User: pliden Date: 2019-01-09 12:54:50 +0000
09-01-2019

Looks like the problem is that LoadBarrierNode doesn't implement size_of(), which causes Node::clone() to allocate a too small object. This in turn means that the additional fields in LoadBarrierNode becomes garbage. This can explain why the _weak field is sometimes broken causing random/spurious use of weak barrier instead of a strong barrier. This in turn explains why the barrier returns NULL when trying to load finalizable marked oops. Currently running tests on a fix for this.
08-01-2019

Can the other JDK-8215732 be a duplicate of this JDK-8215708 issue?
26-12-2018

Weak barrier confirmed on rdi
20-12-2018

This might be a duplicate of JDK-8212109, with a String intrinsic gone wrong (applying a weak slow path barrier). It is possible that the AD file changes done in JDK-8215547 solves this, but we're not completely sure yet.
20-12-2018

Disassembly: 0: 49 8b 7e 10 mov rdi,QWORD PTR [r14+0x10] 4: 49 85 7f 20 test QWORD PTR [r15+0x20],rdi 8: 0f 85 fe 04 00 00 jne 0x50c e: 45 85 d2 test r10d,r10d 11: 0f 85 64 01 00 00 jne 0x17b 17: 44 8b 56 10 mov r10d,DWORD PTR [rsi+0x10] 1b: 8b 4f 10 mov ecx,DWORD PTR [rdi+0x10] 1e: 41 3b ca cmp ecx,r10d 21: 0f 85 f3 04 00 00 jne 0x51a 27: 48 83 c7 18 add rdi,0x18 2b: 48 83 c6 18 add rsi,0x18 2f: 85 c9 test ecx,ecx 31: 0f 84 a3 00 00 00 je 0xda 37: 8b c1 mov eax,ecx
20-12-2018