Disable Junk malloc option for java. java mprotects portions of the thread

stack. When forking, the child process deallocates the threads stacks it
inheritated from the parent. The junk malloc option then attempts to write
to the deallocated memory and segfaults because its not all writable. The
child proc stays in a SIGSEGV loop when this happens.  okay ian@
This commit is contained in:
kurt 2006-01-02 03:48:40 +00:00
parent 06aed2f174
commit bf8f82ebbc
4 changed files with 48 additions and 6 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.8 2005/09/16 09:51:27 espie Exp $
# $OpenBSD: Makefile,v 1.9 2006/01/02 03:48:40 kurt Exp $
# $FreeBSD: /repoman/r/pcvs/ports/java/jdk14/Makefile,v 1.79 2004/08/18 07:06:03 glewis Exp $
ONLY_FOR_ARCHS= i386
@ -7,8 +7,8 @@ COMMENT= "Java2(TM) Standard Edition Dev Kit v${V}"
COMMENT-jre= "Java2(TM) Standard Edition Runtime Environment v${V}"
V= 1.4.2
DISTNAME= j2sdk-1_4_2
PKGNAME= jdk-${V}p3
PKGNAME-jre= jre-${V}p3
PKGNAME= jdk-${V}p4
PKGNAME-jre= jre-${V}p4
CATEGORIES= devel/jdk java

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-j2se_src_share_bin_java_c,v 1.1 2006/01/02 03:48:40 kurt Exp $
--- j2se/src/share/bin/java.c.orig Fri Dec 23 14:04:31 2005
+++ j2se/src/share/bin/java.c Fri Dec 23 14:26:32 2005
@@ -46,6 +46,17 @@
#include <jni.h>
#include "java.h"
+#ifdef __OpenBSD__
+/*
+ * Disable Junk malloc option. java mprotects portions of the thread
+ * stack. When forking, the child process deallocates the threads stacks
+ * it inheritated from the parent. The junk malloc option then attempts
+ * to write to the deallocated memory and segfaults because its not all
+ * writable. The child proc stays in a SIGSEGV loop when this happens.
+ */
+char *malloc_options = "j";
+#endif
+
#ifndef FULL_VERSION
#define FULL_VERSION "1.4"
#endif

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.9 2005/11/30 02:21:32 kurt Exp $
# $OpenBSD: Makefile,v 1.10 2006/01/02 03:48:40 kurt Exp $
ONLY_FOR_ARCHS= i386
@ -6,8 +6,8 @@ COMMENT= "Java2(TM) Standard Edition Dev Kit v${V}"
COMMENT-jre= "Java2(TM) Standard Edition Runtime Environment v${V}"
V= 1.5.0
DISTNAME= jdk-1_5_0
PKGNAME= jdk-${V}p5
PKGNAME-jre= jre-${V}p5
PKGNAME= jdk-${V}p6
PKGNAME-jre= jre-${V}p6
CATEGORIES= devel/jdk java

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-j2se_src_share_bin_java_c,v 1.1 2006/01/02 03:48:40 kurt Exp $
--- j2se/src/share/bin/java.c.orig Fri Dec 23 14:18:59 2005
+++ j2se/src/share/bin/java.c Fri Dec 23 14:26:09 2005
@@ -44,6 +44,17 @@
#include "manifest_info.h"
#include "version_comp.h"
+#ifdef __OpenBSD__
+/*
+ * Disable Junk malloc option. java mprotects portions of the thread
+ * stack. When forking, the child process deallocates the threads stacks
+ * it inheritated from the parent. The junk malloc option then attempts
+ * to write to the deallocated memory and segfaults because its not all
+ * writable. The child proc stays in a SIGSEGV loop when this happens.
+ */
+char *malloc_options = "j";
+#endif
+
#ifndef FULL_VERSION
#define FULL_VERSION JDK_MAJOR_VERSION "." JDK_MINOR_VERSION
#endif