From 00e15e41d27b77b989803f0b0cdce477b439db24 Mon Sep 17 00:00:00 2001 From: Richard Startin Date: Mon, 27 Nov 2023 09:48:00 +0000 Subject: [PATCH] check thread is in runnable state before checking if VM is blocked --- ddprof-lib/src/main/cpp/profiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddprof-lib/src/main/cpp/profiler.cpp b/ddprof-lib/src/main/cpp/profiler.cpp index b175f8052..cdd435eb0 100644 --- a/ddprof-lib/src/main/cpp/profiler.cpp +++ b/ddprof-lib/src/main/cpp/profiler.cpp @@ -404,7 +404,7 @@ int Profiler::getJavaTraceAsync(void* ucontext, ASGCT_CallFrame* frames, int max }; */ // avoid unwinding during deoptimization - if (_state == 10 || _state == 11) { + if (vm_thread->osThreadState() == ThreadState::RUNNABLE && (_state == 10 || _state == 11)) { return 0; } bool in_java = (state == 8 || state == 9);