8266506: [aix] Treat mapping attempt too close to BRK as a mapping error

Reviewed-by: mdoerr
This commit is contained in:
Thomas Stuefe 2021-05-05 11:57:20 +00:00
parent 02cdd6eb6d
commit 0ac84d1813

View File

@ -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