RFR: 8361487: [ubsan] test_committed_virtualmemory.cpp check_covered_pages shows overflow [v4]
Afshin Zafari
azafari at openjdk.org
Fri Nov 14 08:39:10 UTC 2025
On Fri, 14 Nov 2025 08:28:30 GMT, Paul Hübner <phubner at openjdk.org> wrote:
>> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
>>
>> style and not constexpr
>
> test/hotspot/gtest/runtime/test_committed_virtualmemory.cpp line 97:
>
>> 95: continue;
>> 96: }
>> 97: address page_addr = base + page_num[index] * page_sz;
>
> What if we `assert(page_num[index] >= 0)` at this point if we know that negative numbers may cause overflows?
Negative numbers are not bug/invalid. They are used as a marker that the page is inside a committed region.
In the test we list/iterate all committed regions of a reserved memory are. For each committed region we check a list of pages whether the page is inside the committed region or not. if yes, we mark the page with -1. There two loops here one for committed regions and for list of page numbers.
After loops, we check and expect that all the pages were marked as being inside committed regions.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28151#discussion_r2526466012
More information about the hotspot-runtime-dev
mailing list