• Roland McGrath's avatar
    [PATCH] Disable CLONE_CHILD_CLEARTID for abnormal exit · fec1d011
    Roland McGrath authored
    The CLONE_CHILD_CLEARTID flag is used by NPTL to have its threads
    communicate via memory/futex when they exit, so pthread_join can
    synchronize using a simple futex wait.  The word of user memory where NPTL
    stores a thread's own TID is what it passes; this gets reset to zero at
    thread exit.
    
    It is not desireable to touch this user memory when threads are dying due
    to a fatal signal.  A core dump is more usefully representative of the
    dying program state if the threads live at the time of the crash have their
    NPTL data structures unperturbed.  The userland expectation of
    CLONE_CHILD_CLEARTID has only ever been that it works for a thread making
    an _exit system call.
    
    This problem was identified by Ernie Petrides <petrides@redhat.com>.
    Signed-off-by: default avatarRoland McGrath <roland@redhat.com>
    Cc: Ernie Petrides <petrides@redhat.com>
    Cc: Jakub Jelinek <jakub@redhat.com>
    Acked-by: default avatarIngo Molnar <mingo@elte.hu>
    Cc: Ulrich Drepper <drepper@redhat.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    fec1d011
fork.c 42.7 KB