Skip to content

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