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 1 changed file with 8 additions and 8 deletions.
@@ -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

3 comments on commit 0ac84d1

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 0ac84d1 May 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tstuefe
Copy link
Member Author

@tstuefe tstuefe commented on 0ac84d1 Jun 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk11u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 0ac84d1 Jun 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tstuefe the backport was successfully created on the branch tstuefe-backport-0ac84d18 in my personal fork of openjdk/jdk11u-dev. To create a pull request with this backport targeting openjdk/jdk11u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

this pull request contains a backport of commit 0ac84d18 from the openjdk/jdk repository.

The commit being backported was authored by Thomas Stuefe on 5 May 2021 and was reviewed by Martin Doerr.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk11u-dev:

$ git fetch https://github.com/openjdk-bots/jdk11u-dev tstuefe-backport-0ac84d18:tstuefe-backport-0ac84d18
$ git checkout tstuefe-backport-0ac84d18
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk11u-dev tstuefe-backport-0ac84d18

Please sign in to comment.