JDK-8258031 : [Linux] pthread_getcpuclockid from JfrThreadCPULoadEvent::send_events()
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jfr
  • Affected Version: 11,16
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux_suse_sles_11,linux_ubuntu
  • CPU: generic
  • Submitted: 2020-12-10
  • Updated: 2020-12-15
  • Resolved: 2020-12-15
Related Reports
Blocks :  
Duplicate :  
Description
Crash while recording JFR from JMC 8.0.0 with latest JDK 11 (11.0.9 b07) or with JDK 16 (16ea b27). 

Steps to Reproduce :
1. Use JMC 8.0.0 latest build and extract the same.
2. Launch JMC with additional arguments "~/pathtojmc/jmc -vm $JDK16_HOME/bin -consoleLog -debug"
3. Open a running JVM instance in the "JVM browser" and Using Mouse Right click select "Start JMX Console"
4. "JVM browser" , Right click and select "Start Flight Recording" , (Optional) reduce the "Recording time" to "10 s" instead of 1 m (default), and click on "Next" and "Finish", Wait for recording to complete.
5. Repeat the step 4 many times to re-produce the crash.

Note: Crash only on Ubuntu 18.04 / 20.04, OEL 7.6 and SUSE linux , Not in Windows or Mac OS

Some Part of the call stack is mentioned below and complete call stack is attached. 
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f11e0c47905, pid=28124, tid=28145
#
# JRE version: Java(TM) SE Runtime Environment (16.0+27) (build 16-ea+27-1884)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (16-ea+27-1884, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  [libpthread.so.0+0xf905]  pthread_getcpuclockid+0x5
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P %E" (or dumping to /home/guruhb/ade/temp/8b05/core.28124)
#
# JFR recording file will be written. Location: /home/guruhb/ade/temp/8b05/hs_err_pid28124.jfr
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

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

...

Host: Intel(R) Core(TM) i7-5960X CPU @ 3.00GHz, 16 cores, 23G, Ubuntu 18.04.4 LTS
Time: Thu Dec 10 16:21:43 2020 IST elapsed time: 100.300003 seconds (0d 0h 1m 40s)

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

Current thread (0x00007f11d82e0740):  JavaThread "JFR Periodic Tasks" daemon [_thread_in_vm, id=28145, stack(0x00007f116746b000,0x00007f116756c000)] _threads_hazard_ptr=0x00007f0fb4024430

Stack: [0x00007f116746b000,0x00007f116756c000],  sp=0x00007f116756a638,  free space=1021k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libpthread.so.0+0xf905]  pthread_getcpuclockid+0x5
V  [libjvm.so+0x852c30]  JfrThreadCPULoadEvent::send_events()+0xd0
V  [libjvm.so+0x825415]  jfr_emit_event+0x3a5
J 7456  jdk.jfr.internal.JVM.emitEvent(JJJ)Z jdk.jfr@16-ea (0 bytes) @ 0x00007f11c95a7f61 [0x00007f11c95a7ea0+0x00000000000000c1]
J 11419 c2 jdk.jfr.internal.RequestEngine.run_requests(Ljava/util/Collection;)J jdk.jfr@16-ea (277 bytes) @ 0x00007f11c9a17a30 [0x00007f11c9a177a0+0x0000000000000290]
J 7539 c1 jdk.jfr.internal.RequestEngine.doPeriodic()J jdk.jfr@16-ea (7 bytes) @ 0x00007f11c22d159c [0x00007f11c22d1540+0x000000000000005c]
j  jdk.jfr.internal.PlatformRecorder.periodicTask()V+37 jdk.jfr@16-ea
j  jdk.jfr.internal.PlatformRecorder.lambda$startDiskMonitor$1()V+1 jdk.jfr@16-ea
j  jdk.jfr.internal.PlatformRecorder$$Lambda$48+0x0000000800c42fd8.run()V+4 jdk.jfr@16-ea
j  java.lang.Thread.run()V+11 java.base@16-ea
v  ~StubRoutines::call_stub
V  [libjvm.so+0x7f0f05]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x2d5
V  [libjvm.so+0x7f278b]  JavaCalls::call_virtual(JavaValue*, Handle, Klass*, Symbol*, Symbol*, Thread*)+0x1cb
V  [libjvm.so+0x8ab9b0]  thread_entry(JavaThread*, Thread*)+0x70
V  [libjvm.so+0xd7332b]  JavaThread::thread_main_inner()+0x11b
V  [libjvm.so+0xd7801d]  Thread::call_run()+0xfd
V  [libjvm.so+0xbd0347]  thread_native_entry(Thread*)+0xe7
Comments
RT Triage: based on David's comment closing this as a duplicate of JDK-8258027
15-12-2020

I don't think we need two bug reports for what is essentially the same crash. A bogus pthread id is being passed to pthread_getcpuclockid.
10-12-2020