From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marius Vollmer Newsgroups: gmane.lisp.guile.devel Subject: Re: sigaction leak Date: Tue, 11 May 2004 00:14:19 +0200 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87y8o0aq10.fsf@zagadka.ping.de> References: <87u103uzc8.fsf@zip.com.au> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1084227719 24181 80.91.224.253 (10 May 2004 22:21:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 10 May 2004 22:21:59 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue May 11 00:21:50 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BNJ9i-0007Va-00 for ; Tue, 11 May 2004 00:21:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BNJ3x-000284-S6 for guile-devel@m.gmane.org; Mon, 10 May 2004 18:15:53 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BNJ3N-00027X-Us for guile-devel@gnu.org; Mon, 10 May 2004 18:15:18 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BNJ2r-0001zK-Kz for guile-devel@gnu.org; Mon, 10 May 2004 18:15:16 -0400 Original-Received: from [195.253.8.218] (helo=mail.dokom.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BNJ2T-0001sv-8R for guile-devel@gnu.org; Mon, 10 May 2004 18:14:21 -0400 Original-Received: from dialin.speedway16.dip33.dokom.de ([195.253.16.33] helo=zagadka.ping.de) by mail.dokom.net with smtp (Exim 3.36 #3) id 1BNJ56-0003Dl-00 for guile-devel@gnu.org; Tue, 11 May 2004 00:17:04 +0200 Original-Received: (qmail 28248 invoked by uid 1000); 10 May 2004 22:14:19 -0000 Original-To: guile-devel@gnu.org In-Reply-To: <87u103uzc8.fsf@zip.com.au> (Kevin Ryde's message of "Fri, 02 Apr 2004 08:07:19 +1000") User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:3698 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3698 Kevin Ryde writes: > On my i386 debian, a program > > (while #t (sigaction SIGPIPE (sigaction SIGPIPE SIG_IGN))) > > seems to make the guile process grow without bound, not very quickly, > but apparently inexorably. Got it! The code above uses sigaction incorrectly, it should be something like (define (restore-sigaction num old) (sigaction num (car old) (cdr old))) (while #t (restore-sigaction SIGPIPE (sigaction SIGPIPE SIG_IGN))) The 'leak' occurs because the outer sigaction stores a larger and larger data structure as the handler of the signal. That data structure is not a valid handler, but sigaction doesn't reject it. guile> (define old (sigaction SIGPIPE SIG_IGN)) guile> old (0 . 268435456) guile> (sigaction SIGPIPE old) (1 . 268435456) guile> (define old (sigaction SIGPIPE SIG_IGN)) guile> old ((0 . 268435456) . 268435456) I have fixed sigaction: 2004-05-11 Marius Vollmer * scmsigs.c (scm_sigaction_for_thread): Validate that the handler is indeed a procedure when it isn't a number. -- GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel