Integrated: 8370766: JVM crashes when running compiler/exceptions/TestAccessErrorInCatch.java fails with -XX:+VerifyStack

Dean Long dlong at openjdk.org
Tue Dec 2 18:22:33 UTC 2025


On Tue, 25 Nov 2025 03:25:05 GMT, Dean Long <dlong at openjdk.org> wrote:

> The problem is C2 is throwing an exception and then deoptimizing, and the -XX:+VerifyStack logic expects the stack to be empty, match the "before" state if the reexecute flag is set, or match the "after" state.  C2 is using the "before" state, so for correctness it also needs to set the reexecute flag.
> 
> I played around with other approaches, like:
> 1. setting the stack to empty
> 2. adding all the bytecodes that can throw to the list in AbstractInterpreter::bytecode_should_reexecute()
> 3. always setting the reexecute flag in add_safepoint_edges() if must_throw is set
> but in the end I decided to go with the minimal localized low-risk change.

This pull request has now been integrated.

Changeset: 5627ff2d
Author:    Dean Long <dlong at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/5627ff2d9165ee1f7354c1ff1626f4949ef7fa3f
Stats:     15 lines in 2 files changed: 8 ins; 1 del; 6 mod

8370766: JVM crashes when running compiler/exceptions/TestAccessErrorInCatch.java fails with -XX:+VerifyStack

Co-authored-by: Manuel Hässig <mhaessig at openjdk.org>
Reviewed-by: mhaessig, chagedorn

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

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


More information about the hotspot-compiler-dev mailing list