From nobody@FreeBSD.org  Tue Jul 24 19:04:05 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id DF17137B407
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 24 Jul 2001 19:04:04 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.4/8.11.4) id f6P244J36320;
	Tue, 24 Jul 2001 19:04:04 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200107250204.f6P244J36320@freefall.freebsd.org>
Date: Tue, 24 Jul 2001 19:04:04 -0700 (PDT)
From: John Merryweather Cooper <jmcoopr@webmail.bmi.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Kill Balsa-1.1.7 zombie procmail processes bug
X-Send-Pr-Version: www-1.0

>Number:         29208
>Category:       ports
>Synopsis:       Kill Balsa-1.1.7 zombie procmail processes bug
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnome
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 24 19:10:01 PDT 2001
>Closed-Date:    Thu Aug 9 10:43:03 PDT 2001
>Last-Modified:  Thu Aug 09 10:43:35 PDT 2001
>Originator:     John Merryweather Cooper
>Release:        FreeBSD 4.3-STABLE
>Organization:
>Environment:
System: FreeBSD johncoop.MSHOME 4.3-STABLE FreeBSD 4.3-STABLE #33: Mon Jul
23 00:49:58 PDT 2001 jmcoopr@johncoop.MSHOME:/usr/obj/usr/src/sys/JOHNCOOP
i386

>Description:
Balsa 1.1.7, when used with procmail as a mailbox filter, generates
large numbers of "zombie" procmail processes.  Eventually, the
number becomes large enough to seriously affect system performance.

The Fix below has a diff -ruN that does the following:

1) cleans up build (and hopefully makes things more robust)
2) for those with libcipher, gets rid of minor warnings about
setkey(), des_cipher(), etc. (but with no added functionality)
3) patches libbalsa/pop3.c to use pclose() instead of fclose()

As I can see the libcipher stuff causing problems, it can safely
be expunged.  (Just remove the patch-src::Makefile.am file and the associated RESTRICTED garbage from the main Makefile).

>How-To-Repeat:
N/A
>Fix:
diff -ruN balsa/Makefile balsa.new/Makefile
--- balsa/Makefile	Fri Jul 20 08:04:16 2001
+++ balsa.new/Makefile	Fri Jul 20 15:17:07 2001
@@ -2,11 +2,12 @@
 # Date created:				02 December 1998
 # Whom:					Glenn Johnson <gljohns@bellsouth.net>
 #
-# $FreeBSD: ports/mail/balsa/Makefile,v 1.47 2001/07/20 12:09:05 sobomax Exp $
+# $FreeBSD: ports/mail/balsa/Makefile,v 1.46 2001/06/19 09:42:54 ade Exp $
 #
 
 PORTNAME=	balsa
 PORTVERSION=	1.1.7
+PORTREVISION=	1
 CATEGORIES=	mail gnome
 MASTER_SITES=	http://www.theochem.kth.se/~pawsa/balsa/ \
 		ftp://ftp.newton.cx/pub/balsa/
@@ -16,25 +17,19 @@
 LIB_DEPENDS=	esmtp.5:${PORTSDIR}/mail/libesmtp
 
 USE_X_PREFIX=	yes
+USE_GMAKE=	yes
 USE_GNOME=	yes
 USE_LIBTOOL=	yes
-LIBTOOLFILES=	libmutt/configure
+USE_AUTOMAKE=	yes
+USE_OPENSSL=	yes
+RESTRICTED=	"Now uses US-only libcipher"
+LIBTOOLFILES=	configure libmutt/configure
 CONFIGURE_ARGS=	--enable-threads \
 		--enable-gtkhtml \
-		--disable-more-warnings
+		--disable-more-warnings \
+		--with-ssl
 CONFIGURE_ENV=	CPPFLAGS="-I${LOCALBASE}/include" \
-		LIBS="-L${LOCALBASE}/lib -lgiconv"
-
+		LIBS="-L${LOCALBASE}/lib"
 MAN1=		balsa.1
-
-pre-patch:
-	@${PERL} -pi -e 's|-lpthread|${PTHREAD_LIBS}|g ; \
-		 s|DATADIRNAME=lib|DATADIRNAME=share|g ; \
-		 s|-liconv|-lgiconv|g ; s|iconv_open|libiconv_open|g' \
-			${WRKSRC}/configure
-	@find ${WRKSRC} -name "Makefile.in" | xargs ${PERL} -pi -e \
-		's|\$\(datadir\)/gnome/|\$\(datadir\)/|g ; \
-		 s|\$\(datadir\)/locale|\$\(prefix\)/share/locale|g ; \
-		 s|\$\(gnomedatadir\)/gnome|\$\(gnomedatadir\)|g'
 
 .include <bsd.port.mk>
