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

Dean Long dlong at openjdk.org
Tue Nov 25 03:31:59 UTC 2025


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.

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

Commit messages:
 - set reexecute flag when calling rethrow_C

Changes: https://git.openjdk.org/jdk/pull/28486/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28486&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8370766
  Stats: 14 lines in 2 files changed: 8 ins; 1 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/28486.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28486/head:pull/28486

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


More information about the hotspot-compiler-dev mailing list