Bug#699318: unblock: spamassassin/3.3.2-5
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock
Please unblock package spamassassin 3.3.2-5. It contains a single
change: The fix for the crash described in
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=694504
The relevant changelog entry follows, and the full debdiff is attached.
Thanks
noah
spamassassin (3.3.2-5) unstable; urgency=low
* Import upstream's fix for a crash in SIGCHLD handler (Closes: #694504)
-- Noah Meyerhans <noahm@debian.org> Mon, 28 Jan 2013 21:51:58 -0800
unblock spamassassin/3.3.2-5
-- System Information:
Debian Release: 7.0
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (x86_64)
Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nru spamassassin-3.3.2/debian/changelog spamassassin-3.3.2/debian/changelog
--- spamassassin-3.3.2/debian/changelog 2012-08-13 22:29:36.000000000 -0700
+++ spamassassin-3.3.2/debian/changelog 2013-01-28 21:52:22.000000000 -0800
@@ -1,3 +1,9 @@
+spamassassin (3.3.2-5) unstable; urgency=low
+
+ * Import upstream's fix for a crash in SIGCHLD handler (Closes: #694504)
+
+ -- Noah Meyerhans <noahm@debian.org> Mon, 28 Jan 2013 21:51:58 -0800
+
spamassassin (3.3.2-4) unstable; urgency=low
* Incorporate upstream's fix for a bug where malformed multipart MIME
diff -Nru spamassassin-3.3.2/debian/patches/95_bug694504-spamdforkscaling-crash spamassassin-3.3.2/debian/patches/95_bug694504-spamdforkscaling-crash
--- spamassassin-3.3.2/debian/patches/95_bug694504-spamdforkscaling-crash 1969-12-31 16:00:00.000000000 -0800
+++ spamassassin-3.3.2/debian/patches/95_bug694504-spamdforkscaling-crash 2013-01-22 20:28:45.000000000 -0800
@@ -0,0 +1,110 @@
+Index: spamassassin-3.3.2/lib/Mail/SpamAssassin/Logger/Syslog.pm
+===================================================================
+--- spamassassin-3.3.2.orig/lib/Mail/SpamAssassin/Logger/Syslog.pm 2013-01-22 20:19:12.000000000 -0800
++++ spamassassin-3.3.2/lib/Mail/SpamAssassin/Logger/Syslog.pm 2013-01-22 20:19:57.000000000 -0800
+@@ -148,17 +148,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)) {
+Index: spamassassin-3.3.2/spamd/spamd.raw
+===================================================================
+--- spamassassin-3.3.2.orig/spamd/spamd.raw 2013-01-22 20:19:12.000000000 -0800
++++ spamassassin-3.3.2/spamd/spamd.raw 2013-01-22 20:19:57.000000000 -0800
+@@ -588,6 +588,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'};
+@@ -1031,6 +1032,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++) {
+@@ -2517,7 +2520,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 (;;) {
+@@ -2528,12 +2532,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};
+@@ -2544,15 +2559,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 {
diff -Nru spamassassin-3.3.2/debian/patches/series spamassassin-3.3.2/debian/patches/series
--- spamassassin-3.3.2/debian/patches/series 2012-08-13 21:35:04.000000000 -0700
+++ spamassassin-3.3.2/debian/patches/series 2013-01-22 20:28:45.000000000 -0800
@@ -6,3 +6,4 @@
60_bug_684709
85_disable_SSLv2
90_pod_cleanup
+95_bug694504-spamdforkscaling-crash
Reply to: