From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127474 invoked by alias); 8 Nov 2017 18:41:55 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 126576 invoked by uid 89); 8 Nov 2017 18:41:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=Interesting, company, held X-Spam-User: qpsmtpd, 3 recipients X-HELO: 19pmail.ess.barracuda.com Received: from 19pmail.ess.barracuda.com (HELO 19pmail.ess.barracuda.com) (64.235.150.244) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Nov 2017 18:41:53 +0000 Received: from MIPSMAIL01.mipstec.com (mailrelay.mips.com [12.201.5.28]) by mx4.ess.sfj.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Wed, 08 Nov 2017 18:40:52 +0000 Received: from [10.20.78.183] (10.20.78.183) by mips01.mipstec.com (10.20.43.31) with Microsoft SMTP Server id 14.3.361.1; Wed, 8 Nov 2017 10:39:02 -0800 Date: Wed, 08 Nov 2017 18:41:00 -0000 From: "Maciej W. Rozycki" To: Pedro Alves , Adhemerval Zanella CC: Djordje Todorovic , , , "nemanja.popov@rt-rk.com" , , "Ananthakrishna Sowda (asowda)" , Nikola Prica , Subject: Re: [PATCH 0/3] Fix issues with writing Linux core PRSTATUS note on MIPS o32, n32 and n64 into core file In-Reply-To: <9461a925-363c-cc90-0a01-298da75ae00e@redhat.com> Message-ID: References: <74618d56-fa31-4cfe-329f-6a9078bac92b@rt-rk.com> <724f0bc9-6744-a915-d19d-77db7e9ce514@rt-rk.com> <64ad38a4-b8ae-912e-45d6-7048135ada2e@rt-rk.com> <9461a925-363c-cc90-0a01-298da75ae00e@redhat.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-BESS-ID: 1510166450-298555-989-106348-2 X-BESS-VER: 2017.12-r1710252241 X-BESS-Apparent-Source-IP: 12.201.5.28 X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.186725 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS59374 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status:1 X-SW-Source: 2017-11/txt/msg00184.txt.bz2 On Wed, 8 Nov 2017, Pedro Alves wrote: > > So I have looked into it now and tracked down `libthread_db' rather > > than GDB to be the component requiring PID retrieval from a core file > > for TLS access to work, and then only before glibc commit c579f48edba8 > > ("Remove cached PID/TID in clone"), which was first included in 2.25 > > glibc release. > > > > Given I have been using recent glibc checkouts for MIPS verification I > > avoided the requirement, but I was indeed able to reproduce it natively > > with x86-64 and the system-supplied `libthread_db', and then with my > > MIPS environment as well, once I went with my glibc build back to commit > > c579f48edba8^. > > > > I will be adding a reference to said glibc commit when pushing your 2/3 > > change. > > Interesting, hadn't realized libthread_db stopped requiring this. > I wonder whether it'd be a good idea to mention it in the code itself > too, say, in proc-service.:ps_getpid. This might not be the best place. Calls to `ps_getpid' are still made from places throughout `libthread_db', and it's only one from `td_ta_thr_iter' (which matters here) whose result is discarded, by only passing it down to `iterate_thread_list' to become its ignored `match_pid' argument. This looks like an oversight of some kind to me, which Adhemerval might be able to shed some light on. Adhemerval, in your commit referred above, corresponding to the change held at: , you made the `match_pid' argument of `iterate_thread_list' unused. The function is static, called from `td_ta_thr_iter' only (and I actually wonder why the build does not trip on an unused argument here). Is it OK then to remove the argument then along with the `ps_getpid' call in `td_ta_thr_iter' used to set the corresponding parameter, or is there something missing from there you intended to do and `match_pid' was meant to remain used? NB I would post a clean-up proposal, but regrettably my company FSF copyright assignment status is in a limbo state right now, after the transition from Imagination to the new MIPS company, and I'd rather not block the cleanup by posting a patch that cannot move forward. Or would it be small enough to qualify as not needing an assignment? Hmm... As to choosing the right place to comment on this `libthread_db' semantics change, I think either the call to `bfd_core_file_pid' made from `add_to_thread_list' in corelow.c or the heading of the latter function might be better, as this is where the consumer of BFD's core file data PID is. Adding a comment like this might be small/trivial enough for me to sneak in while the FSF paperwork is still pending. Maciej