From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15266 invoked by alias); 18 Sep 2017 14:28:48 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 14544 invoked by uid 89); 18 Sep 2017 14:28:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=airplane, Hx-languages-length:1467, expedient, H*M:4811 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 18 Sep 2017 14:28:46 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 93F0F80B2A; Mon, 18 Sep 2017 14:28:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 93F0F80B2A Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves@redhat.com Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id F1AA5600C2; Mon, 18 Sep 2017 14:28:38 +0000 (UTC) Subject: Re: Using libthread_db.so with single-threaded programs, for TLS access To: Carlos O'Donell , Zack Weinberg References: <20170622224456.1358-1-zackw@panix.com> <9490d183-a57b-b336-3131-6580e4773818@redhat.com> <2f28f69b-406f-65e5-40e1-ae65632ea4f0@redhat.com> <1d38297f-f430-ca73-6d3f-a67144d08eea@redhat.com> <7348d7d9-b339-b14f-3dea-31d17c996a2a@redhat.com> <4ed368f7-4469-4a49-c4e3-0c3afc18c121@redhat.com> <2432779a-f146-1612-236e-84dde15c5d01@redhat.com> <72a8ac9b-2429-c8bd-83b9-d758224571c5@redhat.com> Cc: GNU C Library , gdb@sourceware.org From: Pedro Alves Message-ID: <1a3e9769-4811-5838-7948-72ad1087fa2e@redhat.com> Date: Mon, 18 Sep 2017 14:28:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-09/txt/msg00045.txt.bz2 Hi Carlos, On 09/18/2017 02:17 PM, Carlos O'Donell wrote: > On 09/13/2017 06:02 PM, Pedro Alves wrote: > From the glibc side I think your patch goes in a very desirable direction. > We want this to look the same if there is one thread (main thread 0) or > more than one thread. Therefore the abstraction is valuable. Great to hear, thanks! > At the implementation level I would want to see the changes to dl-tls.c > much more restricted. Including db_info.c seems like just an expedient > airplane hack. We need a cleaner way to define the symbols you need. Yeah, I was aiming for the "minimal viable product", and just followed what nptl/pthread_create.c does. It's possible that we could trim the defined symbols, I haven't looked much beyond the surface. I suspect that nptl/pthread_create.c includes ../nptl_db/db_info.c directly for static links (-static). I.e., so that the thread_db-related symbols are defined (and are only defined) with programs that call pthread_create. It's possible that my prototype breaks -static linking with multiple definition errors, I haven't tried it. > > So the patch isn't ready, but the idea is solid. I don't have time to look > at this right now, but I will in maybe a month (yes my queue is that deep > right now). Likewise. If someone more familiar with glibc internals wants to run with this, they're more than welcome. Thanks, Pedro Alves