From owner-freebsd-current@FreeBSD.ORG Tue Jun 1 05:33:39 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EDF0F16A4CE for ; Tue, 1 Jun 2004 05:33:39 -0700 (PDT) Received: from smsgw.vianetworks.ch (smsgw.vianetworks.ch [146.228.10.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 52C5043D1D for ; Tue, 1 Jun 2004 05:33:39 -0700 (PDT) (envelope-from mw@smsgw.vianetworks.ch) Received: from smsgw.vianetworks.ch (localhost.kpnqwest.ch [127.0.0.1]) by smsgw.vianetworks.ch (8.12.10/8.12.6) with ESMTP id i51CXZhm037507 for ; Tue, 1 Jun 2004 14:33:35 +0200 (CEST) (envelope-from mw@smsgw.vianetworks.ch) Received: (from mw@localhost) by smsgw.vianetworks.ch (8.12.10/8.12.6/Submit) id i51CXZeo037506 for freebsd-current@freebsd.org; Tue, 1 Jun 2004 14:33:35 +0200 (CEST) Message-Id: <200406011233.i51CXZeo037506@smsgw.vianetworks.ch> To: freebsd-current@freebsd.org Date: Tue, 1 Jun 2004 14:33:35 +0200 (CEST) Sender: mw@smsgw.vianetworks.ch From: Markus Wild X-NCC-RegID: ch.vianetworks X-Mailer: ELM [version 2.4ME+ PL99b (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Subject: Problem with syslogd X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2004 12:33:40 -0000 Hi there, I'm frequently seeing a problem with syslogd aborting, with a gdb trace indicating it's trying to free() content out of the reapchild() function, with the signal having interrupted another malloc/free type function call. I was able to keep the effects of this in bay by blocking SIGCHLD in logmsg() and validate(), but I might not have caught all possible cases yet. Looking at the code, is it such a great idea to call a non-reentrant allocation function (free()) from a signal handler? reapchild() calls deadq_remove(), which by itself calls free(). IMHO this should be moved out of the signal handler, or am I missing something? If you want to provoke the bug, have a "|" command in your syslog.conf with a command that frequently terminates, and feed it a lot of messages.... Cheers, Markus