RFR: 8335334: Stress mode to randomly execute unstable if traps
Tobias Hartmann
thartmann at openjdk.org
Tue Sep 17 11:14:04 UTC 2024
On Tue, 17 Sep 2024 11:01:27 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
> 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
src/hotspot/share/opto/compile.cpp line 722:
> 720: }
> 721:
> 722: if (StressLCM || StressGCM || StressIGVN || StressCCP ||
We need to initialize the seed earlier because `StressUnstableIfTraps` is already used during parsing.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21037#discussion_r1763047875
More information about the hotspot-dev
mailing list