From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id KsYUB5ts+WAWUAAAWB0awg (envelope-from ) for ; Thu, 22 Jul 2021 09:03:23 -0400 Received: by simark.ca (Postfix, from userid 112) id 0C3521EDFB; Thu, 22 Jul 2021 09:03:23 -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.6 required=5.0 tests=FORGED_MUA_MOZILLA, FREEMAIL_FROM,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.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 746241E79C for ; Thu, 22 Jul 2021 09:03:22 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D030839730FF for ; Thu, 22 Jul 2021 13:03:21 +0000 (GMT) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-oln040092067065.outbound.protection.outlook.com [40.92.67.65]) by sourceware.org (Postfix) with ESMTPS id 4444B383D00E for ; Thu, 22 Jul 2021 12:59:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4444B383D00E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=hotmail.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=hotmail.de ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ut0RdfphmuoAA4ibvPqDY2aEtmexnV19BdSOERRgfqBuw73zY9AXRLZatijyk+3AvfHRUM6K7arkbuPhL62+gajEfeCjUt6gHbXVJbWns2Uqih9dlX0vHVc1KremS5OpD/c4qrA9MDV+Yfee3nr1j52mpJKGK2sixl5ub01olSx4Dn4JXHXLQ/3c/teJAMSlWnvj44O3w9QJeskcF+wRbzl65nalhhg150YbG1WAL4NjE90xoKlxxdYILN8i4Tl+vVN7p4IxLyYJI+Z34VujSFmTLb9mVKxaG5Fzd+IFFGmU4i7QPxy0V80Ndsmczhf+PWAbIkmwGESh9F2eeA0vvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RzHxG60SALUHFOcgcFqHOn0WTxX8XN3hyEz7oVTpeL4=; b=ckPmj/WCF33LmYAJCWrrI98sGMwvDz2TEfERKajigoKuGaHG/vFjQzdmCrAYpYqTop1DUGCbt1hzcOwOHDgcy8u3K4cVlIeb0a3ZwjdksBmLyWE7AH+iwbxwCJ5TZIo/KZB/HRm1j0x9Yl2mF2W/n4+nAZaLBck7UN2sTv6D8xkFxzlQ8OOZRWr3gSSRwRQzEDl9GcQWv2oBHefy7UnJKrdfX4wu/pDjUFn9UAhobe9bPVJusnMwvQ4dwIb7OWFRZbKOpcCYjFtR1U4VWUghBlUra3GbCtzvABX0P5bnv5VoDSsg4KM5R0EhZhJeSaxOTedzWtBFflNIy9pVMXiTaA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from VE1EUR02FT056.eop-EUR02.prod.protection.outlook.com (2a01:111:e400:7e1e::42) by VE1EUR02HT123.eop-EUR02.prod.protection.outlook.com (2a01:111:e400:7e1e::502) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24; Thu, 22 Jul 2021 12:59:14 +0000 Received: from AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM (2a01:111:e400:7e1e::52) by VE1EUR02FT056.mail.protection.outlook.com (2a01:111:e400:7e1e::327) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24 via Frontend Transport; Thu, 22 Jul 2021 12:59:14 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:A3AE4E6D8C5EF0A943A570C46021F1C3813B5365CD3093B77616DC6A8E36C451; UpperCasedChecksum:571C5DB301202696F3B50B9C06BE2566DB74B15343DBEA897EFFC8C634F38E73; SizeAsReceived:7953; Count:48 Received: from AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM ([fe80::3d30:d151:570a:8a16]) by AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM ([fe80::3d30:d151:570a:8a16%7]) with mapi id 15.20.4331.034; Thu, 22 Jul 2021 12:59:14 +0000 Subject: Re: [PATCH] Fix the crash at the end of the runtest To: Andrew Burgess References: <20210722124457.GC1872618@embecosm.com> From: Bernd Edlinger Message-ID: Date: Thu, 22 Jul 2021 14:59:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 In-Reply-To: <20210722124457.GC1872618@embecosm.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TMN: [7iX72Gn8bcHgGZZORNmiS+PYBxYtX4ug] X-ClientProxiedBy: AM0PR02CA0224.eurprd02.prod.outlook.com (2603:10a6:20b:28f::31) To AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:364::23) X-Microsoft-Original-Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.101] (88.76.118.196) by AM0PR02CA0224.eurprd02.prod.outlook.com (2603:10a6:20b:28f::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.26 via Frontend Transport; Thu, 22 Jul 2021 12:59:13 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: c0a5b545-ec72-4bc5-fff9-08d94d1081c9 X-MS-TrafficTypeDiagnostic: VE1EUR02HT123: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lEIeOKNSKz4Jwxi52i4cGns50a0TvrxpJsWcldBWuMh7W6FsPHd+QrgRBgILbgcAONCV9q5sELXtjB0I0d7HWD+crRrmrSAaPhKYnnV88Zk9qHnHBGmKv63SL9zL3V+UcT7vjnrEd9hwiC/Iq0VjD8t7gRagBa3TGQfbi/I+6b7J+dyqaYdkyu2dx/C5sWc1pvPowv2DhkZpvpit0qpVQwKhjyHQ3r/TPOWOWUk8vLdjuhkggk4efCcdO43K0AEoDOh4wjsSTdgr4ikZR8STGDdN0SPjTXmoYEFOIOfuYNXJNc4zTrPjcexkUGG/QdwIRXbLOVVB/AXVQccrlIb00tpCilsHjshTOPfF6y3It0j6gxnihieIF2WqwUn9sb2EuV9IExFx0ewn6r6YCSwL1OYmglFnuxgPKPcBT1KT0vWnENUdYsth/vkGlD5aHZmvE790TAwjzPZuypffRjXqohawuMHr36efIpRJDJqktGs= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6LZ4M5mitXY3i9ala1RELJPCAXvSDegoKup2QGhWZvO/yGh7GCViPyuzDHvjGkPmiBcgWinkXcT4D+ANzoukyYg2rPJFnlfGl4dlaRRfooHV7DIU3QUzSJh0Eko0kGawOIlESBrPidU5zZdynZAtDQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0a5b545-ec72-4bc5-fff9-08d94d1081c9 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2021 12:59:14.4638 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: VE1EUR02FT056.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR02HT123 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" On 7/22/21 2:44 PM, Andrew Burgess wrote: > * 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? > Yes, I can confirm. I do see the same behavior. Thanks Bernd. > 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