RFR: 8305625: Stress test crashes with SEGV in Deoptimization::deoptimize_frame_internal(JavaThread*, long*, Deoptimization::DeoptReason)
Richard Reingruber
rrich at openjdk.org
Wed Apr 12 20:55:09 UTC 2023
On Wed, 12 Apr 2023 15:48:53 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:
> Please review this fix. The check to skip walking stacks of virtual threads will not identify a thread in a transition since it relies on the jvmti_vthread() which would have already changed at the very beginning of it. The crash happens because the anchor might have changed between walking the stack of the thread in a transition and executing the deopt handshake for a particular frame. The frame is never found and looping executing fr.sender() crashes. This scenario can happen if the initial EscapeBarrierSuspendHandshake executed to synchronize against all threads finds the thread blocked in the stackchunk allocation path. Because the thread will actually block on the next transition to Java, and not on a blocked->vm transition, it will continue executing and change its anchor while the requester is walking its stack. There are more details in the bug comments.
> The fix modifies the conditional to check if the continuation is mounted or not. This will identify the transition case too and won't face the anchor change issue since the continuation entry will be removed after returning from the freeze call.
> The fix was tested against a reproducer which I attached to the bug.
>
> Thanks,
> Patricio
The fix looks good to me.
Thanks, Richard.
-------------
Marked as reviewed by rrich (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/13446#pullrequestreview-1382101292
More information about the hotspot-runtime-dev
mailing list