ldap/servers/slapd/daemon.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
New commits:
commit 8133eaf26589b0054a0407239bccd6552edd13c4
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Thu Jun 23 07:22:47 2016 -0400
Ticket 48898 - Crash during shutdown if nunc-stans is enabled
Bug Description: During server shutdown the connection table was
freed before we shut down the nunc-stans thread
pool. This lead to a crash when a freed connection
pointer was deferenced in ns_handle_closure.
Fix Description: Close down the nunc-stans thread pool before freeing
the connection table.
https://fedorahosted.org/389/ticket/48898
Reviewed by: nhosoi(Thanks!)
(cherry picked from commit 02d8e0c0fc91750d2114b05afebdd457e4a04adf)
diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c
index 29562ae..20993d4 100644
--- a/ldap/servers/slapd/daemon.c
+++ b/ldap/servers/slapd/daemon.c
@@ -1307,6 +1307,16 @@ void slapd_daemon( daemon_ports_t *ports )
mapping_tree_free ();
}
+#ifdef ENABLE_NUNC_STANS
+ /*
+ * We need to shutdown the nunc-stans thread pool before we free the
+ * connection table.
+ */
+ if (enable_nunc_stans) {
+ ns_thrpool_destroy(tp);
+ }
+#endif
+
/*
* connection_table_free could use callbacks in the backend.
* (e.g., be_search_results_release)
@@ -1314,11 +1324,7 @@ void slapd_daemon( daemon_ports_t *ports )
*/
connection_table_free(the_connection_table);
the_connection_table= NULL;
-#ifdef ENABLE_NUNC_STANS
- if (enable_nunc_stans) {
- ns_thrpool_destroy(tp);
- }
-#endif
+
be_cleanupall ();
connection_post_shutdown_cleanup();
LDAPDebug( LDAP_DEBUG_TRACE, "slapd shutting down - backends closed down\n",