Skip to content

Conversation

@theresa-m
Copy link
Contributor

@theresa-m theresa-m commented Nov 4, 2025

J9 has been validating the type state for exceptions after astore
changes the type. This is incorrect since according to JVMS
4.10.1.4 the state of a stack map frame is the incoming state
of an instruction. This means that the type state of astore is
the state before the new local is set.

Instead only compare the type state for exceptions if astore
changes the type state and another bytecode within the range
of the exception exists to make sure its still compatible.

Fixes: #22812

Internal tests:
Java 25: https://hyc-runtimes-jenkins.swg-devops.com/view/Test_grinder/job/Grinder/56075
Java 11: https://hyc-runtimes-jenkins.swg-devops.com/view/Test_grinder/job/Grinder/56076/
IBM Java 8: http://vmfarm.rtp.raleigh.ibm.com/build_info.php?build_id=105944

@theresa-m theresa-m force-pushed the fix_22812 branch 6 times, most recently from e60570d to 8961174 Compare November 5, 2025 07:46
@theresa-m theresa-m marked this pull request as draft November 5, 2025 07:47
@theresa-m theresa-m marked this pull request as ready for review November 5, 2025 08:13
@theresa-m theresa-m marked this pull request as draft November 5, 2025 08:54
@theresa-m theresa-m changed the title Move astore exception table comparison before the instruction Check stack map if type changed in the exception table range Nov 5, 2025
@theresa-m theresa-m force-pushed the fix_22812 branch 4 times, most recently from 15f4e78 to 029331c Compare November 5, 2025 19:30
@theresa-m theresa-m marked this pull request as ready for review November 5, 2025 23:31
@theresa-m
Copy link
Contributor Author

@tajila this is ready for review.

@tajila tajila requested a review from babsingh November 12, 2025 14:27
@pshipton
Copy link
Member

This has a conflict.

Signed-off-by: Theresa Mammarella <[email protected]>
@theresa-m
Copy link
Contributor Author

This has a conflict.

Fixed.

Copy link
Contributor

@babsingh babsingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

functionally, these changes look good. i have noted a few minor nits in my comments. @gacholio should review these changes as well.

@babsingh babsingh requested a review from gacholio November 13, 2025 16:09
J9 has been validating the type state for exceptions after astore
 changes the type. This is incorrect since according to JVMS
 4.10.1.4 the state of a stack map frame is the incoming state
 of an instruction. This means that the type state of astore is
the state before the new local is set.

Instead only compare the type state for exceptions if astore
changes the type state and another bytecode within the range
of the exception exists to make sure its still compatible.

Signed-off-by: Theresa Mammarella <[email protected]>
@babsingh
Copy link
Contributor

jenkins test sanity.functional,sanity.openjdk zlinux jdk8

@babsingh
Copy link
Contributor

jenkins test sanity.functional,sanity.openjdk amac jdk21,jdk25

@babsingh
Copy link
Contributor

jenkins test sanity.functional,sanity.openjdk plinux jdk17

@babsingh
Copy link
Contributor

jenkins compile win jdk11

@gacholio gacholio merged commit 983fdc8 into eclipse-openj9:master Nov 14, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bytecode verifier error in exception handler

4 participants