< prev index next >

src/os_cpu/linux_zero/vm/os_linux_zero.cpp

Print this page
rev 12363 : 8169373: Work around linux NPTL stack guard error.
Summary: Also skip libc guard page for compiler thread, merge similar code on linux platforms, and streamline libc guard page handling on linuxs390, linuxppc, aixppc.
Reviewed-by: dholmes, dcubed, kvn

*** 318,350 **** size_t s = (thr_type == os::compiler_thread ? 2 * M : 512 * K); #endif // _LP64 return s; } - size_t os::Linux::default_guard_size(os::ThreadType thr_type) { - // Only enable glibc guard pages for non-Java threads - // (Java threads have HotSpot guard pages) - return (thr_type == java_thread ? 0 : page_size()); - } - static void current_stack_region(address *bottom, size_t *size) { pthread_attr_t attr; int res = pthread_getattr_np(pthread_self(), &attr); if (res != 0) { if (res == ENOMEM) { vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "pthread_getattr_np"); } else { ! fatal("pthread_getattr_np failed with errno = %d", res); } } address stack_bottom; size_t stack_bytes; res = pthread_attr_getstack(&attr, (void **) &stack_bottom, &stack_bytes); if (res != 0) { ! fatal("pthread_attr_getstack failed with errno = %d", res); } address stack_top = stack_bottom + stack_bytes; // The block of memory returned by pthread_attr_getstack() includes // guard pages where present. We need to trim these off. --- 318,344 ---- size_t s = (thr_type == os::compiler_thread ? 2 * M : 512 * K); #endif // _LP64 return s; } static void current_stack_region(address *bottom, size_t *size) { pthread_attr_t attr; int res = pthread_getattr_np(pthread_self(), &attr); if (res != 0) { if (res == ENOMEM) { vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "pthread_getattr_np"); } else { ! fatal("pthread_getattr_np failed with error = %d", res); } } address stack_bottom; size_t stack_bytes; res = pthread_attr_getstack(&attr, (void **) &stack_bottom, &stack_bytes); if (res != 0) { ! fatal("pthread_attr_getstack failed with error = %d", res); } address stack_top = stack_bottom + stack_bytes; // The block of memory returned by pthread_attr_getstack() includes // guard pages where present. We need to trim these off.
< prev index next >