[PATCH] malloc: Run fork handler as late as possible [BZ #19431]
Florian Weimer
fweimer@redhat.com
Thu Apr 14 10:56:00 GMT 2016
On 04/14/2016 12:26 PM, Andreas Schwab wrote:
> Florian Weimer <fweimer@redhat.com> writes:
>
>> 2016-04-13 Florian Weimer <fweimer@redhat.com>
>>
>> [BZ #19431]
>> Run the malloc fork handler as late as possible to avoid deadlocks.
>> * malloc/malloc-internal.h: New file.
>> * malloc/malloc.c: Include it.
>> * malloc/arena.c (ATFORK_MEM): Remove.
>> (__malloc_fork_lock_parent): Rename from ptmalloc_lock_all.
>> Update comment.
>> (__malloc_fork_unlock_parent): Rename from ptmalloc_unlock_all.
>> (__malloc_fork_unlock_child): Rename from ptmalloc_unlock_all2.
>> Remove outdated comment.
>> (ptmalloc_init): Do not call thread_atfork. Remove
>> thread_atfork_static.
>
> In file included from malloc.c:1889:0:
> arena.c:139:1: error: conflicting types for '__malloc_fork_lock_parent'
> __malloc_fork_lock_parent (void)
> ^
> In file included from malloc.c:247:0:
> ../malloc/malloc-internal.h:23:6: note: previous declaration of '__malloc_fork_lock_parent' was here
> void __malloc_fork_lock_parent (void) internal_function attribute_hidden;
> ^
Fixed with the attached patch. Sorry about that.
Florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-malloc-Add-missing-internal_function-attributes-on-f.patch
Type: text/x-patch
Size: 786 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20160414/f4348bae/attachment.bin>
More information about the Libc-alpha
mailing list