Skip to content
Permalink
Browse files
8266506: [aix] Treat mapping attempt too close to BRK as a mapping error
Reviewed-by: mdoerr
  • Loading branch information
tstuefe committed May 5, 2021
1 parent 02cdd6e commit 0ac84d18133857a75769e2bb3ac2c2d2f9508191
Showing with 8 additions and 8 deletions.
  1. +8 −8 src/hotspot/os/aix/os_aix.cpp
@@ -1574,10 +1574,10 @@ static char* reserve_shmated_memory (size_t bytes, char* requested_addr) {
// We must prevent anyone from attaching too close to the
// BRK because that may cause malloc OOM.
if (requested_addr != NULL && is_close_to_brk((address)requested_addr)) {
trcVerbose("Wish address " PTR_FORMAT " is too close to the BRK segment. "
"Will attach anywhere.", p2i(requested_addr));
// Act like the OS refused to attach there.
requested_addr = NULL;
trcVerbose("Wish address " PTR_FORMAT " is too close to the BRK segment.", p2i(requested_addr));
// Since we treat an attach to the wrong address as an error later anyway,
// we return NULL here
return NULL;
}

// For old AS/400's (V5R4 and older) we should not even be here - System V shared memory is not
@@ -1703,10 +1703,10 @@ static char* reserve_mmaped_memory(size_t bytes, char* requested_addr) {
// We must prevent anyone from attaching too close to the
// BRK because that may cause malloc OOM.
if (requested_addr != NULL && is_close_to_brk((address)requested_addr)) {
trcVerbose("Wish address " PTR_FORMAT " is too close to the BRK segment. "
"Will attach anywhere.", p2i(requested_addr));
// Act like the OS refused to attach there.
requested_addr = NULL;
trcVerbose("Wish address " PTR_FORMAT " is too close to the BRK segment.", p2i(requested_addr));
// Since we treat an attach to the wrong address as an error later anyway,
// we return NULL here
return NULL;
}

// In 64K mode, we lie and claim the global page size (os::vm_page_size()) is 64K

0 comments on commit 0ac84d1

Please sign in to comment.