diff options
author | Carlos O'Donell <carlos@redhat.com> | 2018-06-22 09:28:47 -0400 |
---|---|---|
committer | Carlos O'Donell <carlos@redhat.com> | 2018-06-29 22:39:06 -0400 |
commit | 2827ab990aefbb0e53374199b875d98f116d6390 (patch) | |
tree | 0063b4c07be87d887d4a4893b9681b9e61479e8b /ChangeLog | |
parent | 37d3d244e1a0ca7e7ac89b8e768e665adbb2e2d8 (diff) | |
download | glibc-2827ab990aefbb0e53374199b875d98f116d6390.tar glibc-2827ab990aefbb0e53374199b875d98f116d6390.tar.gz glibc-2827ab990aefbb0e53374199b875d98f116d6390.tar.bz2 glibc-2827ab990aefbb0e53374199b875d98f116d6390.zip |
libc: Extend __libc_freeres framework (Bug 23329).
The __libc_freeres framework does not extend to non-libc.so objects.
This causes problems in general for valgrind and mtrace detecting
unfreed objects in both libdl.so and libpthread.so. This change is
a pre-requisite to properly moving the malloc hooks out of malloc
since such a move now requires precise accounting of all allocated
data before destructors are run.
This commit adds a proper hook in libc.so.6 for both libdl.so and
for libpthread.so, this ensures that shm-directory.c which uses
freeit () to free memory is called properly. We also remove the
nptl_freeres hook and fall back to using weak-ref-and-check idiom
for a loaded libpthread.so, thus making this process similar for
all DSOs.
Lastly we follow best practice and use explicit free calls for
both libdl.so and libpthread.so instead of the generic hook process
which has undefined order.
Tested on x86_64 with no regressions.
Signed-off-by: DJ Delorie <dj@redhat.com>
Signed-off-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'ChangeLog')
-rw-r--r-- | ChangeLog | 48 |
1 files changed, 48 insertions, 0 deletions
@@ -1,3 +1,51 @@ +2018-06-29 DJ Delorie <dj@redhat.com> + Carlos O'Donell <carlos@redhat.com> + + [BZ #23329] + * include/libc-symbols.h: Comment the freeres framework. + * include/set-hooks.h: Include libc-symbols.h. Fix comment. + * dlfcn/Makefile (libdl-routines): Add dlfreeres. + * dlfcn/Versions (GLIBC_PRIVATE): Add __libdl_freeres. + * dlfcn/dlerror.c: Include libc-symbols.h + (__dlerror_main_freeres): New function. + * dlfcn/dlfreeres.c: New file. + * dlfcn/sdlfreeres.c: New file. + * include/dlfcn.h: Declare __dlerror_main_freeres. + * malloc/set-freeres.c: Declare __libdl_freeres, and + __libpthread_freeres. + (__libc_subfreeres): Call __libdl_freeres, and __libpthread_freeres if + the releavant libraries are loaded. + * malloc/thread-freeres.c: Add comments. + * nptl/Makefile (libpthread-routines): Add nptlfreeres. + * nptl/Version (GLIBC_PRIVATE): Add __libpthread_freeres. + * nptl/allocatestack.c (__nptl_free_stacks): New function. + (__free_stacks): Rename to... + (free_stacks): ...this. Mark static. + (queue_stack): Call free_stacks. + * nptl/libc_pthread_init.c [SHARED] (freeres_libpthread): Delete. + * nptl/nptl-init.c: Delete delcaration of nptl_freeres. + * sysdeps/nptl/pthread-functions.h (pthread_functions): Remove + ptr_freeres element from struct. + (pthread_functions): Remove .ptr_freeres from struct initializer. + [SHARED] (nptl_freeres): Remove. + * nptl/nptlfreeres.c: New file. + * nptl/pthreadP.h + [IS_IN (libpthread) && SHARED ] (__unwind_freeres): Rename to... + [IS_IN (libpthread)] (__nptl_unwind_freeres): ...this. Mark + attribute_hidden. + (__free_stacks): Rename to... + (__nptl_stacks_freeres): ...this. + (__shm_directory_freeres): Declare. + * nptl/unwind-forcedunwind.c (__unwind_freeres): Rename to... + (__nptl_unwind_freeres): ...this. + * resolv/res-close.c: Add comment. + * resolv/resolv_conf.c: Include libc-symbols.h. + * string/strerror_l.c: Include libc-symbols.h. + * sunrpc/rpc_thread.c: Include libc-symbols.h. + * sysdeps/mach/strerror_l.c: Inlcude libc-symbols.h + * sysdeps/unix/sysv/linux/shm-directory.c (freeit): Rename to... + [IS_IN (libpthread)] (__shm_directory_freeres): ...this. + 2018-06-29 Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com> * stdlib/tst-strfmon_l.c: Add tests for long double. |