malloc(): warning: recursive call
Sean Winn
sean at gothic.net.au
Sun Sep 3 23:22:11 PDT 2006
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 at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-stable
> To unsubscribe, send any mail to "freebsd-stable-
> unsubscribe at freebsd.org"
>
More information about the freebsd-stable
mailing list