GeezerVison is showing github.com — Test failure on Mac OS x86 · Issue #1380 · async-profiler/async-profiler
Test failure on Mac OS x86 #1380DescriptionDescribe the bug
Multiple tests related to leaf stack walking are failing
Expected vs. actual behavior
FAIL [89/91] StackwalkerTests.normalStackVM (args: leafFrame) (agentArgs: start,event=cpu,cstack=vm,file=%f.jfr) took 9.470 s
java.lang.AssertionError
at test.stackwalker.StackwalkerTests.normalStackVM(StackwalkerTests.java:85)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at one.profiler.test.Runner.run(Runner.java:124)
at one.profiler.test.Runner.main(Runner.java:188)
The collected stack traces are:
thread_start;_pthread_start;thread_native_entry;Thread::call_run;JavaThread::thread_main_inner;MonitorDeflationThread::monitor_deflation_thread_entry;Monitor::wait_without_safepoint_check;PlatformMonitor::wait;__psynch_cvwait 1
thread_start;_pthread_start;thread_native_entry;Thread::call_run;JavaThread::thread_main_inner;CompileBroker::compiler_thread_loop;CompileBroker::invoke_compiler_on_method;Compiler::compile_method;Compilation::Compilation;Compilation::compile_method;Compilation::compile_java_method;Compilation::emit_code_body;LIR_Assembler::emit_code;LIR_Assembler::emit_lir_list;LIR_Assembler::emit_op2 1
thread_start;_pthread_start;ThreadJavaMain;JavaMain;JNI_CreateJavaVM;Threads::create_vm;JvmtiExport::post_vm_initialized;VM::VMInit;Profiler::run;Profiler::runInternal;Profiler::start;Profiler::startTimer;jvmti_RunAgentThread;JvmtiEnv::RunAgentThread;JvmtiAgentThread::JvmtiAgentThread;os::create_thread;_pthread_create 1
thread_start;_pthread_start;ThreadJavaMain;JavaMain;jni_DestroyJavaVM;attach_current_thread;os::create_attached_thread;PosixSignals::hotspot_sigmask;__pthread_sigmask 1
thread_start;_pthread_start;ThreadJavaMain;JavaMain;jni_DestroyJavaVM;Threads::destroy_vm;before_exit;WatcherThread::stop;Monitor::wait;PlatformMonitor::wait;__psynch_cvwait 1
break_interpreted 1
break_interpreted;Java_jdk_internal_loader_NativeLibraries_load;JVM_LoadLibrary;os::Bsd::dlopen_helper;Profiler::dlopen_hook;unknown;unknown;unknown;unknown;unknown;unknown;unknown;unknown;unknown;unknown;unknown;unknown;unknown;unknown 1
break_interpreted;Java_test_stackwalker_StackGenerator_leafFrame;_simd_expm1_f4 9
break_interpreted;Java_test_stackwalker_StackGenerator_leafFrame;_simd_cbrt_d8 556
break_interpreted;Java_test_stackwalker_StackGenerator_leafFrame;doCpuTask 33
FAIL [90/91] StackwalkerTests.normalStackVMX (args: leafFrame) (agentArgs: start,event=cpu,cstack=vmx,file=%f.jfr) took 10.107 s
java.lang.AssertionError
at test.stackwalker.StackwalkerTests.normalStackVMX(StackwalkerTests.java:61)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at one.profiler.test.Runner.run(Runner.java:124)
at one.profiler.test.Runner.main(Runner.java:188)
Fails, the stack traces are:
thread_start;_pthread_start;thread_native_entry;Thread::call_run;JavaThread::thread_main_inner;MonitorDeflationThread::monitor_deflation_thread_entry;Monitor::wait_without_safepoint_check;PlatformMonitor::wait;__psynch_cvwait 1
thread_start;_pthread_start;thread_native_entry;Thread::call_run;ConcurrentGCThread::run;G1ServiceThread::run_service;G1ServiceThread::wait_for_task;Monitor::wait_without_safepoint_check;PlatformMonitor::wait;__psynch_cvwait 1
thread_start;_pthread_start;ThreadJavaMain;JavaMain;JNI_CreateJavaVM;Threads::create_vm;JvmtiExport::post_vm_initialized;VM::VMInit;Profiler::run;Profiler::runInternal;Profiler::start;Profiler::startTimer;jvmti_RunAgentThread;JvmtiEnv::RunAgentThread;JvmtiAgentThread::JvmtiAgentThread;os::create_thread;_pthread_create;_kernelrpc_mach_vm_protect_trap 1
thread_start;_pthread_start;ThreadJavaMain;JavaMain;jni_DestroyJavaVM;Threads::destroy_vm;before_exit;WatcherThread::stop;Monitor::wait;PlatformMonitor::wait;__psynch_cvwait 1
break_interpreted;Java_java_io_UnixFileSystem_canonicalize0;JDK_Canonicalize 1
break_interpreted;Java_jdk_internal_loader_NativeLibraries_load;JVM_LoadLibrary;os::Bsd::dlopen_helper;Profiler::dlopen_hook;unknown;unknown;unknown;unknown;unknown;unknown;unknown;unknown;unknown;unknown;unknown;unknown;unknown;unknown;unknown 1
break_interpreted;Java_test_stackwalker_StackGenerator_leafFrame;_simd_cbrt_d8 571
break_interpreted;Java_test_stackwalker_StackGenerator_leafFrame;doCpuTask 32
break_interpreted;Java_test_stackwalker_StackGenerator_leafFrame;_simd_expm1_f4 6
break_interpreted;InterpreterRuntime::_new;ConstantPool::klass_at_impl;SystemDictionary::resolve_or_fail;SystemDictionary::resolve_instance_class_or_null;SystemDictionary::load_instance_class;SystemDictionary::load_instance_class_impl;ClassLoader::load_class;JIMAGE_FindResource 1
Reproduction Steps
make test
Additional Information/Context
This only occurs on Mac OS x86, but both with OpenJDK head, 25 and 17.
Async-profiler version
head
Environment details
Mac OS x86 Activityapangin commented on Jul 10, 2025 Thank you for the report. We'll take a look.
What JDK distribution is it? We tested macOS x86 with Corretto. parttimenerd commented on Jul 10, 2025 ContributorAuthor More actions apangin commented on Jul 10, 2025 You mean, you compiled OpenJDK locally? parttimenerd commented on Jul 10, 2025 ContributorAuthor More actions Baraa-Hasheesh commented on Jul 10, 2025 I'm checking this
But from a quick look at the shared logs it seems that the VM/VMX stackwalker failed to unwind the stack
break_interpreted; <---- Error frame, profiler had an error while unwinding the Java frames
Java_test_stackwalker_StackGenerator_leafFrame; <---- JNI native method frame
doCpuTask <---- JNI native method frame
Baraa-Hasheesh commented on Jul 10, 2025 @parttimenerd if possible can you share the following details
- macOS version
- What options were used when creating the JDK build
apangin commented on Jul 11, 2025 OK, I indeed see a crash in BytecodeRewriter::rewriteVerificationTypeInfo with JDK 17, but it's different from the issue you reported here.
I don't see StackwalkerTests failing locally or in CI. Apparently, this depends on the compiler version used. For instance, if your compiler omits frame pointers by default, async-profiler will not be able to unwind native frames of StackwalkerTests, since DWARF unwinding is not yet supported on macOS. We'll likely need to change Makefile to disallow omit-frame-pointer optimization for tests.
A crash is a separate issue, this may be a real profiler bug - will investigate deeper. parttimenerd commented on Jul 11, 2025 ContributorAuthor More actions Regarding the crash, we found this crash too in our testing.
Here is another segfault on this platform (although far more sporadic) with JDK 17:
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x0000000102c8bd7c, pid=87318, tid=9987
#
# JRE version: OpenJDK Runtime Environment SapMachine (17.0.14+7) (build 17.0.14+7-LTS)
# Java VM: OpenJDK 64-Bit Server VM SapMachine (17.0.14+7-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
# Problematic frame:
# C [libasyncProfiler.dylib+0x11d7c] BytecodeRewriter::rewriteVerificationTypeInfo()+0x1c
#
# Core dump will be written. Default location: core.87318
#
# If you would like to submit a bug report, please visit:
# https://github.com/SAP/SapMachine/issues/new
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
--------------- S U M M A R Y ------------
cloudmacphy104:async-profiler sapmachine$ head -n40 hs_err_pid75550.log
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x0000000109e7d1f7, pid=75550, tid=259
#
# JRE version: OpenJDK Runtime Environment (26.0) (build 26-internal-adhoc.sapmachine.jdk)
# Java VM: OpenJDK 64-Bit Server VM (26-internal-adhoc.sapmachine.jdk, mixed mode, sharing, tiered, compressed oops, compact obj headers, g1 gc, bsd-amd64)
# Problematic frame:
# C [libasyncProfiler.dylib+0x281f7] StackWalker::walkVM(void*, ASGCT_CallFrame*, int, StackDetail, void const*, unsigned long, unsigned long)+0xe47
#
# Core dump will be written. Default location: core.75550
#
# 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 ------------
Command Line:
Host: "Macmini8,1" x86_64 3200 MHz, 12 cores, 64G, Darwin 23.5.0, macOS 14.5 (23F79)
Time: Thu Jul 10 13:40:08 2025 CEST elapsed time: 0.461950 seconds (0d 0h 0m 0s)
--------------- T H R E A D ---------------
Current thread (0x00007fa47c808a00): JavaThread "main" [_thread_in_Java, id=259, stack(0x00007ff7b214a000,0x00007ff7b6149000) (65532K)]
Stack: [0x00007ff7b214a000,0x00007ff7b6149000], sp=0x00007ff7b6147900, free space=65526k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libasyncProfiler.dylib+0x281f7] StackWalker::walkVM(void*, ASGCT_CallFrame*, int, StackDetail, void const*, unsigned long, unsigned long)+0xe47
C [libasyncProfiler.dylib+0x159f] Profiler::recordSample(void*, unsigned long long, EventType, Event*)+0x30f
C [libasyncProfiler.dylib+0x2d8e6] WallClock::signalHandler(int, __siginfo*, void*)+0x376
C [libsystem_platform.dylib+0x3fdd] _sigtramp+0x1d
J 13 c1 java.lang.Math.random()D java.base@26-internal (7 bytes) @ 0x0000000115e9e308 [0x0000000115e9e420+0xfffffffffffffee8] Baraa-Hasheesh commented on Jul 11, 2025 Adding here,
I've tried running with JDK Corretto-17.0.15.6.1 on X86 macOS 15 & didn't see the crash
On GHA we're using macOS 13 for X86 Baraa-Hasheesh commented on Jul 14, 2025 @parttimenerd
Regarding the other crash you've mentioned, do you have a reproducer you're able to share?
Regarding the original issue of failing tests, is it possible to share the following:
- The compiler version you're using
- What options were used when creating the local build for OpenJDK
parttimenerd commented on Jul 14, 2025 ContributorAuthor More actions Regarding build options:
./configure --with-boot-jdk=/priv/jenkins/client-home/workspace/openjdk-24u-macos_x86_64-opt/boot_jdk --with-xcode-path=/System/Volumes/Data/priv/jenkins/client-home/workspace/devkit-xcode-15.4 --with-version-date=2025-07-09 --with-gtest=/priv/jenkins/client-home/workspace/openjdk-24u-macos_x86_64-opt/gtest --disable-dtrace --with-freetype=bundled
make images
Regarding compiler:
clang -v
Apple clang version 16.0.0 (clang-1600.0.26.4)
Target: x86_64-apple-darwin23.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin parttimenerd commented on Jul 14, 2025 ContributorAuthor More actions Regarding the segfaults, the following is a reliable reproducer:
java -Djava.library.path=build/test/lib -agentpath:build/lib/libasyncProfiler.dylib=start,all,event=java.util.Properties.getProperty,alloc=100,file=/var/folders/23/c_vxd_bx5x1csnfpsvlpp120001hw2/T/ap-f8330467123917665696.jfr test.jfr.JfrMultiModeProfiling apangin commented on Jul 14, 2025 OK, we with @Baraa-Hasheesh found a reason for the crash in BytecodeRewriter::rewriteVerificationTypeInfo(). Apparently, it was a C++ compiler bug. clang incorrectly compiled the following code
for (int j = 0; j < frame_type - 251; j++) {
rewriteVerificationTypeInfo();
}
into an infinite loop:
15830: 48 89 df movq %rbx, %rdi
15833: e8 08 00 00 00 callq __ZN16BytecodeRewriter27rewriteVerificationTypeInfoEv ## BytecodeRewriter::rewriteVerificationTypeInfo()
15838: eb f6 jmp 0x15830
This one has been fixed. We'll look into other failures. Baraa-Hasheesh commented on Jul 14, 2025 I managed to reproduce the failure locally on macOS using JDK 26
bhashesh@bcd074a57ab8 async-profiler % java -version
openjdk version "26-ea" 2026-03-17
OpenJDK Runtime Environment (build 26-ea+5-453)
OpenJDK 64-Bit Server VM (build 26-ea+5-453, mixed mode, sharing)
Baraa-Hasheesh commented on Jul 14, 2025 @parttimenerd
I did some testing across multiple JVM versions & I was only able to reproduce the issue on really recent JDK builds
For example I'm not able to reproduce on 26-ea+4-333
openjdk version "26-ea" 2026-03-17
OpenJDK Runtime Environment (build 26-ea+4-333)
OpenJDK 64-Bit Server VM (build 26-ea+4-333, mixed mode, sharing)
While it's seen on 26-ea+5-453
openjdk version "26-ea" 2026-03-17
OpenJDK Runtime Environment (build 26-ea+5-453)
OpenJDK 64-Bit Server VM (build 26-ea+5-453, mixed mode, sharing)
Can you please confirm if the issue happens for only tip or if it also happens frequently on older JDKs such as 17/25 parttimenerd commented on Jul 15, 2025 ContributorAuthor More actions @apangin I can confirm that your recent commit fixed the crashes. parttimenerd commented on Jul 15, 2025 ContributorAuthor More actions @Baraa-Hasheesh, I can confirm your observations. Thanks for your investigation. Baraa-Hasheesh commented on Jul 16, 2025 I've opened #1395 as follow up for VM/VMX issues on OpenJDK tip
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|