Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Sep 2006 16:21:55 +1000
From:      Sean Winn <sean@gothic.net.au>
To:        Ivan Voras <ivoras@fer.hr>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: malloc(): warning: recursive call
Message-ID:  <4BEC2251-7FA7-4BC4-A7C8-3F7618758290@gothic.net.au>
In-Reply-To: <edftb9$slo$1@sea.gmane.org>
References:  <1D1B7B79-6BF0-4316-BC96-4287669BF778@lassitu.de> <edftb9$slo$1@sea.gmane.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 04/09/2006, at 10:51 AM, Ivan Voras wrote:

> Stefan Bethke wrote:
>
>> mail in malloc(): warning: recursive call
>> Cosmic rays? Anything I could try to find the cause?
>
> I know what it is, but you won't going to like it. As far as I
> understand this happens when a process gets a signal in the middle of
> using malloc(), and the signal handler also uses malloc(). The  
> solution
> would be not to use malloc() in a signal handler, but this is tricky
> since unknown code can use malloc() (e.g. printf()?).
>

It's not tricky. man sigaction documents the functions that are async- 
signal safe. Anything not listed there (such as printf) and you're on  
your own.

There's some FreeBSD extensions, but most of this list is specified  
by the ANSI C standard, or POSIX standards.

> This appears to be "undefined" by standards, but GNU libc allows it
> because it makes sense, while phkmalloc dissallows it, causing (me)
> considerable problems with certain applications. I hope jemalloc is
> better in this respect :)
>
> I don't know how it happened in mail(1) if mail(1) is the FreeBSD  
> version.
>
> _______________________________________________
> freebsd-stable@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-stable
> To unsubscribe, send any mail to "freebsd-stable- 
> unsubscribe@freebsd.org"
>




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4BEC2251-7FA7-4BC4-A7C8-3F7618758290>