From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id n48QAFto+WDGFwAAWB0awg (envelope-from ) for ; Thu, 22 Jul 2021 08:45:15 -0400 Received: by simark.ca (Postfix, from userid 112) id DBE651EDFB; Thu, 22 Jul 2021 08:45:14 -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=ham 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 0A1061E4A3 for ; Thu, 22 Jul 2021 08:45:13 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A578B3888C46 for ; Thu, 22 Jul 2021 12:45:12 +0000 (GMT) Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id 4BFF5385AC33 for ; Thu, 22 Jul 2021 12:45:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4BFF5385AC33 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-wm1-x32f.google.com with SMTP id z8-20020a1c4c080000b029022d4c6cfc37so1458698wmf.5 for ; Thu, 22 Jul 2021 05:45:00 -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=Sg6hm7gqbvqsNRBkk/8Pgg5xIGmTbTumujLsRC3O/4M=; b=KPvC3oWIi6NeGVJ54Fq6XMgASMKue3wXmS91SnVoAYe0t2/y+DVWiEDHW1o8Dk0M5w 3Tk5rH2Mgjakv9jCkYxbSSaIwphL77OxtVfMBuIC/M1aOc4ymt1IhkSK2q+wqDysIcp+ +05ulkj18EcMbAo1bM2XhVpFJQL9ULpecA3o49Xb6ZWVpF82ZE2Kuu2fw4ZaSDPA2Z2S ZxxAODIusKFwZCzJsjUro3DHLtJWY8o3Oa+taLiU/NRNqROyY2ypb/8SZ8WnXNSLsHi3 uXwH3LgSque7stgY2bUAEmrs0Lw/Fjqj4y6pKStzwAfqa0dgejTgxHe8RGbOKlDvosJw P90g== 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=Sg6hm7gqbvqsNRBkk/8Pgg5xIGmTbTumujLsRC3O/4M=; b=A82S7g6JedJtRlE8W99h+GMfgRwSUpsH4dNr5yphlQUHS94iKc1Xzl0ffmDuhveYkd RIQl+Ld7uK0oOT2OI5Q4496x5Ce0xawOmUetaZFUQNciYVPOSs8UvhLC0NcGMHJdEEBC trE+NHY8AzMhtrEIbZQR5RcxwbtNDbmYtp4UQJLOPDmVLiP4twr7h+KV6HmcRYQI+VsV apJVwj3hdOElB0RmFKDSeyU3Dino9r9lKkmsNZLkpFUdk5KT07pzA5dKpxiY8GJTru/1 SIU8UnmFBXPXUjOq926cEa9CHkkLpNtQ02/dqVcw7AiEximNqNua31eXSvNoXMc7bhO1 MsZA== X-Gm-Message-State: AOAM531KK07tmnAfG0fbNWe6ajqBBxPI6XK8FAlo5KBzdnMGR7pxv+j7 PQnywz4io2SsBT7UT+njVJYnmA== X-Google-Smtp-Source: ABdhPJwpMSJ1UxraHun0PF1J7AaifDjeVREnjh97zO3jqOqTqEvlgnWQg93rvxhCRYg8F+IHfhDYGQ== X-Received: by 2002:a05:600c:4108:: with SMTP id j8mr8793179wmi.67.1626957899409; Thu, 22 Jul 2021 05:44:59 -0700 (PDT) Received: from localhost (host86-161-16-194.range86-161.btcentralplus.com. [86.161.16.194]) by smtp.gmail.com with ESMTPSA id z11sm29660451wru.65.2021.07.22.05.44.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 05:44:59 -0700 (PDT) Date: Thu, 22 Jul 2021 13:44:57 +0100 From: Andrew Burgess To: Bernd Edlinger Subject: Re: [PATCH] Fix the crash at the end of the runtest Message-ID: <20210722124457.GC1872618@embecosm.com> References: 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: 13:37:20 up 5 days, 23:11, 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" * Bernd Edlinger [2021-07-22 13:10:11 +0200]: > due to unknown reasons the runtest process crashes > at the end of the testrun when this script is > executed. > > #0 0x00007fe176cd8b69 in exp_close (interp=interp@entry=0x5595b70269d0, esPtr=0x5595bb6968b0) at exp_command.c:370 > #1 0x00007fe176ceef9a in exp_close_all (interp=0x5595b70269d0) at exp_chan.c:582 > #2 0x00007fe176bd5b72 in InvokeExitHandlers () at ./generic/tclEvent.c:911 > #3 0x00007fe176bd5c0a in Tcl_Exit (status=1) at ./generic/tclEvent.c:976 > #4 0x00007fe176cdb959 in Exp_ExitObjCmd (clientData=, interp=0x5595b70269d0, objc=, objv=) at exp_command.c:2531 > #5 0x00007fe176b4d5f2 in TclNRRunCallbacks (interp=interp@entry=0x5595b70269d0, result=0, rootPtr=0x0) at ./generic/tclBasic.c:4492 > #6 0x00007fe176b4cfc5 in Tcl_EvalObjv (interp=interp@entry=0x5595b70269d0, objc=objc@entry=1, objv=objv@entry=0x5595b70342d0, flags=flags@entry=2097168) at ./generic/tclBasic.c:4215 > #7 0x00007fe176b4e924 in TclEvalEx (interp=interp@entry=0x5595b70269d0, script=0x5595b70ade40 "# runtest.exp -- Test framework driver\n# Copyright (C) 1992-2016 Free Software Foundation, Inc.\n#\n# This file is part of DejaGnu.\n#\n# DejaGnu is free software; you can redistribute it and/or modify it"..., numBytes=, flags=flags@entry=0, line=1908, line@entry=1, clNextOuter=clNextOuter@entry=0x0, outerScript=0x5595b70ade40 "# runtest.exp -- Test framework driver\n# Copyright (C) 1992-2016 Free Software Foundation, Inc.\n#\n# This file is part of DejaGnu.\n#\n# DejaGnu is free software; you can redistribute it and/or modify it"...) at ./generic/tclBasic.c:5361 > #8 0x00007fe176c08f79 in Tcl_FSEvalFileEx (encodingName=, pathPtr=0x5595b7063510, interp=0x5595b70269d0) at ./generic/tclIOUtil.c:1824 > #9 Tcl_FSEvalFileEx (interp=0x5595b70269d0, pathPtr=0x5595b7063510, encodingName=) at ./generic/tclIOUtil.c:1724 > #10 0x00007fe176c0784c in Tcl_EvalFile (interp=0x5595b70269d0, fileName=) at ./generic/tclIOUtil.c:424 > #11 0x00007fe176ce856e in exp_interpret_cmdfilename (interp=0x5595b70269d0, filename=0x7fff61eef573 "/usr/share/dejagnu/runtest.exp") at exp_main_sub.c:953 > #12 0x00005595b6cad2e9 in main (argc=4, argv=0x7fff61eeee38) at exp_main_exp.c:48 > > This started after > commit 9edb1e0191e ("gdb/testsuite: capture GDB tty name in default_gdb_spawn") > > Temporarily renaming builtin_spawn to spawn fixes the issue. > > 2021-07-22 Bernd Edlinger > > * gdb.base/gnu-debugdata.exp (pipeline): Temporarily undo the effect of > commit 9edb1e0191e in this function. Weirdly, when I try to run this test (without your patch) I see this error (passing -v in RUNTESTFLAGS): spawn -open file11 failed, 1 can't unset "::last_spawn_tty_name": no such variable, can't unset "::last_spawn_tty_name": no such variable while executing "unset ::last_spawn_tty_name" (procedure "spawn" line 7) invoked from within "spawn -ignore SIGHUP -leaveopen file11" invoked from within "catch "spawn -ignore SIGHUP -leaveopen $id" result2" result is -1 {spawn failed} run_on_host failed: spawn failed It appears to be choking on the call to unset in: proc spawn_capture_tty_name { args } { set result [uplevel builtin_spawn $args] upvar spawn_out spawn_out if { [info exists spawn_out] } { set ::last_spawn_tty_name $spawn_out(slave,name) } else { unset ::last_spawn_tty_name } return $result } as ::last_spawn_tty_name has never previous been set. And indeed, I am seeing runtest crash as you say. However, I applied this patch: ----- PATCH START ----- diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index e79e0622f9d..deab2420075 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -2031,7 +2031,7 @@ proc spawn_capture_tty_name { args } { upvar spawn_out spawn_out if { [info exists spawn_out] } { set ::last_spawn_tty_name $spawn_out(slave,name) - } else { + } elseif { [info exists ::last_spawn_tty_name] } { unset ::last_spawn_tty_name } return $result ----- PATCH END ----- And I can now run the test successfully, and I'm not seeing runtest crash any more. Can you confirm you see the same behaviour? Thanks, Andrew > --- > Hi, > > Is this OK for trunk, and the gdb-11-branch? > > > Thanks > Bernd. > > gdb/testsuite/gdb.base/gnu-debugdata.exp | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/gdb/testsuite/gdb.base/gnu-debugdata.exp b/gdb/testsuite/gdb.base/gnu-debugdata.exp > index f6d0cd7..0dc8191 100644 > --- a/gdb/testsuite/gdb.base/gnu-debugdata.exp > +++ b/gdb/testsuite/gdb.base/gnu-debugdata.exp > @@ -52,11 +52,20 @@ proc pipeline {test args} { > } > verbose "cooked args are [list $program $arguments $input $output]" > > + # undo the effect of spawn_capture_tty_name > + # this avoids a crash at the end of the test run > + rename spawn dummy_spawn > + rename builtin_spawn spawn > + > if {[run_on_host "$test - invoke $program" $program $arguments \ > $input $output]} { > return -1 > } > > + # restore the original spawn script > + rename spawn builtin_spawn > + rename dummy_spawn spawn > + > set input_file $output > } > return 0 > -- > 1.9.1