RFR: 8305765: CompressedClassPointers.java is unreliable due to ASLR
Thomas Stuefe
stuefe at openjdk.org
Wed Oct 4 17:58:31 UTC 2023
On Mon, 2 Oct 2023 18:30:54 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:
> A new log statement is added to the `Metaspace::global_initialize` function to indicate that the compress class space is being allocate at an address chosen by the platform. The `CompressedClassPointers.java` test will base on the log output before checking the expected `Narrow klass base` output.
>
> Passed tiers 1 - 3 testing.
> Also ran the test on linux-aarch64 and linux-aarch64-debug platforms, 30 times each.
Wait, I don't get this. This test tests the ability of the platform to place the CCS in lower address space regions. Failing that and falling back to reserving anywhere should count as a failure.
To put it another way, if the logic that tries to reserve low address memory is broken, this test should fail, not accept the fallback solution as success.
That is not to say that this test is not fragile. It is. It makes sense to revise it, and tweak it to have a higher success rate. E.g. reduce the CCS size drastically. But with, say, a 64M class space, no CDS, and a tiny heap, it should be possible to find some free space below 32G.
Looking at the test, it also may make sense to remove the dependency on UseCompressedOops.
Side note: Don't we need two reviewers for hotspot code? Or does this rule not apply for tests?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16014#issuecomment-1747380822
More information about the hotspot-runtime-dev
mailing list