From owner-freebsd-current Mon Jan 24 19:48:51 2000 Delivered-To: freebsd-current@freebsd.org Received: from mathserv.mps.ohio-state.edu (mathserv.mps.ohio-state.edu [128.146.111.31]) by hub.freebsd.org (Postfix) with ESMTP id 78FE514D62 for ; Mon, 24 Jan 2000 19:48:48 -0800 (PST) (envelope-from ilya@math.ohio-state.edu) Received: from monk.mps.ohio-state.edu (monk.mps.ohio-state.edu [128.146.111.52]) by mathserv.mps.ohio-state.edu (8.9.3/8.9.3) with ESMTP id WAA23739; Mon, 24 Jan 2000 22:48:47 -0500 (EST) Received: (from ilya@localhost) by monk.mps.ohio-state.edu (8.9.3/8.9.3) id WAA21600; Mon, 24 Jan 2000 22:48:46 -0500 (EST) From: Ilya Zakharevich Message-Id: <200001250348.WAA21600@monk.mps.ohio-state.edu> Subject: Re: [ID 20000124.004] "perl in malloc(): warning: recursive call" on To: larse@ISI.EDU (Lars Eggert) Date: Mon, 24 Jan 2000 22:48:46 -0500 (EST) Cc: perl5-porters@perl.org, current@freebsd.org In-Reply-To: <200001250006.QAA13204@sub.isi.edu> from "Lars Eggert" at Jan 24, 2000 04:06:09 PM X-Mailer: ELM [version 2.5 PL3] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Lars Eggert writes: > Running the following test script causes perl to crash. You may need > to run the script several times before seeing the problem. (The script > spawns a child process that does nothing but write to an array. The > parent signals the child periodically.) Signals and Perl do not mix. Please do not use signals if a segfault is not a desirable form of output. > $SIG{ALRM} = sub { $state++ }; One should not do anything as bad as that in a sighandler. What is the failure rate you see? You may get slightly better rate (3% in my tests) with something like $SIG{ALRM} = sub { ++$state ; return }; and preallocating $state = 0; Ilya To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message