diff -ruN balsa/files/patch-Makefile.am balsa.new/files/patch-Makefile.am
--- balsa/files/patch-Makefile.am	Wed Dec 31 16:00:00 1969
+++ balsa.new/files/patch-Makefile.am	Wed Jul 18 15:08:22 2001
@@ -0,0 +1,11 @@
+--- Makefile.am	Fri Oct  6 12:19:22 2000
++++ Makefile.am.new	Wed Jul 18 15:07:44 2001
+@@ -5,7 +5,7 @@
+ pixmapdir = $(gnomedatadir)/pixmaps
+ pixmap_DATA = gnome-balsa2.png
+ 
+-desktopdir = $(gnomedatadir)/gnome/apps/Internet
++desktopdir = $(gnomedatadir)/apps/Internet
+ desktop_DATA = balsa.desktop
+ 
+ EXTRA_DIST = \
diff -ruN balsa/files/patch-aa balsa.new/files/patch-aa
--- balsa/files/patch-aa	Wed Feb  7 04:30:13 2001
+++ balsa.new/files/patch-aa	Wed Dec 31 16:00:00 1969
@@ -1,14 +0,0 @@
-
-$FreeBSD: ports/mail/balsa/files/patch-aa,v 1.2 2001/02/07 12:30:13 sobomax Exp $
-
---- src/Makefile.in.orig	Wed Feb  7 13:35:25 2001
-+++ src/Makefile.in	Wed Feb  7 13:36:25 2001
-@@ -152,7 +152,7 @@
- 
- CFLAGS = @CFLAGS@ $(GTKHTML_CFLAGS) $(PIXBUF_FLAGS)
- 
--balsa_LDADD =  	$(top_builddir)/libbalsa/libbalsa.a		$(top_builddir)/libmutt/imap/libimap.a		$(top_builddir)/libmutt/libmutt.a		$(top_builddir)/libinit_balsa/libinit_balsa.a 	-lpspell 	-lltdl 	@LIBESD_LIB@ 	$(GNOME_LIBDIR) 	$(GNOMEUI_LIBS) 	$(INTLLIBS) 	$(PTHREAD_LIB) 	$(GNOME_PRINT_LIBS) 	$(GTKHTML_LIBS)		$(PIXBUF_LIBS)
-+balsa_LDADD =  	$(top_builddir)/libbalsa/libbalsa.a		$(top_builddir)/libmutt/imap/libimap.a		$(top_builddir)/libmutt/libmutt.a		$(top_builddir)/libinit_balsa/libinit_balsa.a 	-lpspell 	@LIBESD_LIB@ 	$(GNOME_LIBDIR) 	$(GNOMEUI_LIBS) 	$(INTLLIBS) 	$(PTHREAD_LIB) 	$(GNOME_PRINT_LIBS) 	$(GTKHTML_LIBS)		$(PIXBUF_LIBS)
- 
- 
- balsa_DEPENDENCIES =  	$(top_builddir)/libbalsa/libbalsa.a		$(top_builddir)/libmutt/libmutt.a	        $(top_builddir)/libmutt/imap/libimap.a		$(top_builddir)/libmutt/libmutt.a		$(top_builddir)/libinit_balsa/libinit_balsa.a
diff -ruN balsa/files/patch-ab balsa.new/files/patch-ab
--- balsa/files/patch-ab	Tue Sep 19 00:57:34 2000
+++ balsa.new/files/patch-ab	Wed Dec 31 16:00:00 1969
@@ -1,13 +0,0 @@
---- configure	2000/09/19 07:22:11	1.1
-+++ configure	2000/09/19 07:29:28
-@@ -3480,8 +3480,8 @@
- fi
- 
- 
--LDFLAGS="$balsa_save_LDFLAGS"
--LIBS="$balsa_save_LIBS"
-+#LDFLAGS="$balsa_save_LDFLAGS"
-+#LIBS="$balsa_save_LIBS"
- 
- for ac_hdr in libgnomeui/gnome-window-icon.h
- do
diff -ruN balsa/files/patch-configure.in balsa.new/files/patch-configure.in
--- balsa/files/patch-configure.in	Wed Dec 31 16:00:00 1969
+++ balsa.new/files/patch-configure.in	Wed Jul 18 15:02:53 2001
@@ -0,0 +1,19 @@
+--- configure.in	Fri Jul 13 02:09:44 2001
++++ configure.in.new	Wed Jul 18 15:02:00 2001
+@@ -458,12 +458,12 @@
+ 	AC_MSG_RESULT([no])
+ fi
+ dnl #############################################################
+-dnl Link with iconv for charset translation, if not found
++dnl Link with giconv for charset translation, if not found
+ dnl without library.  Needed for libmutt.
+ dnl #############################################################
+-AC_CHECK_LIB(iconv, iconv_open, , [
+-	AC_CHECK_FUNC(iconv_open, , [
+-			AC_MSG_ERROR([*** You need iconv for libmutt.])
++AC_CHECK_LIB(giconv, libiconv_open, , [
++	AC_CHECK_FUNC(libiconv_open, , [
++			AC_MSG_ERROR([*** You need giconv for libmutt.])
+ 			])
+ 	])
+ 
diff -ruN balsa/files/patch-libbalsa::pop3.c balsa.new/files/patch-libbalsa::pop3.c
--- balsa/files/patch-libbalsa::pop3.c	Wed Dec 31 16:00:00 1969
+++ balsa.new/files/patch-libbalsa::pop3.c	Tue Jul 24 17:41:20 2001
@@ -0,0 +1,11 @@
+--- libbalsa/pop3.c	Fri Jul 13 01:45:04 2001
++++ libbalsa/pop3.c.new	Tue Jul 24 17:40:42 2001
+@@ -507,7 +507,7 @@
+ 	
+ 	err = fetch_single_msg(s, msg, i, first_msg, msgs, &num_bytes, 
+ 			       tot_bytes, prog_cb);
+-	if (fclose (msg) != 0 && err == POP_OK) err = POP_PROCMAIL_ERR;
++	if (pclose (msg) != 0 && err == POP_OK) err = POP_PROCMAIL_ERR;
+ 	
+ 	if (err != POP_OK)  break; /* the 'for' loop */
+ 	if (delete_on_server) delete_msg(s, i); /* ignore errors */
diff -ruN balsa/files/patch-src::Makefile.am balsa.new/files/patch-src::Makefile.am
--- balsa/files/patch-src::Makefile.am	Wed Dec 31 16:00:00 1969
+++ balsa.new/files/patch-src::Makefile.am	Fri Jul 20 15:14:55 2001
@@ -0,0 +1,19 @@
+--- src/Makefile.am	Thu Jul 12 00:08:46 2001
++++ src/Makefile.am.new	Fri Jul 20 15:14:11 2001
+@@ -61,7 +61,7 @@
+ balsa_SOURCES = $(balsa_BASE_SOURCES) $(balsa_IDL_SOURCES)
+ 
+ INCLUDES = \
+-	-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
++	-DGNOMELOCALEDIR=\""$(prefix)/share/locale"\" \
+ 	-I$(top_srcdir) \
+ 	-I$(top_srcdir)/libbalsa \
+ 	-I$(top_srcdir)/libmutt \
+@@ -76,6 +76,7 @@
+ 	$(top_builddir)/libinit_balsa/libinit_balsa.a \
+ 	-lpspell \
+ 	-lltdl \
++	-lcipher \
+ 	@LIBESD_LIB@ \
+ 	$(GNOME_LIBDIR) \
+ 	$(GNOMEUI_LIBS) \

>Release-Note:
>Audit-Trail:

From: "John Merryweather Cooper" <jmcoopr@webmail.bmi.net>
To: <freebsd-gnats-submit@FreeBSD.org>, <jmcoopr@webmail.bmi.net>
Cc:  
Subject: Re: ports/29208: Kill Balsa-1.1.7 zombie procmail processes bug
Date: Mon, 6 Aug 2001 11:30:12 -0700

 Without the pop3.c patch (at a minimum), Balsa will crash--when using
 procmail--because all system resources will be inevitably committed to
 zombie procmail threads.  Some please commit.
 
 jmc
 

From: "John Merryweather Cooper" <jmcoopr@webmail.bmi.net>
To: <freebsd-gnats-submit@FreeBSD.org>, <jmcoopr@webmail.bmi.net>
Cc:  
Subject: Re: ports/29208: Kill Balsa-1.1.7 zombie procmail processes bug
Date: Mon, 6 Aug 2001 11:32:14 -0700

 See PR ports/29261 for an improved version of patches.  As I note, the
 libcipher junk can be canned (it adds no functionality--just gets rid of
 some warning messages during linking).  Could some take a look at this?
 
 jmc
 
Responsible-Changed-From-To: freebsd-ports->gnome 
Responsible-Changed-By: lioux 
Responsible-Changed-When: Thu Aug 9 10:22:54 PDT 2001 
Responsible-Changed-Why:  
Over to maintainer 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=29208 
State-Changed-From-To: open->closed 
State-Changed-By: lioux 
State-Changed-When: Thu Aug 9 10:43:03 PDT 2001 
State-Changed-Why:  
Superseded by 29261. Close requested by submitter 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=29208 
>Unformatted:
