From nobody@FreeBSD.org  Mon Aug 12 19:56:22 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id 54A11E69
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 12 Aug 2013 19:56:22 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 414F1276C
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 12 Aug 2013 19:56:22 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r7CJuLrQ033501
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 12 Aug 2013 19:56:21 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r7CJuLs6033500;
	Mon, 12 Aug 2013 19:56:21 GMT
	(envelope-from nobody)
Message-Id: <201308121956.r7CJuLs6033500@oldred.freebsd.org>
Date: Mon, 12 Aug 2013 19:56:21 GMT
From: Igor Roshchin <spamd-pr@str.komkon.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: SpamAssassin 3.3.2 crashes with Perl 5.14.* - Bug fixed in 3.4
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         181242
>Category:       ports
>Synopsis:       mail/p5-Mail-SpamAssassin 3.3.2 crashes with Perl 5.14.* - Bug fixed in 3.4
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    beech
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 12 20:00:02 UTC 2013
>Closed-Date:    Tue Sep 03 15:08:57 UTC 2013
>Last-Modified:  Tue Sep 03 15:08:57 UTC 2013
>Originator:     Igor Roshchin
>Release:        various 5.4--9.0
>Organization:
Komkon
>Environment:
varied, from 5.4 to 9.0.
This is perl 5, version 14, subversion 4 (v5.14.4) built for i386-freebsd-64int
(downloaded/built from ports collection on July 10, 2013)
>Description:
Versions of SpamAssassin prior to 3.4 crash with Perl 5.14.*, or at least the most recent version in the ports collection (3.3.2 downloaded on July 10, 2013).

(I am not the only one who experienced it after the Perl upgrade, google it for many reports).

According to this bug 6745, this issue has been fixed in 3.4.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6745

A a few examples of the log messages
(from /var/log/maillog) of how SpamAssassin crashes:
/var/log/maillog.1.bz2:Aug  6 18:11:30 <mail.err> trantor spamd[78473]:
Out of memory during ridiculously large request at
/usr/local/lib/perl5/site_perl/5.14/Mail/SpamAssassin/Logger.pm line 239.
/var/log/maillog.3.bz2:Aug  4 20:35:09 <mail.err> trantor spamd[90636]:
Out of memory during ridiculously large request at
/usr/local/lib/perl5/site_perl/5.14/Mail/SpamAssassin/Logger.pm line 224.
/var/log/maillog.7.bz2:Jul 31 09:47:49 <mail.err> trantor spamd[13669]:
Out of memory during ridiculously large request at
/usr/local/lib/perl5/site_perl/5.14/Mail/SpamAssassin/Logger.pm line 239.

>How-To-Repeat:

Due to the large volume of e-mail messages I was not able to catch the offending message.

>Fix:
According to SpamAssassin Forum, ver. 3.4  fixes the problem.
I have not checked that myself.

I hope that either this fix can be applied to the current 3.3.* version in ports (preferred), or the new version can be ported.


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->beech 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Tue Aug 13 03:09:03 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=181242 

From: "Zverev Andrey" <azverev@ozon.ru>
To: <bug-followup@FreeBSD.org>,
	<spamd-pr@str.komkon.org>
Cc:  
Subject: Re: ports/181242: mail/p5-Mail-SpamAssassin 3.3.2 crashes with Perl 5.14.* - Bug fixed in 3.4
Date: Tue, 20 Aug 2013 14:35:31 +0400

 Hello,
 
 Can you to try this patch:
 http://az.semmy.ru/sa/patch-bug6745 (same patch as in upstream fix) and
 put in under ports/mail/p5-Mail-SpamAssassin/files
 And after rebuild port to apply patch and confirm what patch helps.

From: Igor Roshchin <spamd-pr@str.komkon.org>
To: Zverev Andrey <azverev@ozon.ru>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/181242: mail/p5-Mail-SpamAssassin 3.3.2 crashes with Perl
 5.14.* - Bug fixed in 3.4
