Integrated: 8332865: ubsan: os::attempt_reserve_memory_between reports overflow

Matthias Baesken mbaesken at openjdk.org
Thu Jun 6 12:29:48 UTC 2024


On Tue, 4 Jun 2024 15:19:11 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> When running by ubsan-enabled binaries on Linux x86_64, os::attempt_reserve_memory_between reports overflows.
> This happens in the  :tier1 tests ( gtest/LargePageGtests_use-large-pages.jtr )
> 
> 
> "runtime error: pointer index expression with base 0x000000001000 overflowed to 0xfffffffffffff000"
> 
> This coding triggers the ubsan issue
> 
> 
>   char* const hi_att = align_down(MIN2(max, absolute_max) - bytes, alignment_adjusted);
>   if (hi_att > max) {
>     return nullptr; // overflow
>   }
> 
> 
> However the function already contains overflow handling, so probably it is sufficient to add an attribute to the function os::attempt_reserve_memory_between to disable ubsan checks for this function.

This pull request has now been integrated.

Changeset: 8de5d201
Author:    Matthias Baesken <mbaesken at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/8de5d2014a87d58d389eb8400f619d1b1fa3abe7
Stats:     5 lines in 1 file changed: 4 ins; 0 del; 1 mod

8332865: ubsan: os::attempt_reserve_memory_between  reports overflow

Reviewed-by: stuefe, clanger

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

PR: https://git.openjdk.org/jdk/pull/19543


More information about the hotspot-runtime-dev mailing list