KEMBAR78
Implement stack unwinding without frame pointers on macOS · Issue #1418 · async-profiler/async-profiler · GitHub
Skip to content

Implement stack unwinding without frame pointers on macOS #1418

@Baraa-Hasheesh

Description

@Baraa-Hasheesh

Describe the bug

When running the StackwalkerTests.normalStackVM on macOS ARM & X86 we can observe that sometimes the doCpuTask frame is skipped

For example the following samples on X86

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;Monitor::wait_without_safepoint_check;PlatformMonitor::wait;__psynch_cvwait 1
thread_start;_pthread_start;thread_native_entry;Thread::call_run;WatcherThread::run;StatSamplerTask::task 1
test/stackwalker/StackGenerator.main_[0];test/stackwalker/StackGenerator.leafFrame_[0];Java_test_stackwalker_StackGenerator_leafFrame;_simd_cbrt_d8 139
test/stackwalker/StackGenerator.main_[0];test/stackwalker/StackGenerator.leafFrame_[0];Java_test_stackwalker_StackGenerator_leafFrame;stub:pow 3
test/stackwalker/StackGenerator.main_[0];test/stackwalker/StackGenerator.leafFrame_[0];Java_test_stackwalker_StackGenerator_leafFrame;doCpuTask 8

The frame skipped when a sample is.collected inside _simd_cbrt_d8 or inside pow

This issue is most seen when using dynamic symbols & only is relevant for asynchronous events such cpu & wall

Expected vs. actual behavior

Stackwalker shouldn't skip frames on macOS

Reproduction Steps

make test TESTS=stackwalker

Additional Information/Context

No response

Async-profiler version

latest

Environment details

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions