Integrated: 8305625: Stress test crashes with SEGV in Deoptimization::deoptimize_frame_internal(JavaThread*, long*, Deoptimization::DeoptReason)

Patricio Chilano Mateo pchilanomate at openjdk.org
Mon Apr 17 14:43:45 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

This pull request has now been integrated.

Changeset: 73609604
Author:    Patricio Chilano Mateo <pchilanomate at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/7360960454b3116a0724396f25415f2c3bcf8930
Stats:     3 lines in 1 file changed: 0 ins; 1 del; 2 mod

8305625: Stress test crashes with SEGV in Deoptimization::deoptimize_frame_internal(JavaThread*, long*, Deoptimization::DeoptReason)

Reviewed-by: rrich, rehn

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

PR: https://git.openjdk.org/jdk/pull/13446


More information about the hotspot-dev mailing list