From owner-freebsd-ports-bugs@FreeBSD.ORG Fri May 20 06:00:28 2005 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1003816A4CE for ; Fri, 20 May 2005 06:00:28 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 25A7B43DA1 for ; Fri, 20 May 2005 06:00:27 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j4K60PGj063941 for ; Fri, 20 May 2005 06:00:25 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j4K60PIP063936; Fri, 20 May 2005 06:00:25 GMT (envelope-from gnats) Resent-Date: Fri, 20 May 2005 06:00:25 GMT Resent-Message-Id: <200505200600.j4K60PIP063936@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, vd@datamax.bg Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EE83616A4D3 for ; Fri, 20 May 2005 06:00:17 +0000 (GMT) Received: from jengal.datamax.bg (jengal.datamax.bg [82.103.104.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 030C843DAA for ; Fri, 20 May 2005 06:00:17 +0000 (GMT) (envelope-from vd@datamax.bg) Received: from sinanica.bg.datamax (sinanica.bg.datamax [192.168.10.1]) by jengal.datamax.bg (Postfix) with QMQP id 1F17587F8 for ; Fri, 20 May 2005 09:00:16 +0300 (EEST) Received: (nullmailer pid 12354 invoked by uid 1004); Fri, 20 May 2005 06:00:16 -0000 Message-Id: <20050520060016.GA12225@sinanica.bg.datamax> Date: Fri, 20 May 2005 09:00:16 +0300 From: Vasil Dimov To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/81289: Options for ucontext/pthread/fork in security/stunnel (ucontext is broken) X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: vd@datamax.bg List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2005 06:00:28 -0000 >Number: 81289 >Category: ports >Synopsis: Options for ucontext/pthread/fork in security/stunnel (ucontext is broken) >Confidential: no >Severity: non-critical >Priority: high >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri May 20 06:00:24 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Vasil Dimov >Release: FreeBSD 5.4-STABLE i386 >Organization: DataMax >Environment: System: FreeBSD sinanica.bg.datamax 5.4-STABLE FreeBSD 5.4-STABLE #6: Tue May 10 12:46:25 EEST 2005 root@sinanica.bg.datamax:/usr/obj/usr/src/sys/SINANICA-SMP i386 >Description: There are known problems with stunnel's new threading model - ucontext(3), some of which were reported to ports@ and ports-bugs@ they include unexpected exits (without errors) and build faulures on sparc64. See ports@ mailing list, ports/81162 and http://pointyhat.freebsd.org/errorlogs/sparc64-errorlogs/e.5.2005042909/stunnel-4.10.log Following is a patch to the port that lets the user choose ucontext, pthread or fork model. It currently defaults to pthread. This should eliminate the problems as it seems that ucontext is broken, not 4.10. At first glance I saw that pthread code was not touched between 4.09-4.10 and it works fine for me with pthreading. >How-To-Repeat: >Fix: --- stunnel.diff begins here --- diff -urN stunnel.orig/Makefile stunnel/Makefile --- stunnel.orig/Makefile Fri May 13 02:23:55 2005 +++ stunnel/Makefile Fri May 20 08:34:08 2005 @@ -7,6 +7,7 @@ PORTNAME= stunnel PORTVERSION= 4.10 +PORTREVISION= 1 CATEGORIES= security MASTER_SITES= http://www.stunnel.org/download/stunnel/src/ \ ftp://stunnel.mirt.net/stunnel/OBSOLETE/ \ @@ -35,6 +36,22 @@ CONFIGURE_ARGS+= --enable-ipv6 .endif +.if defined(WITH_UCONTEXT) +EXTRA_PATCHES+= ${FILESDIR}/common.h-ucontext.patch +.elif defined(WITH_FORK) +EXTRA_PATCHES+= ${FILESDIR}/common.h-fork.patch +.else +EXTRA_PATCHES+= ${FILESDIR}/common.h-pthread.patch +.endif + +pre-everything:: + @${ECHO} + @${ECHO} "You can build ${PORTNAME} with the following options:" + @${ECHO} "WITH_UCONTEXT use ucontext(3) model. Currently has known problems" + @${ECHO} "WITH_FORK use fork(2) model" + @${ECHO} "default is to use pthread(3) model" + @${ECHO} + post-patch: # place files under /var/tmp so that this can be run by an unprivileged user # user stunnel and group stunnel @@ -83,7 +100,7 @@ .if ${OSVERSION} > 500000 .if !defined(WITH_STUNNEL_SSL_ENGINE) -EXTRA_PATCHES= ${FILESDIR}/ssl-noengine.patch +EXTRA_PATCHES+= ${FILESDIR}/ssl-noengine.patch pre-patch: @${ECHO} "*************************************************************************" @${ECHO} "Note: you have to explicitly define WITH_STUNNEL_SSL_ENGINE to activate" diff -urN stunnel.orig/files/common.h-fork.patch stunnel/files/common.h-fork.patch --- stunnel.orig/files/common.h-fork.patch Thu Jan 1 02:00:00 1970 +++ stunnel/files/common.h-fork.patch Mon May 16 19:53:09 2005 @@ -0,0 +1,21 @@ +--- src/common.h.orig Mon May 16 19:50:46 2005 ++++ src/common.h Mon May 16 19:53:05 2005 +@@ -38,18 +38,7 @@ + #endif + + /* threads model */ +-#if HAVE_UCONTEXT_H && HAVE_GETCONTEXT && HAVE_POLL +-#define USE_UCONTEXT +-#include +-#elif HAVE_PTHREAD_H && HAVE_LIBPTHREAD +-#define USE_PTHREAD +-#include +-#define THREADS +-#define _REENTRANT +-#define _THREAD_SAFE +-#else + #define USE_FORK +-#endif + + /* TCP wrapper */ + #if HAVE_TCPD_H && HAVE_LIBWRAP diff -urN stunnel.orig/files/common.h-pthread.patch stunnel/files/common.h-pthread.patch --- stunnel.orig/files/common.h-pthread.patch Thu Jan 1 02:00:00 1970 +++ stunnel/files/common.h-pthread.patch Mon May 16 19:52:51 2005 @@ -0,0 +1,21 @@ +--- src/common.h.orig Mon May 16 19:50:46 2005 ++++ src/common.h Mon May 16 19:52:45 2005 +@@ -38,18 +38,11 @@ + #endif + + /* threads model */ +-#if HAVE_UCONTEXT_H && HAVE_GETCONTEXT && HAVE_POLL +-#define USE_UCONTEXT +-#include +-#elif HAVE_PTHREAD_H && HAVE_LIBPTHREAD + #define USE_PTHREAD + #include + #define THREADS + #define _REENTRANT + #define _THREAD_SAFE +-#else +-#define USE_FORK +-#endif + + /* TCP wrapper */ + #if HAVE_TCPD_H && HAVE_LIBWRAP diff -urN stunnel.orig/files/common.h-ucontext.patch stunnel/files/common.h-ucontext.patch --- stunnel.orig/files/common.h-ucontext.patch Thu Jan 1 02:00:00 1970 +++ stunnel/files/common.h-ucontext.patch Mon May 16 19:52:19 2005 @@ -0,0 +1,21 @@ +--- src/common.h.orig Mon May 16 19:50:46 2005 ++++ src/common.h Mon May 16 19:51:49 2005 +@@ -38,18 +38,8 @@ + #endif + + /* threads model */ +-#if HAVE_UCONTEXT_H && HAVE_GETCONTEXT && HAVE_POLL + #define USE_UCONTEXT + #include +-#elif HAVE_PTHREAD_H && HAVE_LIBPTHREAD +-#define USE_PTHREAD +-#include +-#define THREADS +-#define _REENTRANT +-#define _THREAD_SAFE +-#else +-#define USE_FORK +-#endif + + /* TCP wrapper */ + #if HAVE_TCPD_H && HAVE_LIBWRAP --- stunnel.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: