< prev index next >
src/hotspot/os/aix/os_aix.cpp
Print this page
rev 51957 : 8224221: add memprotect calls to event log
Reviewed-by: dholmes, mdoerr
*** 2450,2459 ****
--- 2450,2460 ----
// This means if the memory was allocated using shmget/shmat, protection wont work
// but mprotect will still return 0:
//
// See http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.basetechref/doc/basetrf1/mprotect.htm
+ Events::log(NULL, "Protecting memory [" INTPTR_FORMAT "," INTPTR_FORMAT "] with protection modes %x", p2i(addr), p2i(addr+size), prot);
bool rc = ::mprotect(addr, size, prot) == 0 ? true : false;
if (!rc) {
const char* const s_errno = os::errno_name(errno);
warning("mprotect(" PTR_FORMAT "-" PTR_FORMAT ", 0x%X) failed (%s).", addr, addr + size, prot, s_errno);
*** 2490,2499 ****
--- 2491,2501 ----
// a stack. It is an OS error.
//
// A valid strategy is just to try again. This usually works. :-/
::usleep(1000);
+ Events::log(NULL, "Protecting memory [" INTPTR_FORMAT "," INTPTR_FORMAT "] with protection modes %x", p2i(addr), p2i(addr+size), prot);
if (::mprotect(addr, size, prot) == 0) {
const bool read_protected_2 =
(SafeFetch32((int*)addr, 0x12345678) == 0x12345678 &&
SafeFetch32((int*)addr, 0x76543210) == 0x76543210) ? true : false;
rc = true;
< prev index next >