async-profiler: Crash in WallClock::getThreadState
Async profiler caused a crash of JVM
Async profieler is provided via ap-loader: me.bechberger:ap-loader:2.9-2-all
Java: 21.0.1+12
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f3af0fe14b4, pid=26416, tid=26737
#
# JRE version: OpenJDK Runtime Environment Temurin-21.0.1+12 (21.0.1+12) (build 21.0.1+12-LTS)
# Java VM: OpenJDK 64-Bit Server VM Temurin-21.0.1+12 (21.0.1+12-LTS, mixed mode, sharing, tiered, compressed class ptrs, z gc, linux-amd64)
# Problematic frame:
# C [libasyncProfiler.so+0xd4b4] WallClock::getThreadState(void*)+0x14
#
# Core dump will be written. Default location: /data/coredumps/core.pid%P.uid%u.sig%s.%e.%t.26416
#
# An error report file with more information is saved as:
# /tmp/hs_err_pid26416.log
[106500.162s][warning][os] Loading hsdis library failed
Thread stack:
--------------- T H R E A D ---------------
Current thread (0x00007f3b1bc4d1a0): JavaThread "foreground" [_thread_in_native, id=26737, stack(0x00007f388e0f8000,0x00007f388e1f9000) (1028K)]
Stack: [0x00007f388e0f8000,0x00007f388e1f9000], sp=0x00007f388e1f67b0, free space=1017k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libasyncProfiler.so+0xd4b4] WallClock::getThreadState(void*)+0x14
C [libasyncProfiler.so+0x35889] WallClock::signalHandler(int, siginfo*, void*)+0x29
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 16870 ...NativeUtils.recvfrom(IJII)J (0 bytes) @ 0x00007f3b0874d902 [0x00007f3b0874d8a0+0x0000000000000062]
...
I can provide additional debug information from hs_err_pid file if needed
About this issue
- Original URL
- State: closed
- Created 7 months ago
- Comments: 15
If you want to profile cpu+wall together, you’ll need two different signals. Something like
--signal 27/37
should work (which means use signal 27=SIGPROF for cpu profiling and signal 37 for wall clock).As a side note, there are multiple issues with your asprof command:
-d
is specified twice;-a
and-t
are relevant for text formats, but do nothing with jfr;-F vtable
is not yet supported with--cstack vm
(will fix this later);-e cpu,alloc --wall
works but it’s a mix of two styles and is discouraged. Preferred syntax for multi-event profiling is-e cpu -i 300us --alloc 512m --wall 1ms
--wall 300us
the interval for wall-clock profiling is too low - it may result in high overhead. Values below 1ms are not recommended, unless you limit the number of wall-profiled threads with--filter
option.