[jdk20] RFR: 8298400: Virtual thread instability when stack overflows
Ron Pressler
rpressler at openjdk.org
Wed Jan 18 00:48:20 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.
There is a difference between enter and yield. enter may call a Java method, and that is the only way it may have an exception (as thaw never throws an exception from native code, only in the special case of a SOE, thrown in `generate_cont_thaw`, so I don't think it uses pending exceptions). yield, on the other hand, never calls a Java method, and only throws exceptions from native code.
There is no added overhead in yield, because the exception handling code is only reached when the continuation is pinned, which we check anyway (and should be rare).
-------------
PR: https://git.openjdk.org/jdk20/pull/101
More information about the hotspot-compiler-dev
mailing list