This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: malloc/free is signal-safe?
- From: Siddhesh Poyarekar <siddhesh dot poyarekar at gmail dot com>
- To: Dimitrios Apostolou <jimis at gmx dot net>
- Cc: libc-help <libc-help at sourceware dot org>
- Date: Tue, 4 Jun 2013 15:26:12 +0530
- Subject: Re: malloc/free is signal-safe?
- References: <alpine dot DEB dot 2 dot 02 dot 1306041057460 dot 4769 at localhost>
On 4 June 2013 14:35, Dimitrios Apostolou <jimis@gmx.net> wrote:
> according to the libc manual, malloc is signal-safe in glibc. However I got
If it really says that then it is a bug in the manual. malloc is not
async-signal safe Please quote the section of the manual that
mentions it and file a bug report.
> a deadlock when I sigTERM'd a process during malloc(), and it tried to log
> with vasprintf() (which itself calls malloc).
>
> Am I missing something regarding libc's malloc() reentrancy? Here is the
> backtrace I got:
Maybe you confused it with thread-safe? malloc is thread-safe, but
not async-signal-safe.
Siddhesh
--
http://siddhesh.in