From c1db70582338532c303389af118cdc55008baec2 Mon Sep 17 00:00:00 2001 From: Greg Lewis Date: Mon, 12 Aug 2019 04:05:58 +0000 Subject: Workaround for infinite recursion crash * FreeBSD crashes on infinite recursion rather than throwing a stack overflow because the stack address of the fault is in the page below the guard area. Workaround this by rounding down the fault address to the nearest page boundary. Investigation is still under way into what may be causing this but this appears to prevent it in simple test cases. PR: 222146 --- java/openjdk8/Makefile | 1 + .../patch-hotspot_src_os__cpu_bsd__x86_vm_os__bsd__x86.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 java/openjdk8/files/patch-hotspot_src_os__cpu_bsd__x86_vm_os__bsd__x86.cpp (limited to 'java') diff --git a/java/openjdk8/Makefile b/java/openjdk8/Makefile index 6421cbffb776..1c1e27d8bf56 100644 --- a/java/openjdk8/Makefile +++ b/java/openjdk8/Makefile @@ -2,6 +2,7 @@ PORTNAME= openjdk PORTVERSION= ${JDK_MAJOR_VERSION}.${JDK_UPDATE_VERSION}.${JDK_BUILD_NUMBER:S/^0//}.${BSD_JDK_VERSION} +PORTREVISION= 1 CATEGORIES= java devel MASTER_SITES= LOCAL/jkim:jtreg PKGNAMESUFFIX?= ${JDK_MAJOR_VERSION} diff --git a/java/openjdk8/files/patch-hotspot_src_os__cpu_bsd__x86_vm_os__bsd__x86.cpp b/java/openjdk8/files/patch-hotspot_src_os__cpu_bsd__x86_vm_os__bsd__x86.cpp new file mode 100644 index 000000000000..f90ed6a5ba19 --- /dev/null +++ b/java/openjdk8/files/patch-hotspot_src_os__cpu_bsd__x86_vm_os__bsd__x86.cpp @@ -0,0 +1,12 @@ +--- hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp.orig 2019-08-11 09:24:22.211149000 -0700 ++++ hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp 2019-08-11 09:25:08.826582000 -0700 +@@ -470,6 +470,9 @@ + // Handle ALL stack overflow variations here + if (sig == SIGSEGV || sig == SIGBUS) { + address addr = (address) info->si_addr; ++#ifdef __FreeBSD__ ++ addr = (unsigned char*) align_ptr_down(addr, os::vm_page_size()); ++#endif + + // check if fault address is within thread stack + if (addr < thread->stack_base() && -- cgit v1.2.3