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

Manuel Hässig mhaessig at openjdk.org
Fri Nov 28 12:17:51 UTC 2025


On Wed, 26 Nov 2025 06:31:22 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.
>
> Dean Long has updated the pull request incrementally with one additional commit since the last revision:
> 
>   remove extra spaces

Thank you for fixing this, @dean-long. It looks good to me.

test/hotspot/jtreg/compiler/exceptions/TestAccessErrorInCatch.java line 26:

> 24: /*
> 25:  * @test
> 26:  * @bug 8367002

Suggestion:

 * @bug 8367002 8370766

Perhaps we should add this bug to the test, since you modified it.

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

Marked as reviewed by mhaessig (Committer).

PR Review: https://git.openjdk.org/jdk/pull/28486#pullrequestreview-3518732734
PR Review Comment: https://git.openjdk.org/jdk/pull/28486#discussion_r2571470700


More information about the hotspot-compiler-dev mailing list