From owner-cvs-src-old@FreeBSD.ORG Thu Dec 16 16:56:58 2010 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 AE6101065782 for ; Thu, 16 Dec 2010 16:56:58 +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 9C55B8FC32 for ; Thu, 16 Dec 2010 16:56:58 +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 oBGGuwEI026270 for ; Thu, 16 Dec 2010 16:56:58 GMT (envelope-from jh@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id oBGGuwCp026269 for cvs-src-old@freebsd.org; Thu, 16 Dec 2010 16:56:58 GMT (envelope-from jh@repoman.freebsd.org) Message-Id: <201012161656.oBGGuwCp026269@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to jh@repoman.freebsd.org using -f From: Jaakko Heinonen Date: Thu, 16 Dec 2010 16:56:44 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD 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, 16 Dec 2010 16:56:58 -0000 jh 2010-12-16 16:56:44 UTC FreeBSD src repository Modified files: libexec/rtld-elf rtld.c Log: SVN rev 216489 on 2010-12-16 16:56:44Z by jh 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 Reviewed by: kan, kib Revision Changes Path 1.161 +38 -16 src/libexec/rtld-elf/rtld.c