RFR: 8335334: Stress mode to randomly execute unstable if traps
Tobias Hartmann
thartmann at openjdk.org
Tue Sep 17 11:07:15 UTC 2024
Unstable if traps are supposed to be taken rarely. This patch introduces a `StressUnstableIfTraps` flag that forces unstable if traps to be taken randomly and thus potentially triggering intermittent bugs such as incorrect debug information. It works by adding another if before the unstable if that checks a "random" condition at runtime (a simple shared counter) and then either takes the trap or executes the original, unstable if.
This stress option also has the nice side effect of triggering re-compilation of methods that would otherwise not be re-compiled (see [JDK-8335843](https://bugs.openjdk.org/browse/JDK-8335843)).
I had to adjust a few tests that rely on methods being compiled / deoptimized because with the stress option enabled, deoptimization might unexpectedly (not) happen.
It reliably triggers [JDK-8335977](https://bugs.openjdk.org/browse/JDK-8335977), [JDK-8320308](https://bugs.openjdk.org/browse/JDK-8320308) and [JDK-8335843](https://bugs.openjdk.org/browse/JDK-8335843) in our testing.
Tested with multiple runs up to tier6. I'll integrate it into our (Oracle internal) testing and CTW [(JDK-8340302)](https://bugs.openjdk.org/browse/JDK-8340302) once all the bugs that it currently triggers are fixed.
Thanks,
Tobias
-------------
Commit messages:
- Added stress test
- Test fix
- Randomly skip emitting an uncommon trap
- Small fix
- Merge branch 'master' into JDK-8335334
- Test fix
- Test fix
- Small fix
- More randomization
- Merge branch 'master' into JDK-8335334
- ... and 9 more: https://git.openjdk.org/jdk/compare/e1ebeef0...8af8f423
Changes: https://git.openjdk.org/jdk/pull/21037/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21037&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8335334
Stats: 114 lines in 13 files changed: 107 ins; 5 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/21037.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/21037/head:pull/21037
PR: https://git.openjdk.org/jdk/pull/21037
More information about the hotspot-dev
mailing list