RFR: 8340212: -Xshare:off -XX:CompressedClassSpaceBaseAddress=0x40001000000 crashes on macos-aarch64 [v10]
Ioi Lam
iklam at openjdk.org
Mon Dec 9 17:54:38 UTC 2024
On Mon, 9 Dec 2024 17:40:22 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> src/hotspot/share/cds/metaspaceShared.cpp line 1496:
>>
>>> 1494: p2i(base_address), precomputed_narrow_klass_shift);
>>> 1495: use_archive_base_addr = false;
>>> 1496: }
>>
>> It seems there's no easy way of testing this code, as the `base_address` need to come from a CDS archive, but the CDS archive cannot contain invalid base addresses.
>>
>> Maybe we should change this to `log_error()`, or even `fatal()`
>
> If this is a log-error or fatal, then maybe we should give an error for an invalid SharedBaseAddress, as with Thomas's suggested patch. We generally try to get SharedBaseAddress and that fails, let the OS code pick one. If we want to give an error for invalid SharedBaseAddress, I could fix the test that fails to not try for an invalid address. But the validity of the address is only for aarch64 so I don't know if we want to do this.
`base_address` here is not from user input. It is something produced by the JVM after validity checks. So if we have an error it, we JVM has done something wrong. I think a fatal() would be apropriate.
In contract, SharedBaseAddress can be specified by the user, and we usually do not use fatal() to report such errors.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21695#discussion_r1876435288
More information about the hotspot-dev
mailing list