RFR: 8358289: [asan] runtime/cds/appcds/aotCode/AOTCodeFlags.java reports heap-buffer-overflow in ArchiveBuilder [v2]
Vladimir Kozlov
kvn at openjdk.org
Tue Jun 3 17:58:48 UTC 2025
On Tue, 3 Jun 2025 17:37:49 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> Vladimir Kozlov has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Remove unused argument
>
> src/hotspot/share/runtime/sharedRuntime.cpp line 2227:
>
>> 2225: }
>> 2226:
>> 2227: static int compute_size(int total_args_passed) {
>
> OK, but if the source of discrepancy is between two places computing stuff separately (inconsistently), do you want to make the computations mechanically the same?
>
> Something like:
>
>
> static int compute_size_in_words(int total_args_passed) {
> return (int)heap_word_size(sizeof(AdapterFingerPrint) + (length(total_args_passed) * sizeof(int)));
> }
>
> static int compute_size_in_bytes(int total_args_passed) {
> return compute_size_in_words(total_args_passed) * BytesPerWord;
> }
>
>
> Then use `compute_size_in_words()` in the other place: https://github.com/openjdk/jdk/blob/master/src/hotspot/share/runtime/sharedRuntime.cpp#L2421
Yes, I can do that. But I will pass _length which is different from total_args_passed.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25604#discussion_r2124538592
More information about the hotspot-dev
mailing list