This causes a different problem. We actually hit the problem in this test:
https://gitlab.com/nbdkit/libnbd/-/blob/master/tests/dlopen.c
(1) The thread calls dlclose(), unmapping the library but leaving the
pthread_key_t in place, which contains a pointer to free_errors_key in
the unmapped library.
(2) The thread exits, and glibc calls free_errors_key, causing a crash.
Maybe -z nodelete really is the only answer.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html