Your message dated Wed, 25 May 2005 14:32:02 -0400
with message-id <[EMAIL PROTECTED]>
and subject line Bug#301511: fixed in sysklogd 1.4.1-17
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 26 Mar 2005 12:53:14 +0000
>From [EMAIL PROTECTED] Sat Mar 26 04:53:13 2005
Return-path: <[EMAIL PROTECTED]>
Received: from zahadum.xs4all.nl [194.109.0.112] 
        by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
        id 1DFAmu-0006eU-00; Sat, 26 Mar 2005 04:53:12 -0800
Received: from mikevs by zahadum.xs4all.nl with local (Exim 4.34 #1 (Debian))
        id 1DFAms-0001tG-Lm
        for <[EMAIL PROTECTED]>; Sat, 26 Mar 2005 13:53:10 +0100
Date: Sat, 26 Mar 2005 13:53:10 +0100
From: Miquel van Smoorenburg <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: sysklogd: hangs the whole system
Message-ID: <[EMAIL PROTECTED]>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="wac7ysb48OaltWcw"
Content-Disposition: inline
X-NCC-RegID: nl.xs4all
User-Agent: Mutt/1.5.6+20040907i
Sender: Miquel van Smoorenburg <[EMAIL PROTECTED]>
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
        autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 


--wac7ysb48OaltWcw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Package: sysklogd
Version: 1.4.1-16
Severity: grave
Justification: breaks the whole system

References:
  http://lkml.org/lkml/2005/3/26/37
  https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=103392
  http://lkml.org/lkml/2004/12/21/208
  http://lkml.org/lkml/2004/11/2/17

Syslogd can hang if domark() is called while the main loop is just
calling in the ctime() libc function. ctime() is not reentrant
and will make syslogd hang (with recent glibc and 2.6 kernels,
because glibc uses __libc_lock which uses a [fm]utex).

Because AF_UNIX SOCK_DGRAM sockets are blocking by default under
Linux, after a short while everything on the system that calls
syslog() will hang as well. Which means you can't login anymore,
and almost all other network services hang as well.
Also cron will fork every now and again and call syslog() so the
whole process table will fill up. The system is fubared.

The original syslogd protects itself from this by blocking SIGHUP
and SIGALRM in logmsg(), but that is under #ifndef SYSV.

The attached patch fixes this by adding POSIX sigprocmask calls
in logmsg(), as that is the simplest fix.

Non-bug related comments:

A better fix would be to just set a flag in domark() and check that
flag every so often in the mainloop and do the MARKing there.

Someone should take out all the #ifdef/#ifndef SYSV stuff and
replace it with POSIX routines so that this syslogd compiles
under all modern OSes. I think that it doesn't even compile
without #define SYSV anymore, anyway.

Mike.

--wac7ysb48OaltWcw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="syslogd.fix"

--- sysklogd-1.4.1/syslogd.c.ORIG       2005-03-25 22:04:07.360493000 +0100
+++ sysklogd-1.4.1/syslogd.c    2005-03-26 13:28:17.650819246 +0100
@@ -1558,11 +1558,21 @@
        int fac, prilev, lognum;
        int msglen;
        char *timestamp;
+#ifdef linux
+       sigset_t mask, omask;
+#endif
 
        dprintf("logmsg: %s, flags %x, from %s, msg %s\n", textpri(pri), flags, 
from, msg);
 
-#ifndef SYSV
+#ifdef linux /* POSIX, really. */
+       sigemptyset(&mask);
+       sigaddset(&mask, SIGHUP);
+       sigaddset(&mask, SIGALRM);
+       sigprocmask(SIG_BLOCK, &mask, &omask);
+#else
+#  ifndef SYSV
        omask = sigblock(sigmask(SIGHUP)|sigmask(SIGALRM));
+#  endif
 #endif
 
        /*
@@ -1603,8 +1613,12 @@
                        (void) close(f->f_file);
                        f->f_file = -1;
                }
-#ifndef SYSV
+#ifdef linux
+               sigprocmask(SIG_SETMASK, &omask, NULL);
+#else
+#  ifndef SYSV
                (void) sigsetmask(omask);
+#  endif
 #endif
                return;
        }
@@ -1668,8 +1682,12 @@
                        }
                }
        }
-#ifndef SYSV
+#ifdef linux
+       sigprocmask(SIG_SETMASK, &omask, NULL);
+#else
+#  ifndef SYSV
        (void) sigsetmask(omask);
+#  endif
 #endif
 }
 #if FALSE

--wac7ysb48OaltWcw--

---------------------------------------
Received: (at 301511-close) by bugs.debian.org; 25 May 2005 18:39:41 +0000
>From [EMAIL PROTECTED] Wed May 25 11:39:40 2005
Return-path: <[EMAIL PROTECTED]>
Received: from newraff.debian.org [208.185.25.31] (mail)
        by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
        id 1Db0n6-0005P8-00; Wed, 25 May 2005 11:39:40 -0700
Received: from katie by newraff.debian.org with local (Exim 3.35 1 (Debian))
        id 1Db0fi-00005p-00; Wed, 25 May 2005 14:32:02 -0400
From: Martin Schulze <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
X-Katie: $Revision: 1.55 $
Subject: Bug#301511: fixed in sysklogd 1.4.1-17
Message-Id: <[EMAIL PROTECTED]>
Sender: Archive Administrator <[EMAIL PROTECTED]>
Date: Wed, 25 May 2005 14:32:02 -0400
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
        autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 

Source: sysklogd
Source-Version: 1.4.1-17

We believe that the bug you reported is fixed in the latest version of
sysklogd, which is due to be installed in the Debian FTP archive:

klogd_1.4.1-17_i386.deb
  to pool/main/s/sysklogd/klogd_1.4.1-17_i386.deb
sysklogd_1.4.1-17.diff.gz
  to pool/main/s/sysklogd/sysklogd_1.4.1-17.diff.gz
sysklogd_1.4.1-17.dsc
  to pool/main/s/sysklogd/sysklogd_1.4.1-17.dsc
sysklogd_1.4.1-17_i386.deb
  to pool/main/s/sysklogd/sysklogd_1.4.1-17_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Martin Schulze <[EMAIL PROTECTED]> (supplier of updated sysklogd package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Wed, 25 May 2005 20:10:31 +0200
Source: sysklogd
Binary: sysklogd klogd
Architecture: source i386
Version: 1.4.1-17
Distribution: unstable
Urgency: high
Maintainer: Martin Schulze <[EMAIL PROTECTED]>
Changed-By: Martin Schulze <[EMAIL PROTECTED]>
Description: 
 klogd      - Kernel Logging Daemon
 sysklogd   - System Logging Daemon
Closes: 301511
Changes: 
 sysklogd (1.4.1-17) unstable; urgency=high
 .
   * Use $(getconf LFS_CFLAGS) for large file support
   * Applied adjusted patch by Miquel van Smoorenburg to fix spurious
     hanging syslogd in connection with futex and NPTL introduced in recent
     glibc versions and Linux 2.6 (closes: Bug#301511)
Files: 
 e4d7b5bfb49f5d23b948e01dbdbfb0b6 539 base important sysklogd_1.4.1-17.dsc
 107c62e3bf41626b89050f01c5b347cb 25031 base important sysklogd_1.4.1-17.diff.gz
 ff91acac687d6a3e156af566059c0ac0 56866 base important 
sysklogd_1.4.1-17_i386.deb
 c1a79db3f09eb620c662c9c81cf4c2d0 38310 base important klogd_1.4.1-17_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFClMJrW5ql+IAeqTIRAveBAKCFnK8+YY5u5fOkwGGr3eUlJHZHwgCfVkep
M/uuXheH1KVXMXMVftXQyDo=
=rrUr
-----END PGP SIGNATURE-----


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to