Skip to content

[GR-44352] [GR-61906] Mark ZoneOffset.rules with RecomputeFieldValue #10663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

graalvmbot
Copy link
Collaborator

java.time.ZoneOffset is initialized at build time as a side effect of initializing sun.security.ssl.SSLContextImpl$AbstractTLSContext. During this initialization, ZoneOffset.getRules() method gets called on the constant ZoneOffset.UTC and therefore the ZoneOffset.UTC.rules field gets initialized to a non-null value. As this field is marked as @Stable, simulated class initialization may constant fold any associated LoadFieldNode. Therefore, the success of the simulation of ZoneOffset.UTC.getRules()depends on whether the getRules() method was already called at buildtime onZOneOffset.UTC and as there is no synchronization between those events, the result of the simulation is non-deterministic.

To achieve deterministic analysis results, we mark the field with RecomputeFieldValue to prevent its constant folding.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Feb 11, 2025
@graalvmbot graalvmbot closed this Feb 12, 2025
@graalvmbot graalvmbot deleted the d-kozak/GR-44352/analysis-determinism-testing branch February 12, 2025 16:50
@graalvmbot graalvmbot merged commit 18996df into master Feb 12, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants