8192898: AIX build broken after 8190308

David Holmes david.holmes at oracle.com
Sun Dec 3 02:06:04 UTC 2017

Hi Martin,

On 2/12/2017 12:03 AM, Doerr, Martin wrote:
> Hi,
> I have opened a new bug jdk-8192898.
> "MAP_NORESERVE" was introduced in os_posix.cpp. It is not POSIX and it is not defined on AIX. Not sure if any other OS is affected, too.
> Should non-POSIX code be in os_posix.cpp?

In principle not. That file is starting to become a common place to 
mostly-share code that is mostly-common across non-Windows platforms. I 
would prefer to see this file contain predominantly POSIX code with 
necessary tweaks on a platform basis. Otherwise it may be better to 
rename the file to avoid confusion.

> I can provide a trivial fix for AIX (see below). But maybe somebody has a better idea?

I would prefer to see the use of non-POSIX conforming code be 
conditionalized on the platforms that are known to support it - ie 
platforms have to specifically opt-in to using it because someone has 
determined that it does in fact work, and is needed, for that platform. 
That should have been done by the people who worked on 8190308. I can't 
expect you to do that for the other platforms, so fixing AIX the way you 
suggest is the most pragmatic thing to do right now.


> Best regards,
> Martin
> --- a/src/hotspot/os/posix/os_posix.cpp Thu Nov 30 18:05:57 2017 +0100
> +++ b/src/hotspot/os/posix/os_posix.cpp Thu Nov 30 18:55:02 2017 +0100
> @@ -200,7 +200,7 @@
> static char* reserve_mmapped_memory(size_t bytes, char* requested_addr) {
>     char * addr;
>     if (requested_addr != NULL) {
>       assert((uintptr_t)requested_addr % os::vm_page_size() == 0, "Requested address should be aligned to OS page size");
>       flags |= MAP_FIXED;

More information about the hotspot-runtime-dev mailing list