From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id BB67C1F461 for ; Tue, 23 Jul 2019 13:21:51 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; q=dns; s=default; b=MkzL/ xFJY4WicNfAkqkt5UV0OR80qG/A0hzWGiQyj4Ce134R/pumlzFF4ov+cHx6revXV oqxZHR9PGCI6r2hR9wZT8XFYH2tHP5heBehBJrfNVSIrmpMK8tPhXBZ4O5/09UER gLueou8B0qhSK0I0kPtwD4rmd2mbtzLRLwM/+c= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; s=default; bh=onNq7iBclkt ETRweWkdwOn2Oc6w=; b=sjXPqUDYwgVgOuA96/77cU8xxvrXo0sRkyxjhPwHj+o VqemTsEuffXKJ8Obp18PkZS/uFl5wAw+PCEyi6HVu4nfpoyi8F2BNci8WjdmlzhI wJB8wDBDlncZ3k4OA5VFOJK2Swz6S0Cwas5GNQSU2xLQDKI9tVTjtKAdgcERbPCA = Received: (qmail 5771 invoked by alias); 23 Jul 2019 13:21:49 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 5763 invoked by uid 89); 23 Jul 2019 13:21:49 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mx1.redhat.com From: Florian Weimer To: Chung-Lin Tang Cc: GNU C Library , Subject: Re: [PATCH 1/2][RFC] #17645, fix slow DSO sorting behavior in dynamic loader References: Date: Tue, 23 Jul 2019 15:21:44 +0200 In-Reply-To: (Chung-Lin Tang's message of "Sun, 21 Jul 2019 01:50:53 +0800") Message-ID: <87h87crimv.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain * Chung-Lin Tang: > Hi, this patch is our attempt at resolving the slow shared object sorting > situation in #17645, #15310, and some effort at #15311. I realize this is > pretty unsuitable timing to be submitting a patch of such nature now (probably > way too late to be included into 2.30), but still sending now anyways as this > will probably need quite some discussion before being approved. > > Prior attempts at solving this slow sorting behavior appeared to have failed > due to inadequate proposed testing, therefore cannot convince reviewers to > touch what seems to be perceived as a sensitive and easy to break part of ld.so. Thanks for working on this! > * elf/Makefile (test_dso_ordering): New make function. > (tst-dso-ordering[123456789]): Define new DSO sorting tests. > (tst-bz15311): Testcase from #15311. > * scripts/dso-ordering-test.py: New script. I have not looked at the script in detail yet, sorry. But I have some early questions. Is => intended to cover the case of run-time dependencies added late due to lazy binding? Currently, those late dependencies have two effects, I think: They keep around the referenced libraries longer than before (so that dlclose would not remove an object which is still in used solely due to lazy binding). And the ELF destructors are reordered to reflect these added run-time dependencies. Can your test framework test both cases? What's your position on the second effect? I think it sometimes results in destructors running not in the opposite order of constructors, due to the new topological sort. (This also happens with the current implementation.) Thanks, Florian