Message ID | 86o9mu8v32.fsf@gmail.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 67478 invoked by alias); 19 Dec 2017 17:51:39 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 67467 invoked by uid 89); 19 Dec 2017 17:51:37 -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, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=HX-Received:10.99.111.11 X-HELO: mail-pf0-f182.google.com Received: from mail-pf0-f182.google.com (HELO mail-pf0-f182.google.com) (209.85.192.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 19 Dec 2017 17:51:36 +0000 Received: by mail-pf0-f182.google.com with SMTP id p84so11440800pfd.3 for <gdb-patches@sourceware.org>; Tue, 19 Dec 2017 09:51:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=/gKw/tH+Js2tOEXb0z8cd2CEZ4/bKjCj5lPs7hMF9ew=; b=Bd8NDih0BcsE6n3+1SVMVYBfy7bh2XW22Ex5NzfOAgbQR1NLYSFZvbMu0d/uzVv2MX hJ986BzJSCbRjO6cayf8JERK6unFMIpjRAq1IewvSQpxnDQ1Wlg8+BOodg/adFIHOtUF JoYvhkrn9peuSDnrBw5eXjkuO4+TwfZ2rMGXfHKizmUSkdWrV8cx9a9/DB4hyGPpHeki AQXNyXsoa5oy0ar3C28g/7Ex26OQq0y4K8VtM/q218RsyC+j2KlvDPYhJV+Jhla27IkE lxJnpV5WJnXUAVGpjQI2LhI2zFngZGnKN1zykuwXrApdarzTIpeobbVWvJl6jReqfx4Z Vrcg== X-Gm-Message-State: AKGB3mLmnRd7Qf1kb3h2d8d3/CVAxEjNvEIy3epgDXyco5J01KuVaHWF 3qvtfHHxkEcgYaYhgpWLZzcdZQ== X-Google-Smtp-Source: ACJfBotey4Z/c2nuYTTxMp/uZtbbIggycI9bJqVAGyRNnzch+WN33/sgS0rL9U9GwYRzfpmCcdjLjQ== X-Received: by 10.99.111.11 with SMTP id k11mr3744462pgc.251.1513705894879; Tue, 19 Dec 2017 09:51:34 -0800 (PST) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id h81sm33945565pfh.119.2017.12.19.09.51.33 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 19 Dec 2017 09:51:34 -0800 (PST) From: Yao Qi <qiyaoltc@gmail.com> To: Edjunior Machado <edjunior@gmail.com> Cc: GDB Patches <gdb-patches@sourceware.org> Subject: Re: ppc64* native-gdbserver testsuite hangs on gdb.threads/process-dies-while-handling-bp.exp References: <CAJJrRvag0nc6_HAWrPAkGZQ9eD4RFqiTUz=10Zgf97byWEdeWg@mail.gmail.com> <CAH=s-PO2vN4Gahajo5rNfSeSWRJsAEf_5r3yz-2Yw5jsMrXVaw@mail.gmail.com> Date: Tue, 19 Dec 2017 17:51:29 +0000 In-Reply-To: <CAH=s-PO2vN4Gahajo5rNfSeSWRJsAEf_5r3yz-2Yw5jsMrXVaw@mail.gmail.com> (Yao Qi's message of "Tue, 19 Dec 2017 16:27:04 +0000") Message-ID: <86o9mu8v32.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes |
Commit Message
Yao Qi
Dec. 19, 2017, 5:51 p.m. UTC
Yao Qi <qiyaoltc@gmail.com> writes: > It is a known issue in GDB, described in PR 18749, rather than a > regression, so git bisect can't tell you anything useful. Pedro fixed > one GDBserver crash caused by 18749, but PR 18749 is still > there. > > I can reproduce the timeout on gcc110, > > KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: > cond_bp_target=0: inferior 1 exited (timeout) (PRMS: gdb/18749) > Remote debugging from host 127.0.0.1^M > gdbserver: reading register 10: No such process^M > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Killing process(es): 15614^M > monitor exit^M > Ignoring packet error, continuing... > > I think some code path in GDBserver doesn't expect this error. Does this patch work for you? With this patch, process-dies-while-handling-bp.exp never timeout on gcc110 with native-gdbserver.
Comments
Hi Yao, thanks a lot for the patch! Testing the fix on Fedora26, confirmed that native-gdbserver no longer hangs on gdb.threads/process-dies-while-handling-bp.exp in both ppc64le and be. Unfortunately, I couldn't regtest running the complete testsuite due to another hang I'm still checking (likely caused by hw watch not working properly on such boxes). Thanks and regards, Edjunior On Tue, Dec 19, 2017 at 6:51 PM, Yao Qi <qiyaoltc@gmail.com> wrote: > Yao Qi <qiyaoltc@gmail.com> writes: > > > It is a known issue in GDB, described in PR 18749, rather than a > > regression, so git bisect can't tell you anything useful. Pedro fixed > > one GDBserver crash caused by 18749, but PR 18749 is still > > there. > > > > I can reproduce the timeout on gcc110, > > > > KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: > > cond_bp_target=0: inferior 1 exited (timeout) (PRMS: gdb/18749) > > Remote debugging from host 127.0.0.1^M > > gdbserver: reading register 10: No such process^M > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > Killing process(es): 15614^M > > monitor exit^M > > Ignoring packet error, continuing... > > > > I think some code path in GDBserver doesn't expect this error. > > Does this patch work for you? With this patch, > process-dies-while-handling-bp.exp never timeout on gcc110 with > native-gdbserver. > > -- > Yao (齐尧) > From ef027cdb366e3000dee2c713abab4f30123d9ed1 Mon Sep 17 00:00:00 2001 > From: Yao Qi <yao.qi@linaro.org> > Date: Tue, 19 Dec 2017 17:44:11 +0000 > Subject: [PATCH] Mark register unavailable when PTRACE_PEEKUSER fails > > As described in PR 18749, GDB/GDBserver may get an error on accessing > memory or register because the thread may disappear. However, some > path doesn't expect the error. This patch fixes this problem by > marking the register unavailable when PTRACE_PEEKUSER fails instead > of throwing error. > > gdb/gdbserver: > > 2017-12-19 Yao Qi <yao.qi@linaro.org> > > PR gdb/18749 > * linux-low.c (fetch_register): Call supply_register instead of > error. > > diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c > index f6a52d5..0a52a91 100644 > --- a/gdb/gdbserver/linux-low.c > +++ b/gdb/gdbserver/linux-low.c > @@ -5555,7 +5555,11 @@ fetch_register (const struct usrregs_info *usrregs, > (PTRACE_TYPE_ARG3) (uintptr_t) regaddr, (PTRACE_TYPE_ARG4) > 0); > regaddr += sizeof (PTRACE_XFER_TYPE); > if (errno != 0) > - error ("reading register %d: %s", regno, strerror (errno)); > + { > + /* Mark register REGNO unavailable. */ > + supply_register (regcache, regno, NULL); > + return; > + } > } > > if (the_low_target.supply_ptrace_register) >
On Wed, Dec 20, 2017 at 3:23 PM, Edjunior Machado <edjunior@gmail.com> wrote: > thanks a lot for the patch! Testing the fix on Fedora26, confirmed that > native-gdbserver no longer hangs on > gdb.threads/process-dies-while-handling-bp.exp in both ppc64le and be. > > Unfortunately, I couldn't regtest running the complete testsuite due to > another hang I'm still checking (likely caused by hw watch not working > properly on such boxes). > Is it gdb.base/watchpoints.exp? My regression test running on gcc110 is very slow, blocked by gdb.base/watchpoints.exp. The test needs two HW watchpoints, but ppc only has one HW watchpoint register. GDB native can do resource counting, so it is smart enough to switch to SW wathcpoint if there is not enough HW watchpoint registers. However, GDB remote can *not* do resource counting, so GDB fails to insert watchpoints, and all the following tests timeout.
On Wed, Dec 20, 2017 at 4:23 PM, Yao Qi <qiyaoltc@gmail.com> wrote: > Is it gdb.base/watchpoints.exp? My regression test running on gcc110 > is very slow, blocked by gdb.base/watchpoints.exp. The test needs two > HW watchpoints, but ppc only has one HW watchpoint register. GDB > native can do resource counting, so it is smart enough to switch to > SW wathcpoint if there is not enough HW watchpoint registers. However, > GDB remote can *not* do resource counting, so GDB fails to insert > watchpoints, and all the following tests timeout. > Looks ppc64-linux gdbserver doesn't support watchpoint, so we need to improve test cases to probe hw watchpoint support. See test "set probe hw watchpoint" in watchpoint-stops-at-right-insn.exp.
Hi Yao, On Wed, Dec 20, 2017 at 10:35 PM, Yao Qi <qiyaoltc@gmail.com> wrote: > On Wed, Dec 20, 2017 at 4:23 PM, Yao Qi <qiyaoltc@gmail.com> wrote: > > Is it gdb.base/watchpoints.exp? My regression test running on gcc110 > > is very slow, blocked by gdb.base/watchpoints.exp. The test needs two > > HW watchpoints, but ppc only has one HW watchpoint register. GDB > > native can do resource counting, so it is smart enough to switch to > > SW wathcpoint if there is not enough HW watchpoint registers. However, > > GDB remote can *not* do resource counting, so GDB fails to insert > > watchpoints, and all the following tests timeout. > > > exactly, gdb.base/watchpoints.exp is the hanging testcase now. > > Looks ppc64-linux gdbserver doesn't support watchpoint, so we need > to improve test cases to probe hw watchpoint support. See > test "set probe hw watchpoint" in watchpoint-stops-at-right-insn.exp. > Agreed, ppc64[le] gdbserver currently does not implement hw watchpoint support; however, despite the high number of failures on the mentioned test (and possibly others) because of that, from what I could git-bisect, it didn't hang the native-gdbserver testrun until commit c65d6b55b3a592906c470c566f57ad8ceacc1605. Thanks and regards, Edjunior > > -- > Yao (齐尧) >
Yao Qi <qiyaoltc@gmail.com> writes: > As described in PR 18749, GDB/GDBserver may get an error on accessing > memory or register because the thread may disappear. However, some > path doesn't expect the error. This patch fixes this problem by > marking the register unavailable when PTRACE_PEEKUSER fails instead > of throwing error. > > gdb/gdbserver: > > 2017-12-19 Yao Qi <yao.qi@linaro.org> > > PR gdb/18749 > * linux-low.c (fetch_register): Call supply_register instead of > error. I pushed it in to master.
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index f6a52d5..0a52a91 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -5555,7 +5555,11 @@ fetch_register (const struct usrregs_info *usrregs, (PTRACE_TYPE_ARG3) (uintptr_t) regaddr, (PTRACE_TYPE_ARG4) 0); regaddr += sizeof (PTRACE_XFER_TYPE); if (errno != 0) - error ("reading register %d: %s", regno, strerror (errno)); + { + /* Mark register REGNO unavailable. */ + supply_register (regcache, regno, NULL); + return; + } } if (the_low_target.supply_ptrace_register)