From owner-freebsd-hackers@FreeBSD.ORG Fri Sep 19 14:11:07 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C4411065674 for ; Fri, 19 Sep 2008 14:11:07 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from canonware.com (canonware.com [64.183.146.166]) by mx1.freebsd.org (Postfix) with ESMTP id D72D68FC19 for ; Fri, 19 Sep 2008 14:11:06 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from [192.168.168.201] (unknown [192.168.168.201]) by canonware.com (Postfix) with ESMTP id 458121298EB; Fri, 19 Sep 2008 07:15:41 -0700 (PDT) Message-ID: <48D3B2F9.7020900@FreeBSD.org> Date: Fri, 19 Sep 2008 07:11:05 -0700 From: Jason Evans User-Agent: Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: Stephen Montgomery-Smith References: <48D3AE8D.50304@math.missouri.edu> In-Reply-To: <48D3AE8D.50304@math.missouri.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, FreeBSD Stable Subject: Re: Calling malloc from a signal handler X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Sep 2008 14:11:07 -0000 Stephen Montgomery-Smith wrote: > I notice that if you use "malloc" from within a signal handler on > FreeBSD-6.x, that you can potentially trigger a "recursive call" error. > > But this seems to have changed in FreeBSD-7.x. The malloc implementation is completely new in FreeBSD 7, so not all of the internal error checking code is the same. > Is it now permissible to call "malloc" from within a signal handler in > FreeBSD-7.x? Calling malloc from within a signal handler can cause application deadlock, so although you won't see an error message printed, you are unlikely to be happy with the results. Jason