Date: Tue, 20 Aug 2013 13:22:08 -0400 (EDT)

 Hello, Andrey!
 
 Thank you, I applied your patch to the port, and installed the newly 
 compiled port. 
 However, the crash events are not frequent, and I cannot catch the 
 offending message(s) (see below).
 
 I will try to report in 1-2 week if I don't see anything in the 
 logs, or earlier, if I notice something.
 
 
 > bzfgrep "Out of memory during ridiculously large request" 
 /var/log/maillog.*
 /var/log/maillog.10.bz2:Aug  9 10:16:06 <mail.err> trantor spamd[42882]: 
 Out of memory during ridiculously large request at 
 /usr/local/lib/perl5/site_perl/5.14/Mail/SpamAssassin/Logger.pm line 224.
 /var/log/maillog.10.bz2:Aug  9 15:47:14 <mail.err> trantor spamd[47875]: 
 Out of memory during ridiculously large request at 
 /usr/local/lib/perl5/site_perl/5.14/Mail/SpamAssassin/Logger.pm line 224.
 /var/log/maillog.11.bz2:Aug  8 14:03:27 <mail.err> trantor spamd[23541]: 
 Out of memory during ridiculously large request at 
 /usr/local/lib/perl5/site_perl/5.14/Mail/SpamAssassin/Logger.pm line 224.
 /var/log/maillog.13.bz2:Aug  6 18:11:30 <mail.err> trantor spamd[78473]: 
 Out of memory during ridiculously large request at 
 /usr/local/lib/perl5/site_perl/5.14/Mail/SpamAssassin/Logger.pm line 239.
 /var/log/maillog.15.bz2:Aug  4 20:35:09 <mail.err> trantor spamd[90636]: 
 Out of memory during ridiculously large request at 
 /usr/local/lib/perl5/site_perl/5.14/Mail/SpamAssassin/Logger.pm line 224.
 /var/log/maillog.19.bz2:Jul 31 09:47:49 <mail.err> trantor spamd[13669]: 
 Out of memory during ridiculously large request at 
 /usr/local/lib/perl5/site_perl/5.14/Mail/SpamAssassin/Logger.pm line 239.
 /var/log/maillog.6.bz2:Aug 13 03:14:37 <mail.err> trantor spamd[20789]: 
 Out of memory during ridiculously large request at 
 /usr/local/lib/perl5/site_perl/5.14/Mail/SpamAssassin/Logger.pm line 224.
 
 
 
 On Tue, 20 Aug 2013, Zverev Andrey wrote:
 
 > Hello,
 >
 > Can you to try this patch:
 > http://az.semmy.ru/sa/patch-bug6745 (same patch as in upstream fix) and
 > put in under ports/mail/p5-Mail-SpamAssassin/files
 > And after rebuild port to apply patch and confirm what patch helps.
 >

From: "Zverev Andrey" <azverev@ozon.ru>
To: <bug-followup@FreeBSD.org>,
	<spamd-pr@str.komkon.org>
Cc:  
Subject: Re: ports/181242: mail/p5-Mail-SpamAssassin 3.3.2 crashes with Perl 5.14.* - Bug fixed in 3.4
Date: Mon, 26 Aug 2013 13:35:10 +0400

 Igor, any news?

From: Igor Roshchin <spamd-pr@str.komkon.org>
To: Zverev Andrey <azverev@ozon.ru>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/181242: mail/p5-Mail-SpamAssassin 3.3.2 crashes with Perl
 5.14.* - Bug fixed in 3.4
Date: Mon, 26 Aug 2013 13:22:01 -0400 (EDT)

 Andrey,
 
 It's been close to 6 days since I applied the patch.
 So far, I see no crashes.
 
 However, that might not be representative: As you can 
 see in the log excerpt, in my previous response, during 7 days between 
 Aug 13 and Aug 20, before I applied your patch, there were no crashes.
 
 I will let you know if it crashes.
 (I understand that there is a desire to include this patch in time for 
 9.2-RELEASE.)
 

From: "Zverev Andrey" <azverev@ozon.ru>
To: "Igor Roshchin" <spamd-pr@str.komkon.org>
Cc: <bug-followup@FreeBSD.org>
Subject: RE: ports/181242: mail/p5-Mail-SpamAssassin 3.3.2 crashes with Perl 5.14.* - Bug fixed in 3.4
Date: Mon, 26 Aug 2013 21:26:39 +0400

 No rush and It's already late for 9.2.
 
 
 -----Original Message-----
 From: Igor Roshchin [mailto:spamd-pr@str.komkon.org]=20
 Sent: Monday, August 26, 2013 9:22 PM
 To: Zverev Andrey
 Cc: bug-followup@FreeBSD.org
 Subject: Re: ports/181242: mail/p5-Mail-SpamAssassin 3.3.2 crashes with
 Perl 5.14.* - Bug fixed in 3.4
 
 
 Andrey,
 
 It's been close to 6 days since I applied the patch.
 So far, I see no crashes.
 
 However, that might not be representative: As you can see in the log
 excerpt, in my previous response, during 7 days between Aug 13 and Aug
 20, before I applied your patch, there were no crashes.
 
 I will let you know if it crashes.
 (I understand that there is a desire to include this patch in time for
 9.2-RELEASE.)
 

