RFR: 8267341: macos attempt_reserve_memory_at(arg1, arg2, true) failure

Daniel D.Daugherty dcubed at openjdk.java.net
Tue Jan 4 20:27:12 UTC 2022


On Tue, 4 Jan 2022 19:18:45 GMT, Gerard Ziemski <gziemski at openjdk.org> wrote:

> Re-enable **release_multi_mappings** gtest on macOS
> 
> This test would occasionally fail on macOS, but thanks to Dan's catch, it turned out that it actually only fails on those test machines that run macOS 10.13.6 or earlier.
> 
> The proposed fix simply makes a single call to `os::reserve_memory()` with the `executable` flag `True`, and if that failed forces `executable`  to `False` later in the actual test code (alternatively we could have just also skipped that test portion completely, but this way we actually do something rather than nothing at all).
> 
> Tested manually on macOS 10.13.6 and via Mach5

Thumbs up. You mentioned "Mach5" testing; I'm presuming Tier1 was
done and passed.

test/hotspot/gtest/runtime/test_os.cpp line 368:

> 366:   // to figure out if that's supported on this macOS version
> 367:   const bool executable = true;
> 368:   size_t test_len = 128;

Just curious: since you made local var `executable` `const`, I have to wonder
why you didn't make local var `test_len` `const`?

test/hotspot/gtest/runtime/test_os.cpp line 388:

> 386:     //  to prevent kernel from folding these mappings.
> 387: #ifdef __APPLE__
> 388:     const bool executable = exec_supported? (stripe % 2 == 0) : false;

Nit: please add a space before the `?` operator.

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

Marked as reviewed by dcubed (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/6960


More information about the hotspot-runtime-dev mailing list