From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2593 invoked by alias); 17 Jan 2005 12:43:22 -0000 Mailing-List: contact glibc-bugs-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sources.redhat.com Received: (qmail 2450 invoked by uid 48); 17 Jan 2005 12:43:10 -0000 Date: Mon, 17 Jan 2005 12:43:00 -0000 Message-ID: <20050117124310.2447.qmail@sourceware.org> From: "alexei dot khlebnikov at datacon dot at" To: glibc-bugs@sources.redhat.com In-Reply-To: <20050112104719.654.alexei.khlebnikov@datacon.at> References: <20050112104719.654.alexei.khlebnikov@datacon.at> Reply-To: sourceware-bugzilla@sources.redhat.com Subject: [Bug nptl/654] Cancelling nptl thread on dlclose() leads to application hangup X-Bugzilla-Reason: CC X-SW-Source: 2005-01/txt/msg00099.txt.bz2 List-Id: ------- Additional Comments From alexei dot khlebnikov at datacon dot at 2005-01-17 12:43 ------- I've constructed a patch that unlocks dl_load_lock just before running the destructors, and locks it again just after that. My testcase now runs properly, but I don't know wether or not my patch has any side-effects. So, dear glibc developers, please watch it and either confirm that the patch is correct or point me where am I wrong. Thanks. The patch: --- --- glibc/elf/dl-close.c.orig 2005-01-09 09:27:52.000000000 +0100 +++ glibc/elf/dl-close.c 2005-01-17 15:04:52.000000000 +0100 @@ -265,6 +265,10 @@ } assert (new_opencount[0] == 0); + /* Release dl_load_lock during running destructors, + like in dl-fini.c. */ + __rtld_lock_unlock_recursive (GL(dl_load_lock)); + /* Call all termination functions at once. */ #ifdef SHARED bool do_audit = GLRO(dl_naudit) > 0 && !GL(dl_ns)[ns]._ns_loaded->l_auditing; @@ -389,6 +393,9 @@ assert (imap->l_type == lt_loaded || imap->l_opencount > 0); } + /* Destructors finished, acquire dl_load_lock again. */ + __rtld_lock_lock_recursive (GL(dl_load_lock)); + #ifdef SHARED /* Auditing checkpoint: we will start deleting objects. */ if (__builtin_expect (do_audit, 0)) --- -- http://sources.redhat.com/bugzilla/show_bug.cgi?id=654 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.