From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 6GKeJbFw+WCZUAAAWB0awg (envelope-from ) for ; Thu, 22 Jul 2021 09:20:49 -0400 Received: by simark.ca (Postfix, from userid 112) id 973FD1EDFB; Thu, 22 Jul 2021 09:20:49 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_SIGNED, MAILING_LIST_MULTI,RDNS_DYNAMIC,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4F45C1E79C for ; Thu, 22 Jul 2021 09:20:49 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B1794383B423 for ; Thu, 22 Jul 2021 13:20:48 +0000 (GMT) Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id 1E4B9385E445 for ; Thu, 22 Jul 2021 13:20:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1E4B9385E445 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wr1-x42a.google.com with SMTP id t5so5904648wrw.12 for ; Thu, 22 Jul 2021 06:20:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ekbgq3GbCx9jOleDIcb9URFh5um9utoQEqyfZAjZYtw=; b=SapRzVZ67kfvDIPfIX0jGh9Ibb+UhnZC1gjCgrzh7UwDmnKjeEk0RMTuUj9DnSlW9x ma+VyCRPXwgwbd/wNu3P6wpbFxeWUQHK3Bfpt5TjRC2PKDGOnRzOUyah8cYeHCVRHEoC K15IdiOkR12CTlWLUr47j4IBooJs/uuZ/yKpfPLjjcX6rbiS6ZNFpqjRZgr9ADoFUlHH uurAtCVMk4bJcCYlkDqs7tktgobfxdmMX10H7buig7AiOQ4rU5S32FJWXnr3c5ljn11Q 8MHDP6bip4QVzhCFBotZFckdjYLup6atqZQhnVceQvbnx6EG+yNtDx9/hfQ45XycrCZl W0fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ekbgq3GbCx9jOleDIcb9URFh5um9utoQEqyfZAjZYtw=; b=mMQ3kDWP5C3YHBaaGN2dC6Bt+fwXrq6horB4bWsXLmCSFpa8Gf94ooGeEAj51ForAd xWzbGrJ4cmPPuTQb7oGgvypeLIf3KtjrhGZEhIrgogelaUqojkT5J77aCQrfn5Fk58x2 EKtUXqKNmCxdsEo228i1EJHlp4VhtL8i20YBSV7ClosO1fmRVGqpdjdia6yOZreOm6U/ j55sFOskm2INoPZjjVwajjD89jiDE64oU5JAG+RYsIuB1UWj1Gn+OKpB4lTVYytnAtO3 GpnWolgOFWwoPRQpcYm2Fepv/KVT627SrFc4O+xCbp7ffNrBR5wr8mLgVUaa5KlRAKWW XkTA== X-Gm-Message-State: AOAM532dY/UuoCEfKWW69Gwd7REjrEdDTnTyJdnibBq/5S2aJDm1B+hZ FwYwWfl6zYVL4C9ZaH3Tp73xIA== X-Google-Smtp-Source: ABdhPJwNYEd4Zh8zL4qK0a3tzOnLFWXhYGItP3fKzqqJ6mcXUQZx7U9Z491RVieo0YyXuBiwa2Y3Qw== X-Received: by 2002:adf:eec5:: with SMTP id a5mr47842923wrp.317.1626960022184; Thu, 22 Jul 2021 06:20:22 -0700 (PDT) Received: from localhost (host86-161-16-194.range86-161.btcentralplus.com. [86.161.16.194]) by smtp.gmail.com with ESMTPSA id d14sm30191645wrs.49.2021.07.22.06.20.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 06:20:21 -0700 (PDT) Date: Thu, 22 Jul 2021 14:20:20 +0100 From: Andrew Burgess To: Bernd Edlinger Subject: Re: [PATCH] Fix the crash at the end of the runtest Message-ID: <20210722132020.GD1872618@embecosm.com> References: <20210722124457.GC1872618@embecosm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux/5.8.18-100.fc31.x86_64 (x86_64) X-Uptime: 14:19:24 up 5 days, 23:53, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "gdb-patches@sourceware.org" Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Here's my proposed fix, along with an explanation of what's going on. Thanks, Andrew --- commit c6d3cd6e265dd39a27d13428eba48df8c1d50c95 Author: Andrew Burgess Date: Thu Jul 22 14:07:15 2021 +0100 gdb/testsuite: don't error when trying to unset last_spawn_tty_name In spawn_capture_tty_name (lib/gdb.exp) we either set or unset last_spawn_tty_name depending on whether spawn_out exists or not. One situation that might cause spawn_out to not exists is if the spawn function is called with the argument -leaveopen, which is how it is called when processes are created as part of a pipeline, the created process has no tty, instead its output is written to a file descriptor. If a pipe line is created consisting of multiple processes then there will be multiple sequential calls to spawn, all using -leaveopen. The first of these calls is fine, no spawn_out is set, and so in spawn_capture_tty_name we unset last_spawn_tty_name. However, on the second call to spawn there is still no spawn_out and so in spawn_capture_tty_name we again try to unset last_spawn_tty_name, this now throws an error. Fix this issue by using -nocomplain with the call to unset in spawn_capture_tty_name. Before this commit I was seeing gdb.base/gnu-debugdata.exp report 1 pass, and 1 unsupported test. After this commit I now see 16 passes from this test script. diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index e79e0622f9d..8712669bdce 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -2032,7 +2032,7 @@ proc spawn_capture_tty_name { args } { if { [info exists spawn_out] } { set ::last_spawn_tty_name $spawn_out(slave,name) } else { - unset ::last_spawn_tty_name + unset -nocomplain ::last_spawn_tty_name } return $result }