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 E28301F731 for ; Mon, 5 Aug 2019 10:39:30 +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:reply-to:subject:to:cc:references:from :message-id:date:mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=KGvPxtKmEfC/P1y+ gkJCVixAcoZViBCqUH1XXpP4ycoTzXw6mdRsn1x5MBygNDr0CupMpRPjkwDoLQsx v57gvewAWTb6z8w/ROK8vSzi4OdLLHarmvwxMRU+IYqhoR/DZimNniCnFRxSKG2a BE/FOp8oAEb7rhObURI25yLDQ0I= 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:reply-to:subject:to:cc:references:from :message-id:date:mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=XdRJZJV+ooa5bwi0ikI5ZL IX+9M=; b=W8QOiQFoNvoweqar1HyeS1kEhGQJ4Te1suJt+KWMI7R0gNqE/0ljZk cDkwFCVkzCBih6bEDy5ujr9QZXbvFQYALHWbPuhjNyT79uIurA0uQoib8xQ98RaU Xg0fAQopsM3vqRFZ8jkzJCPFpj6vMq4E1WMWFtJdTNkfwAqgTdf8M= Received: (qmail 13727 invoked by alias); 5 Aug 2019 10:39:19 -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 13648 invoked by uid 89); 5 Aug 2019 10:39:19 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: relay1.mentorg.com Reply-To: Subject: Re: [PATCH 1/2][RFC] #17645, fix slow DSO sorting behavior in dynamic loader To: Florian Weimer CC: , GNU C Library References: <87h87crimv.fsf@oldenburg2.str.redhat.com> <87wog15fyy.fsf@oldenburg2.str.redhat.com> From: Chung-Lin Tang Message-ID: Date: Mon, 5 Aug 2019 18:39:07 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <87wog15fyy.fsf@oldenburg2.str.redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit On 2019/7/29 5:48 PM, Florian Weimer wrote: > * Chung-Lin Tang: >>> 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.) >> >> What I did in the ld.so code patch was add a second pass of sorting >> that ignores runtime deps, prioritizing link dependencies; this >> appears to also be what prior discussion pointed towards, see more >> details in that 2nd email with the actual code patch. > > I wonder if it makes sense to disentangle this (desirable) functional > change from the rest (which sould be purely an optimization). By "functional change" here, are you referring to the testing framework, or the described ld.so destructor behavior I described above? > Is it even necessary to re-sort on dlclose? Is the original dependency > order available somewhere? Then we could make it explicit that the > destructor order is the reverse of the constructor order (for the > objects unloaded). Or is there a corner case which causes an expected > divergence? Dynamic loaded objects could add more relocation dependencies, and thus augment the dependency relations (by adding more constraints), so a final sort should still be required. Thanks, Chung-Lin