RFR: 8338888: SystemDictionary::class_name_symbol has incorrect length check
David Holmes
dholmes at openjdk.org
Tue Aug 27 08:03:03 UTC 2024
On Tue, 27 Aug 2024 07:57:01 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> But `Exceptions::fthrow` truncates at 1024 bytes anyway, which I think is absolutely fine. So the print_limit could just be 1024.
>
> It could ... but that limit of `fthrow` is not really part of the API or exposed. It is also a somewhat arbitrary VM limit and the same kind of check in Java code would just include the complete name regardless of size (limited to `int_max` latin1 characters of course). Even at 64K you may want to see why your class name is unexpectedly longer than you thought. And for other callers of this API the truncation applied by `fthrow` might be considered a bug as it would impede debugging.
>
> I wanted to avoid the `os::vsnprintf` problem without imposing any other policy choice here.
PS. Thanks for taking a look!
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20709#discussion_r1732334375
More information about the hotspot-runtime-dev
mailing list