From owner-svn-src-all@freebsd.org Tue Jul 18 23:02:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E950DA1F74; Tue, 18 Jul 2017 23:02:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 386F52F80; Tue, 18 Jul 2017 23:02:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IN2ZPQ096683; Tue, 18 Jul 2017 23:02:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IN2Zjr096682; Tue, 18 Jul 2017 23:02:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707182302.v6IN2Zjr096682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 18 Jul 2017 23:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321177 - stable/11/lib/libc/net X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/lib/libc/net X-SVN-Commit-Revision: 321177 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 23:02:36 -0000 Author: markj Date: Tue Jul 18 23:02:34 2017 New Revision: 321177 URL: https://svnweb.freebsd.org/changeset/base/321177 Log: MFC r320895: Don't dlclose NSS modules from nss_atexit(). Modified: stable/11/lib/libc/net/nsdispatch.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/net/nsdispatch.c ============================================================================== --- stable/11/lib/libc/net/nsdispatch.c Tue Jul 18 21:09:29 2017 (r321176) +++ stable/11/lib/libc/net/nsdispatch.c Tue Jul 18 23:02:34 2017 (r321177) @@ -525,8 +525,8 @@ fin: vector_sort(_nsmod, _nsmodsize, sizeof(*_nsmod), string_compare); } +static int exiting = 0; - static void ns_mod_free(ns_mod *mod) { @@ -536,12 +536,10 @@ ns_mod_free(ns_mod *mod) return; if (mod->unregister != NULL) mod->unregister(mod->mtab, mod->mtabsize); - if (mod->handle != nss_builtin_handle) + if (mod->handle != nss_builtin_handle && !exiting) (void)dlclose(mod->handle); } - - /* * Cleanup */ @@ -550,6 +548,7 @@ nss_atexit(void) { int isthreaded; + exiting = 1; isthreaded = __isthreaded; if (isthreaded) (void)_pthread_rwlock_wrlock(&nss_lock); @@ -560,8 +559,6 @@ nss_atexit(void) if (isthreaded) (void)_pthread_rwlock_unlock(&nss_lock); } - - /* * Finally, the actual implementation.