1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-05 01:55:52 +00:00

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
This commit is contained in:
Greg Lewis 2019-08-12 04:05:58 +00:00
parent 2f2bf67c52
commit c1db705823
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=508703
2 changed files with 13 additions and 0 deletions

View File

@ -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}

View File

@ -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() &&