From patchwork Mon Oct 16 12:49:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 23608 Received: (qmail 125146 invoked by alias); 16 Oct 2017 12:49:45 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 124652 invoked by uid 89); 16 Oct 2017 12:49:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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, 16 Oct 2017 12:49:43 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 28DA3806B8; Mon, 16 Oct 2017 12:49:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 28DA3806B8 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.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 593165D6A9; Mon, 16 Oct 2017 12:49:41 +0000 (UTC) Subject: Re: [pushed 8.0-branch] [Bug server/22137] gdbserver crashes on hosts with pkru register To: "Tedeschi, Walfred" , "gdb-patches@sourceware.org" References: From: Pedro Alves Message-ID: <4e1810f2-a6cd-1c80-bdc6-6588e8759246@redhat.com> Date: Mon, 16 Oct 2017 13:49:40 +0100 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: On 10/16/2017 09:30 AM, Tedeschi, Walfred wrote: >> -----Original Message----- >> From: palves at redhat dot com [mailto:sourceware- >> bugzilla@sourceware.org] >> Sent: Friday, October 13, 2017 11:06 AM >> To: Tedeschi, Walfred >> Subject: [Bug server/22137] gdbserver crashes on hosts with pkru register >> >> https://sourceware.org/bugzilla/show_bug.cgi?id=22137 >> >> Pedro Alves changed: >> >> What |Removed |Added >> ---------------------------------------------------------------------------- >> Status|UNCONFIRMED |NEW >> Last reconfirmed| |2017-10-13 >> Ever confirmed|0 |1 >> >> --- Comment #3 from Pedro Alves --- >>> Bug is confirmed. >> >> Updating status then. Waldfred, if your account doesn't let you do that >> yourself, please let me know. >> >> And, I believe the bug is fixed in both master and 8.0 branch, right? >> > Hello Pedro, > > I have pushed this one to 8.0 branch. In Master it does not apply anymore. Yes, you had fixed it in commit 1b7fa39ed9678fded7264636c1e5cc14c6d6ebc6 Author: Walfred Tedeschi AuthorDate: Wed Sep 20 15:24:47 2017 +0200 [OBV] amd64-features-makefile: add missing backslash. In an old commit the backslash of was missing in the rule for creating the i386-avx-mpx-avx512-pku.dat file. No need to regenerate the files, this was done by another commit from Yao. Note that if you mention the PR number in the commit log (which happens if you put the PR number in the ChangeLog entry, given the ChangeLog is pasted in the commit log too), then the bug in bugzilla is automatically updated to refer to the commit. > I also couldn't compile master: > ../../../binutils-gdb/gdb/probe.c: In function \u2018void parse_probes_in_pspace(const probe_ops*, program_space*, const char*, const char*, const char*, std::vector*)\u2019: > ../../../binutils-gdb/gdb/probe.c:68:12: error: types may not be defined in a for-range-declaration [-Werror] > for (struct probe *probe : probes) > ^~~~~~ > ../../../binutils-gdb/gdb/probe.c: In function \u2018VEC_probe_p* find_probes_in_objfile(objfile*, const char*, const char*)\u2019: > ../../../binutils-gdb/gdb/probe.c:213:8: error: types may not be defined in a for-range-declaration [-Werror] > for (struct probe *probe : probes) > ^~~~~~ > > Are you aware of it? Yes, it's a GCC bug: https://sourceware.org/ml/gdb-patches/2017-09/msg00270.html What is your gcc version? I don't see this myself, but I know that Keith also ran into this recently. If it's easy to work around it, I don't see why not. Does this work for you? From 9c7590f2ea94930fd9280a6d66610edd53c0bb16 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Mon, 16 Oct 2017 13:39:12 +0100 Subject: [PATCH] fix --- gdb/probe.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gdb/probe.c b/gdb/probe.c index b3dbf89..f657548 100644 --- a/gdb/probe.c +++ b/gdb/probe.c @@ -65,23 +65,23 @@ parse_probes_in_pspace (const struct probe_ops *probe_ops, const std::vector &probes = objfile->sf->sym_probe_fns->sym_get_probes (objfile); - for (struct probe *probe : probes) + for (probe *pro : probes) { - if (probe_ops != &probe_ops_any && probe->pops != probe_ops) + if (probe_ops != &probe_ops_any && pro->pops != probe_ops) continue; - if (provider && strcmp (probe->provider, provider) != 0) + if (provider && strcmp (pro->provider, provider) != 0) continue; - if (strcmp (probe->name, name) != 0) + if (strcmp (pro->name, name) != 0) continue; symtab_and_line sal; - sal.pc = get_probe_address (probe, objfile); + sal.pc = get_probe_address (pro, objfile); sal.explicit_pc = 1; sal.section = find_pc_overlay (sal.pc); sal.pspace = search_pspace; - sal.probe = probe; + sal.probe = pro; sal.objfile = objfile; result->push_back (std::move (sal));