From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id bkU3IOV/QmDHGAAAWB0awg (envelope-from ) for ; Fri, 05 Mar 2021 14:00:53 -0500 Received: by simark.ca (Postfix, from userid 112) id 72B2A1EF78; Fri, 5 Mar 2021 14:00:53 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9E3601E54D for ; Fri, 5 Mar 2021 14:00:52 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1B59F39A5C35; Fri, 5 Mar 2021 19:00:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1B59F39A5C35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614970852; bh=gq5CwnsXXSstgOBmbZYUcuzFzBA8djnrxiKYyvv+jhs=; h=To:Subject:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=W5LUVy1ts4FGVGuLUXZNu9MqrKlGXMynWxnmZDkGJl5k2PB0hIVyhmphdv9dTZT6M jIPNWCuEh2ovj1894SHLMQAEIgthaHad5+GEu23lzEhqm1SAmkPh1d9n6RBFydKt3z al+/A5texk38/yc+2tVKc+bwolpM2zXGPrH0HRgc= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 37A9D3846454 for ; Fri, 5 Mar 2021 19:00:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 37A9D3846454 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-337-IN8ifQzgOFu-4krJnNeiaA-1; Fri, 05 Mar 2021 14:00:45 -0500 X-MC-Unique: IN8ifQzgOFu-4krJnNeiaA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 21DFE26860; Fri, 5 Mar 2021 19:00:44 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-113-208.ams2.redhat.com [10.36.113.208]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 142F61002382; Fri, 5 Mar 2021 19:00:42 +0000 (UTC) To: Simon Marchi Subject: Re: [PATCH] nptl: Move stack list variables into _rtld_global References: <87a6vlthqn.fsf@oldenburg2.str.redhat.com> <0f7bf7d7-36f9-ce7f-0390-4b39eeb0fffc@polymtl.ca> <87zgzhbjy0.fsf@oldenburg.str.redhat.com> <87mtvhbhqw.fsf@oldenburg.str.redhat.com> Date: Fri, 05 Mar 2021 20:00:52 +0100 In-Reply-To: (Simon Marchi's message of "Fri, 5 Mar 2021 13:45:19 -0500") Message-ID: <871rctbf2z.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Florian Weimer via Gdb-patches Reply-To: Florian Weimer Cc: Simon Marchi via Libc-alpha , gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" * Simon Marchi: >>> If we have to deal with this, I guess that GDB should now do things in a >>> different order: go through the whole library list and load their >>> symbols. And then if one of those libraries were libpthread, try to >>> initialize libthread_db. >> >> Initialization of libthread_db should be unconditional. Programs use >> TLS data without linking against libpthread. And glibc 2.34 might not >> have a separate libpthread at all. > > Ok, currently GDB attempts to load libthread_db when noticing the main > objfile / program (I guess it is needed if the program is statically > linked to libpthread?) or when seeing a library named libpthread*. Would it be possible to load libthread_db unconditionally after loading all shared objects? Then it is loaded only once. > About the hypothetical scenario for glibc 2.34: do you mean that the > pthread infrastructure will directly be in libc.so? If so, our current > strategy of attempting to load libthread_db only for the main program > or a libpthread* library will indeed not work. And I suppose that will > also require trying to load libthread_db on every new shared lib... I think one attempt loading is enough, after all shared objects are available. In both the attaching and starting case, libpthread will be seen by libthread_db if it is there. I do not think it is necessary to try loading libpthread_db again for each dlopen. Maybe you could restrict that to trigger on libpthread, but then dlopen of libpthread does not really work today. Thanks, Florian