RFR: 8268033: compiler/intrinsics/bmi/verifycode/BzhiTestI2L.java fails with "fatal error: Not compilable at tier 3: CodeBuffer overflow"
Christian Hagedorn
chagedorn at openjdk.java.net
Wed Jan 26 10:11:35 UTC 2022
On Tue, 25 Jan 2022 16:14:29 GMT, Emanuel Peter <duke at openjdk.java.net> wrote:
> …th "fatal error: Not compilable at tier 3: CodeBuffer overflow"
>
> **Problem:**
> When `BzhiTestI2L.java` is compiled with flag `-Xcomp` and `-XX:+VerifyOops`, it happens that also `sun.security.util.KnownOIDs::<clinit>` is compiled. This class is an `enum` with many string values. This generates a rather large code size for the `<clinit>` method. The additional code for verifying oops pushes it over the CodeBuffer limit (`NMethodSizeLimit`). Because of the overflow, the compilation hits a bailout. Because of `-XX:+AbortVMOnCompilationFailure` this aborts the test, it fails.
>
> **Analysis:**
> We can not control the size of library classes/enums, and the size of the generated code from the respective `<clinit>`.
> `-Xcomp` and `-XX:+VerifyOops` are helpful flags for tests in general.
> However, it does not make sense to require all methods to be compiled.
>
> **Solution:**
> Restrict compilation to the relevant classes in the test files.
> Removed test from `test/hotspot/jtreg/ProblemList-Xcomp.txt` (List of quarantined tests for testing in Xcomp mode).
>
> **Alternative Solutions:**
> 1. Increase `NMethodSizeLimit`. The concrete value would be arbitrary, and if any class/enum exceeds it in the future, this same test bug reappears.
> 2. Drop `-XX:+AbortVMOnCompilationFailure`. This would accept bailouts, and the test would pass despite bailouts. This helps with the current testing bug. But in the future, unexpected bailouts would not be detected. This is problematic, because the test compiles code with the WhiteBox API, to check if it compiles correctly. Thus, bailouts are an important sign that something might have gone wrong.
>
> The Test now passes (initialized with the same parameters as reported in issue).
Nice analysis! Looks good and trivial.
-------------
Marked as reviewed by chagedorn (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/7214
More information about the hotspot-compiler-dev
mailing list