src/os/bsd/vm/os_bsd.cpp

changeset 4989
f32b6c267d2e
parent 4891
8be1318fbe77
child 5040
9ce110b1d14a
     1.1 --- a/src/os/bsd/vm/os_bsd.cpp	Mon Apr 29 16:36:17 2013 -0400
     1.2 +++ b/src/os/bsd/vm/os_bsd.cpp	Mon Apr 29 11:03:49 2013 -0700
     1.3 @@ -2080,9 +2080,10 @@
     1.4      flags |= MAP_FIXED;
     1.5    }
     1.6  
     1.7 -  // Map uncommitted pages PROT_READ and PROT_WRITE, change access
     1.8 -  // to PROT_EXEC if executable when we commit the page.
     1.9 -  addr = (char*)::mmap(requested_addr, bytes, PROT_READ|PROT_WRITE,
    1.10 +  // Map reserved/uncommitted pages PROT_NONE so we fail early if we
    1.11 +  // touch an uncommitted page. Otherwise, the read/write might
    1.12 +  // succeed if we have enough swap space to back the physical page.
    1.13 +  addr = (char*)::mmap(requested_addr, bytes, PROT_NONE,
    1.14                         flags, -1, 0);
    1.15  
    1.16    if (addr != MAP_FAILED) {

mercurial