Mercurial > hg > truffle
comparison src/os_cpu/linux_x86/vm/os_linux_x86.cpp @ 477:24fda36852ce
6727377: VM stack guard pages on Windows should PAGE_READWRITE not PAGE_EXECUTE_READWRITE
Summary: Make reguard_stack change access to RW, not execute and use os::protect_memory with the new parameter when change needed to X.
Reviewed-by: acorn, jcoomes
author | coleenp |
---|---|
date | Wed, 10 Dec 2008 15:14:29 -0800 |
parents | d1605aabd0a1 |
children | 0fbdb4381b99 |
comparison
equal
deleted
inserted
replaced
473:3ad2b8576c4a | 477:24fda36852ce |
---|---|
420 | 420 |
421 // In conservative mode, don't unguard unless the address is in the VM | 421 // In conservative mode, don't unguard unless the address is in the VM |
422 if (addr != last_addr && | 422 if (addr != last_addr && |
423 (UnguardOnExecutionViolation > 1 || os::address_is_in_vm(addr))) { | 423 (UnguardOnExecutionViolation > 1 || os::address_is_in_vm(addr))) { |
424 | 424 |
425 // Unguard and retry | 425 // Set memory to RWX and retry |
426 address page_start = | 426 address page_start = |
427 (address) align_size_down((intptr_t) addr, (intptr_t) page_size); | 427 (address) align_size_down((intptr_t) addr, (intptr_t) page_size); |
428 bool res = os::unguard_memory((char*) page_start, page_size); | 428 bool res = os::protect_memory((char*) page_start, page_size, |
429 os::MEM_PROT_RWX); | |
429 | 430 |
430 if (PrintMiscellaneous && Verbose) { | 431 if (PrintMiscellaneous && Verbose) { |
431 char buf[256]; | 432 char buf[256]; |
432 jio_snprintf(buf, sizeof(buf), "Execution protection violation " | 433 jio_snprintf(buf, sizeof(buf), "Execution protection violation " |
433 "at " INTPTR_FORMAT | 434 "at " INTPTR_FORMAT |