Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Sep 2008 07:11:05 -0700
From:      Jason Evans <jasone@FreeBSD.org>
To:        Stephen Montgomery-Smith <stephen@math.missouri.edu>
Cc:        freebsd-hackers@freebsd.org, FreeBSD Stable <freebsd-stable@freebsd.org>
Subject:   Re: Calling malloc from a signal handler
Message-ID:  <48D3B2F9.7020900@FreeBSD.org>
In-Reply-To: <48D3AE8D.50304@math.missouri.edu>
References:  <48D3AE8D.50304@math.missouri.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48D3B2F9.7020900>