This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: ppc64* native-gdbserver testsuite hangs on gdb.threads/process-dies-while-handling-bp.exp
- From: Edjunior Machado <edjunior at gmail dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: GDB Patches <gdb-patches at sourceware dot org>
- Date: Wed, 20 Dec 2017 16:23:45 +0100
- Subject: Re: ppc64* native-gdbserver testsuite hangs on gdb.threads/process-dies-while-handling-bp.exp
- Authentication-results: sourceware.org; auth=none
- References: <CAJJrRvag0nc6_HAWrPAkGZQ9eD4RFqiTUz=10Zgf97byWEdeWg@mail.gmail.com> <CAH=s-PO2vN4Gahajo5rNfSeSWRJsAEf_5r3yz-2Yw5jsMrXVaw@mail.gmail.com> <86o9mu8v32.fsf@gmail.com>
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)
>