RFR: 8327156: Avoid copying in StringTable::intern(oop, TRAPS)

David Holmes dholmes at openjdk.org
Wed Oct 16 20:55:15 UTC 2024


On Wed, 16 Oct 2024 08:49:55 GMT, Casper Norrbin <cnorrbin at openjdk.org> wrote:

>> src/hotspot/share/classfile/javaClasses.cpp line 393:
>> 
>>> 391: #ifdef ASSERT
>>> 392:   // This check is too strict when the symbol does not contain valid UTF8.
>>> 393:   if (UTF8::is_legal_utf8((const unsigned char*)utf8_str, utf8_len, false)) {
>> 
>> But a successfully created Symbol should only ever be valid UTF8. ??
>
> In theory, yes. However, there was a single test which somehow generated corrupted Symbols. I did not investigate this much further, and instead relaxed the check to look the same as in `java_lang_String::create_from_str`.

That seems a bug as it should not be possible. Please dig up the failing test case so I/we can examine it further - thanks.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21325#discussion_r1803785617


More information about the hotspot-dev mailing list