[30597] in CVS-changelog-for-Kerberos-V5
krb5 commit: Work around glibc bug 11941 (dlclose assertion)
daemon@ATHENA.MIT.EDU (Greg Hudson)
Wed Oct 23 12:48:54 2019
Date: Wed, 23 Oct 2019 12:48:33 -0400
From: Greg Hudson <ghudson@mit.edu>
Message-ID: <201910231648.x9NGmX4P006332@drugstore.mit.edu>
To: <cvs-krb5@mit.edu>
MIME-Version: 1.0
Reply-To: krbdev@mit.edu
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu
https://github.com/krb5/krb5/commit/bf5953c549a6d279977df69ffe89b2ba51460eaf
commit bf5953c549a6d279977df69ffe89b2ba51460eaf
Author: Greg Hudson <ghudson@mit.edu>
Date: Wed Oct 23 00:48:25 2019 -0400
Work around glibc bug 11941 (dlclose assertion)
When building against glibc 2.24 or earlier, suppress calls to
dlclose() to prevent the assertion failure "_dl_close: Assertion
`map->l_init_called' failed" at process exit. We need this workaround
to enable automated tests that load GSSAPI modules.
ticket: 7135
src/util/support/plugins.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/src/util/support/plugins.c b/src/util/support/plugins.c
index 47368be..3329db7 100644
--- a/src/util/support/plugins.c
+++ b/src/util/support/plugins.c
@@ -54,6 +54,21 @@
#define PLUGIN_DLOPEN_FLAGS (RTLD_NOW | RTLD_LOCAL | GROUP | NODELETE)
#endif
+/*
+ * glibc bug 11941, fixed in release 2.25, can cause an assertion failure in
+ * dlclose() on process exit. Our workaround is to leak dlopen() handles
+ * (which doesn't typically manifest in leak detection tools because the
+ * handles are still reachable via a global table in libdl). Because we
+ * dlopen() with RTLD_NODELETE, we weren't going to unload the plugin objects
+ * anyway.
+ */
+#ifdef __linux__
+#include <features.h>
+#if ! __GLIBC_PREREQ(2, 25)
+#define dlclose(x)
+#endif
+#endif
+
#if USE_DLOPEN && USE_CFBUNDLE
#include <CoreFoundation/CoreFoundation.h>
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5