git: libc/libpthread: Inject threadsafe locking callbacks for rtld.

Michael Neumann mneumann at ntecs.de
Tue Apr 4 00:32:59 PDT 2017


On 04/02/17 21:06, Imre Vadasz wrote:
> commit 16fb9086b36e7c7d81241bbd6502634e40346c7b
> Author: Imre Vadász <imre at vdsz.com>
> Date:   Sun Apr 2 13:50:15 2017 +0200
>
>     libc/libpthread: Inject threadsafe locking callbacks for rtld.
>     
>     * Make rtld thread-safe. Add lib/libthread_xu/thread/thr_rtld.c
>       to the build and use it to inject pthread based locking callbacks
>       for rtld.
>     
>     * In rtld_lock.c, do the thread_mask_clear(lock->mask); after releasing
>       the actual lock, to avoid deadlocks when rtld is called recursively
>       from the pthread locking callbacks.
>       XXX An alternative solution for this issue would be, to flag the
>           libpthread dynamic library as bind_now to avoid the recursive rtld
>           calls.
>
> Summary of changes:
>  lib/libthread_xu/Makefile            | 1 +
>  lib/libthread_xu/thread/Makefile.inc | 1 +
>  lib/libthread_xu/thread/thr_kern.c   | 3 +--
>  lib/libthread_xu/thread/thr_rtld.c   | 8 +++++---
>  libexec/rtld-elf/rtld_lock.c         | 2 +-
>  5 files changed, 9 insertions(+), 6 deletions(-)
>
> http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/16fb9086b36e7c7d81241bbd6502634e40346c7b
>

Awesome! This commit fixes bug #2975 [1] !!!

Regards,

  Michael

[1]: http://bugs.dragonflybsd.org/issues/2975





More information about the Commits mailing list