[jdk20] RFR: 8298400: Virtual thread instability when stack overflows
Fei Yang
fyang at openjdk.org
Thu Jan 19 03:28:31 UTC 2023
On Thu, 12 Jan 2023 12:12:42 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.
Also prepared a small change for RISC-V which has passed sanity test.
Could you please incorporate it while you are on it? Thanks.
diff --git a/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp b/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp
index d2992b9012b..56899a3a234 100644
--- a/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp
+++ b/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp
@@ -1095,6 +1095,15 @@ static void gen_continuation_yield(MacroAssembler* masm,
__ bind(pinned); // pinned -- return to caller
+ // handle pending exception thrown by freeze
+ __ ld(t0, Address(xthread, in_bytes(Thread::pending_exception_offset())));
+ Label ok;
+ __ beqz(t0, ok);
+ __ leave();
+ __ la(t0, RuntimeAddress(StubRoutines::forward_exception_entry()));
+ __ jr(t0);
+ __ bind(ok);
+
__ leave();
__ ret();
-------------
PR: https://git.openjdk.org/jdk20/pull/101
More information about the hotspot-compiler-dev
mailing list