From owner-cvs-src-old@FreeBSD.ORG Thu Mar 3 17:12:44 2011 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C3801065788 for ; Thu, 3 Mar 2011 17:12:44 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 611E88FC18 for ; Thu, 3 Mar 2011 17:12:44 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id p23HCiDO076270 for ; Thu, 3 Mar 2011 17:12:44 GMT (envelope-from jh@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id p23HCiZ9076269 for cvs-src-old@freebsd.org; Thu, 3 Mar 2011 17:12:44 GMT (envelope-from jh@repoman.freebsd.org) Message-Id: <201103031712.p23HCiZ9076269@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to jh@repoman.freebsd.org using -f From: Jaakko Heinonen Date: Thu, 3 Mar 2011 17:12:24 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: RELENG_8 Subject: cvs commit: src/libexec/rtld-elf rtld.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Mar 2011 17:12:44 -0000 jh 2011-03-03 17:12:24 UTC FreeBSD src repository Modified files: (Branch: RELENG_8) libexec/rtld-elf rtld.c Log: SVN rev 219237 on 2011-03-03 17:12:24Z by jh MFC r216489: If dlclose() is called recursively from a _fini() function, the inner dlclose() call may unload the object of the outer call prematurely because objects are unreferenced before _fini() calls. Fix this by unreferencing objects after calling objlist_call_fini() in dlclose(). Therefore objlist_call_fini() now calls the fini function if the reference count of an object is 1. In addition we must restart the list_fini traversal after every _fini() call because another dlclose() call might have modified the reference counts. Add an XXX comment to objlist_call_fini() about possible race with dlopen(). PR: 133246, 149464 Revision Changes Path 1.139.2.12 +38 -16 src/libexec/rtld-elf/rtld.c