RFR: 8329728: Read long lines in ClassListParser [v2]

Ioi Lam iklam at openjdk.org
Tue Apr 9 17:27:10 UTC 2024


On Mon, 8 Apr 2024 22:04:46 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

>> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   @matias9927 and @calvinccheung comments - limit line to 4M. Added gtest cases. Test for class names > 64K
>
> src/hotspot/share/utilities/lineReader.cpp line 44:
> 
>> 42: void LineReader::init(FILE* file) {
>> 43:   _file = file;
>> 44:   _buffer_len = 16; // start at small size to test expansion logic
> 
> Maybe set the `_buffer_len` to a larger value (256?) for non-debug build?

I changed to 


_buffer_len = DEBUG_ONLY(16) NOT_DEBUG(4096);

> src/hotspot/share/utilities/lineReader.hpp line 48:
> 
>> 46:   }
>> 47: 
>> 48:   // Return one line from _file, as a NUL-terminated string. The length and contents of this
> 
> Suggestion: NUL-terminated -> null-terminated

I changed to `0-terminated`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18669#discussion_r1558052689
PR Review Comment: https://git.openjdk.org/jdk/pull/18669#discussion_r1558052661


More information about the hotspot-dev mailing list