RFR: 8338888: SystemDictionary::class_name_symbol has incorrect length check

David Holmes dholmes at openjdk.org
Wed Aug 28 01:45:23 UTC 2024


On Tue, 27 Aug 2024 13:13:43 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> PS. Thanks for taking a look!
>
> I get what you mean, but then, we should take the limit you impose here (print_limit) at face value and act as if Exceptions::fthrow would not impose any limits (since we cannot know them since they are implementation details).
> 
> So, again there is the question if we want to pay 2 GB (multiple times, since we need a buffer for vsprintf to assemble it, then memory in java heap for the resulting j.l.String). Something akin to your log messages where we omit the middle of the string may serve us here as well. Or, just a bigger but still reasonable limit (e.g. 512 KB).

You're right. I can apply the "abridged" pattern here as done in `java_lang_String::print` using the `MaxStringPrintSize` global. But this is now encroaching on the remedial actions I planned to undertake for [JDK-8328882](https://bugs.openjdk.org/browse/JDK-8328882).  I only need this change in this PR to handle the test case for the actual bug fix (otherwise I have to drop the part of the test that verifies it is the expected error message).

I will look at creating a sub-task of JDK-8328882 to handle callers of `Exceptions::fthrow` and fix this issue under that task first.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20709#discussion_r1733762478


More information about the hotspot-runtime-dev mailing list