JDK-8235349 : applications/jcstress/seqcst.java crashes due to SIGSEGV
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 14
  • Priority: P3
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: linux
  • CPU: x86_64
  • Submitted: 2019-12-04
  • Updated: 2022-05-10
  • Resolved: 2020-02-07
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 15
15Resolved
Related Reports
Relates :  
Relates :  
Description
The following test failed in the JDK14 CI:

applications/jcstress/seqcst.java

Here's the crashing thread's stack:

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

Current thread (0x00007f8818033000):  JavaThread "main" [_thread_in_vm, id=17551, stack(0x00007f881ef1a000,0x00007f881f01b000)]

Stack: [0x00007f881ef1a000,0x00007f881f01b000],  sp=0x00007f881f018990,  free space=1018k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [ld-linux-x86-64.so.2+0x12c0e]
V  [libjvm.so+0x167fea3]  Thread::is_in_stack(unsigned char*) const+0x23
V  [libjvm.so+0x31060a]  constantPoolHandle::constantPoolHandle(Thread*, ConstantPool*)+0x9a
V  [libjvm.so+0xd7dd5d]  InterpreterRuntime::anewarray(JavaThread*, ConstantPool*, int, int)+0x8d
j  sun.nio.cs.StandardCharsets$Aliases.init([Ljava/lang/Object;)V+36 java.base
j  sun.util.PreHashedMap.<init>(IIII)V+38 java.base
j  sun.nio.cs.StandardCharsets$Aliases.<init>()V+11 java.base
j  sun.nio.cs.StandardCharsets.aliasMap()Ljava/util/Map;+14 java.base
j  sun.nio.cs.StandardCharsets.canonicalize(Ljava/lang/String;)Ljava/lang/String;+1 java.base
j  sun.nio.cs.StandardCharsets.lookup(Ljava/lang/String;)Ljava/nio/charset/Charset;+47 java.base
j  sun.nio.cs.StandardCharsets.charsetForName(Ljava/lang/String;)Ljava/nio/charset/Charset;+6 java.base
j  java.nio.charset.Charset.lookup2(Ljava/lang/String;)Ljava/nio/charset/Charset;+39 java.base
j  java.nio.charset.Charset.lookup(Ljava/lang/String;)Ljava/nio/charset/Charset;+40 java.base
j  java.nio.charset.Charset.isSupported(Ljava/lang/String;)Z+1 java.base
v  ~StubRoutines::call_stub
V  [libjvm.so+0xd8b6ec]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x6ac
V  [libjvm.so+0xe6d2fa]  jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*) [clone .isra.164] [clone .constprop.252]+0x12a
V  [libjvm.so+0xe89d90]  jni_CallStaticBooleanMethodV+0x300
C  [libjava.so+0x16e1a]  JNU_CallStaticMethodByName+0x19a
C  [libjava.so+0x16faf]  jnuEncodingSupported.part.0+0x2f
C  [libjava.so+0x17763]  newSizedStringJava+0x83
C  [libjava.so+0x11fef]  Java_jdk_internal_util_SystemProps_00024Raw_platformProperties+0x5ef
j  jdk.internal.util.SystemProps$Raw.platformProperties()[Ljava/lang/String;+0 java.base
j  jdk.internal.util.SystemProps$Raw.<init>()V+5 java.base
j  jdk.internal.util.SystemProps.initProperties()Ljava/util/Map;+4 java.base
j  java.lang.System.initPhase1()V+0 java.base
v  ~StubRoutines::call_stub
V  [libjvm.so+0xd8b6ec]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x6ac
V  [libjvm.so+0xd89b0c]  JavaCalls::call_static(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, Thread*)+0x19c
V  [libjvm.so+0xd89c1e]  JavaCalls::call_static(JavaValue*, Klass*, Symbol*, Symbol*, Thread*)+0x7e
V  [libjvm.so+0x168c3b0]  Threads::initialize_java_lang_classes(JavaThread*, Thread*)+0x1130
V  [libjvm.so+0x168d156]  Threads::create_vm(JavaVMInitArgs*, bool*)+0x496
V  [libjvm.so+0xea5218]  JNI_CreateJavaVM+0x98
C  [libjli.so+0x406f]  JavaMain+0x7f
C  [libjli.so+0x8079]  ThreadJavaMain+0x9

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  sun.nio.cs.StandardCharsets$Aliases.init([Ljava/lang/Object;)V+36 java.base
j  sun.util.PreHashedMap.<init>(IIII)V+38 java.base
j  sun.nio.cs.StandardCharsets$Aliases.<init>()V+11 java.base
j  sun.nio.cs.StandardCharsets.aliasMap()Ljava/util/Map;+14 java.base
j  sun.nio.cs.StandardCharsets.canonicalize(Ljava/lang/String;)Ljava/lang/String;+1 java.base
j  sun.nio.cs.StandardCharsets.lookup(Ljava/lang/String;)Ljava/nio/charset/Charset;+47 java.base
j  sun.nio.cs.StandardCharsets.charsetForName(Ljava/lang/String;)Ljava/nio/charset/Charset;+6 java.base
j  java.nio.charset.Charset.lookup2(Ljava/lang/String;)Ljava/nio/charset/Charset;+39 java.base
j  java.nio.charset.Charset.lookup(Ljava/lang/String;)Ljava/nio/charset/Charset;+40 java.base
j  java.nio.charset.Charset.isSupported(Ljava/lang/String;)Z+1 java.base
v  ~StubRoutines::call_stub
j  jdk.internal.util.SystemProps$Raw.platformProperties()[Ljava/lang/String;+0 java.base
j  jdk.internal.util.SystemProps$Raw.<init>()V+5 java.base
j  jdk.internal.util.SystemProps.initProperties()Ljava/util/Map;+4 java.base
j  java.lang.System.initPhase1()V+0 java.base
v  ~StubRoutines::call_stub

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

Starting this bug in hotspot/runtime for initial triage since we
crashed in a call to Thread::is_in_stack().
Comments
My google searching for this failure didn't yield anything. I linked it to a similar bug but for now CNR. It only happened once.
07-02-2020

Thanks to [~poonam] for looking at this with me. The stack above is gdb trying to match addresses so prints garbage after the crashing frame. In frame 17, _tls_get_addr is crashing (=> points at next address): 0x7f5ce0417be3 <Thread::is_in_stack(unsigned char*) const+19>: data32 lea 0x69514d(%rip),%rdi # 0x7f5ce0aacd38 0x7f5ce0417beb <Thread::is_in_stack(unsigned char*) const+27>: data32 data32 callq 0x7f5cdf10a690 <__tls_get_addr@plt> => 0x7f5ce0417bf3 <Thread::is_in_stack(unsigned char*) const+35>: mov (%rax),%r12 0x7f5ce0417bf6 <Thread::is_in_stack(unsigned char*) const+38>: test %r12,%r12 0x7f5ce0417bf9 <Thread::is_in_stack(unsigned char*) const+41>: je 0x7f5ce0417c68 <Thread::is_in_stack(unsigned char*) const+152> 0x7f5ce0417bfb <Thread::is_in_stack(unsigned char*) const+43>: cmp %r12,%rbx 0x7f5ce0417bfe <Thread::is_in_stack(unsigned char*) const+46>: je 0x7f5ce0417c33 <Thread::is_in_stack(unsigned char*) const+99> OS:Oracle Linux Server release 7.7 uname:Linux 4.14.35-1902.7.3.el7uek.x86_64 #2 SMP Thu Oct 31 10:06:41 PDT 2019 x86_64 OS uptime: 1 days 7:38 hours libc:glibc 2.17 NPTL 2.17 rlimit: STACK 8192k, CORE infinity, NPROC 240168, NOFILE 16384, AS infinity, DATA infinity, FSIZE infinity load average:4.44 4.26 4.20
17-01-2020

I looked at this crash and decided that it was impossible and that we'd never see it again. :(
08-01-2020

ILW = HLM = P3
10-12-2019