RFR: 8273895: compiler/ciReplay/TestVMNoCompLevel.java fails due to wrong data size with TieredStopAtLevel=2, 3

Vladimir Kozlov kvn at openjdk.java.net
Thu Sep 16 17:02:45 UTC 2021


On Thu, 16 Sep 2021 14:43:43 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

> `TestVMNoCompLevel.java` is first letting the VM crash with `-XX:CICrashAt=1` (method `TestMain::test()`), then removes the compilation level information from the compile entry in the replay file and then replay compiles with and without tiered compilation. When running the replay file with tiered compilation off, it results in the assertion failure.
> 
> When letting the VM crash with `-XX:TieredStopAtLevel=2,3` (C1 only), we get a slightly different MDO size for `TestMain::test()` compared to letting the VM crash with `-XX:-TieredCompilation` (C2 only). The C1 reported MDO for `TestMain::test()` is slightly smaller than the C2 MDO. The reason for that can be traced back to JDK-8251462 which changed [this code](https://github.com/openjdk/jdk/commit/15196325#diff-74ba139c0d6ec44945f1fc6d18d63e0d0fe0da5d38a5e347c6d4d38e0f7b112bL788-L790) in `is_speculative_trap_bytecode()`. This now only returns true if C2 is enabled. `is_speculative_trap_bytecode()` is called when initializing an MDO here:
> https://github.com/openjdk/jdk/blob/2ef6871118109b294e3148c8f15d4335039dd121/src/hotspot/share/oops/methodData.cpp#L1235
> 
> If C2 is enabled, then we reserve some extra data space for trap data. But when running with C1 only, this is no longer done since JDK-8251462, so we allocate no extra data space in the MDO for the crashing method `TestMain::test()`.
> 
> When now crashing first with `-XX:TieredStopAtLevel=2,3`, we collect an MDO without the extra trap data for the replay file. But when replay compiling afterwards with `-XX:-TieredCompilation`, we try to compile it with C2 (we removed the compilation level from the compile entry). We initialize the MDO of `TestMain::test()` with the extra trap data which is a mismatch to the reported C1 only MDO without extra trap data and we fail with the assertion.
> 
> I suggest to just not run this test with `-XX:TieredStopAtLevel=2,3` to not try to compile a C1 method with profiling data with C2 in order to avoid this MDO mismatch assertion failure. I'm not sure either of the value of this test as this old format is not created anymore. But we might still want to keep this test around.
> 
> Thanks,
> Christian

Good.

-------------

Marked as reviewed by kvn (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/5548


More information about the hotspot-compiler-dev mailing list