This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/13502] SEGFAULT in fork() when pthread_atfork() was called from a library loaded/unloaded with dlopen/dlclose


https://sourceware.org/bugzilla/show_bug.cgi?id=13502

Carlos O'Donell <carlos at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |carlos at redhat dot com

--- Comment #3 from Carlos O'Donell <carlos at redhat dot com> ---
(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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]