From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id GlkHK1rkYWAlSQAAWB0awg (envelope-from ) for ; Mon, 29 Mar 2021 10:29:46 -0400 Received: by simark.ca (Postfix, from userid 112) id A0CD51E965; Mon, 29 Mar 2021 10:29:46 -0400 (EDT) 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 003751E590 for ; Mon, 29 Mar 2021 10:29:46 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ACCE83851C1D; Mon, 29 Mar 2021 14:29:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ACCE83851C1D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1617028185; bh=0Qwq+mp6WmtyfLJftnf9Na+IqtEockbmwy0CY3vPlgw=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=QHpgvOtRqKhHf5WvBZxuaM+3IfoZY9GLZsLd/9RpLcDPHYdOcRkM5gRydMN3nn5ME vp7Ugsk2BhzA8cyl0vzdGjnrpPX+c3RL7GsnGNzxxiRTLcaAfI2bjSGoQSIDkAk62Y lUQcHceGxQRTYOdr7aHPGE0fDv7dRiC7oRd/zlKk= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 0821F385E449; Mon, 29 Mar 2021 14:29:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0821F385E449 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 12TETZAg028625 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Mar 2021 10:29:40 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 12TETZAg028625 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id C90EE1E590; Mon, 29 Mar 2021 10:29:34 -0400 (EDT) Subject: Re: [PATCH] nptl: Move stack list variables into _rtld_global To: Florian Weimer , gdb-patches@sourceware.org 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> <871rctbf2z.fsf@oldenburg.str.redhat.com> <87a6qmwejx.fsf@mid.deneb.enyo.de> Message-ID: <8475264b-5986-6288-fd83-0eacb8934a8b@polymtl.ca> Date: Mon, 29 Mar 2021 10:29:34 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <87a6qmwejx.fsf@mid.deneb.enyo.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 29 Mar 2021 14:29:35 +0000 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: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: Simon Marchi via Libc-alpha Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2021-03-29 4:26 a.m., Florian Weimer wrote:> * Florian Weimer via 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. > > I would appreciate if we could make some progress on this issue. > Please let me know if you need glibc test builds or something in that > area. Thanks. Hi Florian, I'll try to look into it, but I can't promise anything as I have nearly zero free / personal time for GDB these days. Simon