JDK-8335334 : Stress mode to randomly execute unstable if traps
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,17,21,24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-06-28
  • Updated: 2024-09-30
  • Resolved: 2024-09-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 24
24 b17Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Unstable if traps are supposed to be taken rarely. Below patch introduces a 'StressUnstableIfTraps' flag that forces unstable if traps to be taken randomly and thus potentially triggering intermittent bugs. It works by adding another if before the unstable if that checks a "random" condition at runtime and then either takes the trap or executes the original, unstable if:
https://github.com/openjdk/jdk/compare/master...TobiHartmann:jdk:JDK-8335334

The stress option also has the nice side effect of triggering re-compilation of methods that would otherwise not be re-compiled (see JDK-8335843).
Comments
The fix revealed an issue with JDK-8319879 (-XX:StressIncrementalInlining): The stress seed should already be initialized before parsing.
24-09-2024

Changeset: 63e611cd Branch: master Author: Tobias Hartmann <thartmann@openjdk.org> Date: 2024-09-23 12:30:30 +0000 URL: https://git.openjdk.org/jdk/commit/63e611cd5d7eb4fc6ea6633ff9123e4bee5f5993
23-09-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/21037 Date: 2024-09-17 11:01:27 +0000
17-09-2024

We should also randomly *not* emit a trap at all and continue parsing both branches.
22-08-2024

After four different prototypes, the latest version seems to be rather stable (only triggers test bugs).
05-07-2024

Looks like the patch still has a bug. I see massive failures in testing.
28-06-2024