This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] malloc: Run fork handler as late as possible [BZ #19431]
- From: Florian Weimer <fweimer at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Thu, 10 Mar 2016 14:35:10 +0100
- Subject: Re: [PATCH] malloc: Run fork handler as late as possible [BZ #19431]
- Authentication-results: sourceware.org; auth=none
- References: <56BBAF3D dot 5030905 at redhat dot com>
On 02/10/2016 10:44 PM, Florian Weimer wrote:
>
> 2016-02-10 Florian Weimer <fweimer@redhat.com>
>
> [BZ #19431]
> Run the malloc fork handler as late as possible to avoid deadlocks.
> * malloc/malloc-private.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.
> * malloc/bug19431.c: New file.
> * Makefile (tests): Add it.
> (bug19431): Link against libpthread.
> * manual/memory.texi (Aligned Memory Blocks): Update safety
> annotation comments.
> * sysdeps/nptl/fork.c (__libc_fork): Call
> __malloc_fork_lock_parent, __malloc_fork_unlock_parent,
> __malloc_fork_unlock_child.
> * sysdeps/mach/hurd/fork.c (__fork): Likewise.
Ping?
Thanks,
Florian