From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30166 invoked by alias); 3 Oct 2013 01:17:58 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Received: (qmail 30083 invoked by uid 48); 3 Oct 2013 01:17:52 -0000 From: "carlos at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug libc/13502] SEGFAULT in fork() when pthread_atfork() was called from a library loaded/unloaded with dlopen/dlclose Date: Thu, 03 Oct 2013 01:17:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: 2.12 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: carlos at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-10/txt/msg00016.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=13502 Carlos O'Donell changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |carlos at redhat dot com --- Comment #3 from Carlos O'Donell --- (In reply to Ondrej Bilka from comment #1) > This problem cannot be solved without introducing new API. > > Problem here is lack of function that removes fork handler. The removal of the handlers could be done automatically when the DSO is unloaded. Each dso has a unique __dso_handle inserted by the compiler which is used when registering the handlers via pthread_atfork. When the DSO is unloaded we could look through the registered handlers and remove those that belong to the DSO being unloaded. The only other robust alternatives are: * mark the DSOs as unloadable e.g. -z nodelete. * don't use pthread_atfork -- You are receiving this mail because: You are on the CC list for the bug.