From: Igor Roshchin <spamd-pr@str.komkon.org>
To: Cc: Zverev Andrey <azverev@ozon.ru>, bug-followup@FreeBSD.org
Subject: Re: ports/181242: mail/p5-Mail-SpamAssassin 3.3.2 crashes with Perl
 5.14.* - Bug fixed in 3.4
Date: Mon, 2 Sep 2013 13:26:43 -0400 (EDT)

 Within about 12 days since installing the patch, I do not see any crashes 
 of the spamd on my system.
 So, since this patch ia based on the one created for the upstream source, 
 and people there had no problems, I think it solves the problem and it is 
 good to go into the ports tree.
 
 Thank you, Andrey!
 
 Igor
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/181242: commit references a PR
Date: Mon,  2 Sep 2013 19:00:32 +0000 (UTC)

 Author: az
 Date: Mon Sep  2 19:00:24 2013
 New Revision: 326056
 URL: http://svnweb.freebsd.org/changeset/ports/326056
 
 Log:
   - Fix issue when spamd crashes because of memory problems in Logger.pm
     For more details see Bug 6745
   - Do not bump portrevision since issue not global
   While I'm here:
   - convert to the new perl5 framework
   
   PR:		ports/181242
   Submitted by:	Igor Roshchin <spamd-pr@str.komkon.org>
   Tested by:	Igor Roshchin <spamd-pr@str.komkon.org>	(two weeks)
   Approved by:	maintainer (timeout)
 
 Added:
   head/mail/p5-Mail-SpamAssassin/files/patch-bug6745   (contents, props changed)
 Modified:
   head/mail/p5-Mail-SpamAssassin/Makefile
 
 Modified: head/mail/p5-Mail-SpamAssassin/Makefile
 ==============================================================================
 --- head/mail/p5-Mail-SpamAssassin/Makefile	Mon Sep  2 18:52:48 2013	(r326055)
 +++ head/mail/p5-Mail-SpamAssassin/Makefile	Mon Sep  2 19:00:24 2013	(r326056)
 @@ -25,7 +25,8 @@ RUN_DEPENDS:=	${BUILD_DEPENDS}
  
  CONFLICTS?=	ja-p5-Mail-SpamAssassin-[0-9]* p5-Mail-SpamAssassin-devel-[0-9]* p5-Mail-SpamAssassin-Alt-[0-9]*
  
 -PERL_CONFIGURE=	5.12+
 +USES=		perl5
 +USE_PERL5=	configure
  USE_LDCONFIG=	yes
  DBDIR?=		/var/db
  ETCDIR?=	${PREFIX}/etc/mail/spamassassin
 
 Added: head/mail/p5-Mail-SpamAssassin/files/patch-bug6745
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/mail/p5-Mail-SpamAssassin/files/patch-bug6745	Mon Sep  2 19:00:24 2013	(r326056)
 @@ -0,0 +1,106 @@
 +--- lib/Mail/SpamAssassin/Logger/Syslog.pm	2012/05/14 16:28:23	1338277
 ++++ lib/Mail/SpamAssassin/Logger/Syslog.pm	2012/05/14 16:31:09	1338278
 +@@ -167,17 +167,21 @@
 +   }
 +   $msg = $timestamp . ' ' . $msg  if $timestamp ne '';
 + 
 +-  # important: do not call syslog() from the SIGCHLD handler
 +-  # child_handler().   otherwise we can get into a loop if syslog()
 +-  # forks a process -- as it does in syslog-ng apparently! (bug 3625)
 +-  $Mail::SpamAssassin::Logger::LOG_SA{INHIBIT_LOGGING_IN_SIGCHLD_HANDLER} = 1;
 ++# no longer needed since a patch to bug 6745:
 ++# # important: do not call syslog() from the SIGCHLD handler
 ++# # child_handler().   otherwise we can get into a loop if syslog()
 ++# # forks a process -- as it does in syslog-ng apparently! (bug 3625)
 ++# $Mail::SpamAssassin::Logger::LOG_SA{INHIBIT_LOGGING_IN_SIGCHLD_HANDLER} = 1;
 ++
 +   my $eval_stat;
 +   eval {
 +     syslog($level, "%s", $msg); 1;
 +   } or do {
 +     $eval_stat = $@ ne '' ? $@ : "errno=$!";  chomp $eval_stat;
 +   };
 +-  $Mail::SpamAssassin::Logger::LOG_SA{INHIBIT_LOGGING_IN_SIGCHLD_HANDLER} = 0;
 ++
 ++# no longer needed since a patch to bug 6745:
 ++# $Mail::SpamAssassin::Logger::LOG_SA{INHIBIT_LOGGING_IN_SIGCHLD_HANDLER} = 0;
 + 
 +   if (defined $eval_stat) {
 +     if ($self->check_syslog_sigpipe($msg)) {
 +--- spamd/spamd.raw	2012/05/14 16:28:23	1338277
 ++++ spamd/spamd.raw	2012/05/14 16:31:09	1338278
 +@@ -589,6 +589,7 @@
 + my $timeout_child;        # processing timeout (headers->finish), 0=no timeout
 + my $clients_per_child;    # number of clients each child should process
 + my %children;             # current children
 ++my @children_exited;
 + 
 + if ( defined $opt{'max-children'} ) {
 +   $childlimit = $opt{'max-children'};
 +@@ -1033,6 +1034,8 @@
 + # child_handler()  if !$scaling || am_running_on_windows();
 +   child_handler();  # it doesn't hurt to call child_handler unconditionally
 + 
 ++  child_cleaner();
 ++
 +   do_sighup_restart()  if defined $got_sighup;
 + 
 +   for (my $i = keys %children; $i < $childlimit; $i++) {
 +@@ -2523,7 +2526,8 @@
 +   my ($sig) = @_;
 + 
 +   # do NOT call syslog here unless the child's pid is in our list of known
 +-  # children.  This is due to syslog-ng brokenness -- bugs 3625, 4237.
 ++  # children.  This is due to syslog-ng brokenness -- bugs 3625, 4237;
 ++  # see also bug 6745.
 + 
 +   # clean up any children which have exited
 +   for (;;) {
 +@@ -2534,12 +2538,23 @@
 +     #
 +     my $pid = waitpid(-1, WNOHANG);
 +     last if !$pid || $pid == -1;
 +-    my $child_stat = $?;
 ++    push(@children_exited, [$pid, $?, $sig, time]);
 ++  }
 + 
 +-    if (!defined $children{$pid}) {
 +-      # ignore this child; we didn't realise we'd forked it. bug 4237
 +-      next;
 +-    }
 ++  $SIG{CHLD} = \&child_handler;    # reset as necessary, should be at end
 ++}
 ++
 ++# takes care of dead children, as noted by a child_handler()
 ++# called in a main program flow (not from a signal handler)
 ++#
 ++sub child_cleaner {
 ++  while (@children_exited) {
 ++    my $tuple = shift(@children_exited);
 ++    next if !$tuple;  # just in case
 ++    my($pid, $child_stat, $sig, $timestamp) = @$tuple;
 ++
 ++    # ignore this child if we didn't realise we'd forked it. bug 4237
 ++    next if !defined $children{$pid};
 + 
 +     # remove them from our child listing
 +     delete $children{$pid};
 +@@ -2550,15 +2565,10 @@
 +       my $sock = $backchannel->get_socket_for_child($pid);
 +       if ($sock) { $sock->close(); }
 +     }
 +-
 +-    unless ($Mail::SpamAssassin::Logger::LOG_SA{INHIBIT_LOGGING_IN_SIGCHLD_HANDLER}) {
 +-      info("spamd: handled cleanup of child pid [%s]%s: %s",
 +-           $pid, (defined $sig ? " due to SIG$sig" : ""),
 +-           exit_status_str($child_stat,0));
 +-    }
 ++    info("spamd: handled cleanup of child pid [%s]%s: %s",
 ++         $pid, (defined $sig ? " due to SIG$sig" : ""),
 ++         exit_status_str($child_stat,0));
 +   }
 +-
 +-  $SIG{CHLD} = \&child_handler;    # reset as necessary, should be at end
 + }
 + 
 + sub restart_handler {
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: az 
State-Changed-When: Tue Sep 3 15:08:56 UTC 2013 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=181242 
>Unformatted:
