diff --git a/frameworks/native/runtime/js_runtime.cpp b/frameworks/native/runtime/js_runtime.cpp index a681c532d5..d302bfb873 100644 --- a/frameworks/native/runtime/js_runtime.cpp +++ b/frameworks/native/runtime/js_runtime.cpp @@ -934,7 +934,13 @@ bool JsRuntime::BuildJsStackInfoList(uint32_t tid, std::vector& jsFram auto nativeEngine = GetNativeEnginePointer(); CHECK_POINTER_AND_RETURN(nativeEngine, false); std::vector jsFrameInfo; + auto arkNativeEngine = static_cast(nativeEngine->GetWorkerVm(nativeEngine, tid)); + if (arkNativeEngine == nullptr){ + return false; + } + arkNativeEngine->SuspendVM(); bool ret = nativeEngine->BuildJsStackInfoList(tid, jsFrameInfo); + arkNativeEngine->ResumeVM(); if (!ret) { return ret; }