From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-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-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=corner, resort, functional, H*r:0700 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, 05 Aug 2019 10:39:00 -0000 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 X-SW-Source: 2019-08/txt/msg00072.txt.bz2 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