From owner-svn-src-head@freebsd.org Wed Jul 26 15:23:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 325ACDC05C2; Wed, 26 Jul 2017 15:23:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBF9866B1D; Wed, 26 Jul 2017 15:23:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v6QFNDtx039892 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 26 Jul 2017 18:23:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v6QFNDtx039892 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v6QFNDwj039891; Wed, 26 Jul 2017 18:23:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 26 Jul 2017 18:23:13 +0300 From: Konstantin Belousov To: Michael Zhilin Cc: Eric van Gyzen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Michael Zhilin Subject: Re: svn commit: r318539 - head/lib/libthr/thread Message-ID: <20170726152313.GF1700@kib.kiev.ua> References: <201705191304.v4JD45Sn021851@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jul 2017 15:23:24 -0000 On Wed, Jul 26, 2017 at 06:09:00PM +0300, Michael Zhilin wrote: > Hi Eric, Konstantin, > > This commit breaks libthread_db a bit, particular change is: > -struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX]; > +static struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX]; > > In libthread_db there is check if _thread_keytable is found in symbols of > debugged process: > https://svnweb.freebsd.org/base/head/lib/libthread_db/libthr_db.c?revision=241720&view=markup#l148 > > LOOKUP_SYM(ph, "_thread_keytable", &ta->thread_keytable_addr); > > If symbol is not found, pt_ta_new returns "TD_NOLIBTHREAD", even if process > uses libthr. > It impacts sysutils/pstack port, it doesn't work for multithreaded > processes anymore. > > Eric, Konstantin, > Could you please advise what is best way to fix it: > > - rollback change of "_thread_keytable" (it looks easy) > - or remove "_thread_keytable" from libthread_db > > ? The td_ta_tsd_iter() API implementation for libthr depends on the ability to lookup the symbol. I think that the change should be reverted, it is easiest solution. Perhaps a comment should be added noting that the symbol is used by libthread_db so that the mistake is not repeated.