diff --git a/src/hotspot/os_cpu/aix_ppc/javaThread_aix_ppc.cpp b/src/hotspot/os_cpu/aix_ppc/javaThread_aix_ppc.cpp index 50b453358c9..c33f0ae29d8 100644 --- a/src/hotspot/os_cpu/aix_ppc/javaThread_aix_ppc.cpp +++ b/src/hotspot/os_cpu/aix_ppc/javaThread_aix_ppc.cpp @@ -43,7 +43,9 @@ bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, // If we have a last_Java_frame, then we should use it even if // isInJava == true. It should be more reliable than ucontext info. if (has_last_Java_frame() && frame_anchor()->walkable()) { - *fr_addr = pd_last_frame(); + frame last_frame = pd_last_frame(); + if (last_frame.pc() == nullptr) return false; + *fr_addr = last_frame; return true; } diff --git a/src/hotspot/os_cpu/linux_ppc/javaThread_linux_ppc.cpp b/src/hotspot/os_cpu/linux_ppc/javaThread_linux_ppc.cpp index e674a4c2ae0..70590089f6d 100644 --- a/src/hotspot/os_cpu/linux_ppc/javaThread_linux_ppc.cpp +++ b/src/hotspot/os_cpu/linux_ppc/javaThread_linux_ppc.cpp @@ -42,7 +42,9 @@ bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, // If we have a last_Java_frame, then we should use it even if // isInJava == true. It should be more reliable than ucontext info. if (has_last_Java_frame() && frame_anchor()->walkable()) { - *fr_addr = pd_last_frame(); + frame last_frame = pd_last_frame(); + if (last_frame.pc() == nullptr) return false; + *fr_addr = last_frame; return true; }