From owner-freebsd-stable@FreeBSD.ORG Fri Sep 19 16:40:30 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4EEB106564A; Fri, 19 Sep 2008 16:40:30 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id 840918FC08; Fri, 19 Sep 2008 16:40:30 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.3/8.14.3/NETPLEX) with ESMTP id m8JGeStO022809; Fri, 19 Sep 2008 12:40:28 -0400 (EDT) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.0 (mail.netplex.net [204.213.176.10]); Fri, 19 Sep 2008 12:40:29 -0400 (EDT) Date: Fri, 19 Sep 2008 12:40:28 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Stephen Montgomery-Smith In-Reply-To: <48D3AE8D.50304@math.missouri.edu> Message-ID: References: <48D3AE8D.50304@math.missouri.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org, FreeBSD Stable Subject: Re: Calling malloc from a signal handler X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Sep 2008 16:40:30 -0000 On Fri, 19 Sep 2008, 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. > > Is it now permissible to call "malloc" from within a signal handler in > FreeBSD-7.x? > > If so, should the man page of "sigaction(2)" be upgraded to say this? You shouldn't call malloc() or any other function that isn't async-signal-safe from a signal handler. I don't think we should say if it works or not, since it is not portable and could change at any given time in future versions of FreeBSD. -- DE