[jdk20] RFR: 8298400: Virtual thread instability when stack overflows [v2]

Richard Reingruber rrich at openjdk.org
Thu Jan 19 15:22:27 UTC 2023


On Thu, 19 Jan 2023 09:18:17 GMT, Ron Pressler <rpressler at openjdk.org> wrote:

>> The stack overflow is detected in the native code and a pending exception is set, but it is not thrown.
>> 
>> Additionally, the stack overflow detection is changed use StackOverflow::shadow_zone_safe_limit rather than StackOverflow::stack_overflow_limit.
>
> Ron Pressler has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add corresponding change to riscv

I was still testing.

FTR


diff --git a/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp b/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp
index 2cd3323f181..27e2bae6ab7 100644
--- a/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp
+++ b/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp
@@ -1990,6 +1990,19 @@ static void gen_continuation_yield(MacroAssembler* masm,
 
   __ bind(L_pinned); // pinned -- return to caller
 
+  // handle pending exception thrown by freeze
+  Label ok;
+  __ ld(tmp, in_bytes(JavaThread::pending_exception_offset()), R16_thread);
+  __ cmpdi(CCR0, tmp, 0);
+  __ beq(CCR0, ok);
+  __ pop_frame();
+  __ ld(R0, _abi0(lr), R1_SP); // Return pc
+  __ mtlr(R0);
+  __ load_const_optimized(tmp, StubRoutines::forward_exception_entry(), R0);
+  __ mtctr(tmp);
+  __ bctr();
+  __ bind(ok);
+
   // Pop frame and return
   __ pop_frame();
   __ ld(R0, _abi0(lr), R1_SP); // Return pc

-------------

PR: https://git.openjdk.org/jdk20/pull/101


More information about the hotspot-compiler-dev mailing list