[krbdev.mit.edu #6930] segfault when unloading libraries on old O/S

Arlene Berry via RT rt-comment at krbdev.mit.edu
Thu Jul 21 16:29:57 EDT 2011


We've had this in our local source for a long time and it's to prevent a segfault when unloading libraries on RHEL 2.1.  I don't know whether anything else needs it.  The original description and patch are below.

"There must be a bug in the loader on RHEL 2.1. libcom_err's destructor is sometimes (not always) called before libgssapi_krb5's destructor. This causes libgssapi_krb5 to look at the already freed global table.

The fix is to NULL out et_list once it is freed, so that even if libgssapi_krb5's destructor is called afterwards, it will not look at the list."


Index: src/util/et/error_message.c
===================================================================
--- src/util/et/error_message.c	(revision 25023)
+++ src/util/et/error_message.c	(working copy)
@@ -81,6 +81,7 @@
         enext = e->next;
         free(e);
     }
+    et_list = NULL;
     k5_mutex_unlock(&et_list_lock);
     k5_mutex_destroy(&et_list_lock);
     terminated = 1;





More information about the krb5-bugs mailing list