From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@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 ; 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 To: Edjunior Machado Cc: GDB Patches Subject: Re: ppc64* native-gdbserver testsuite hangs on gdb.threads/process-dies-while-handling-bp.exp References: Date: Tue, 19 Dec 2017 17:51:00 -0000 In-Reply-To: (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 X-SW-Source: 2017-12/txt/msg00434.txt.bz2 Yao Qi 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=3Don: > cond_bp_target=3D0: 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. --=20 Yao (=E9=BD=90=E5=B0=A7) =46rom ef027cdb366e3000dee2c713abab4f30123d9ed1 Mon Sep 17 00:00:00 2001 From: Yao Qi 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 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 +=3D sizeof (PTRACE_XFER_TYPE); if (errno !=3D 0) - error ("reading register %d: %s", regno, strerror (errno)); + { + /* Mark register REGNO unavailable. */ + supply_register (regcache, regno, NULL); + return; + } } =20 if (the_low_target.supply_ptrace_register)