From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-oln040092066105.outbound.protection.outlook.com [40.92.66.105]) by sourceware.org (Postfix) with ESMTPS id 0F2CD385801A for ; Thu, 22 Jul 2021 15:16:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0F2CD385801A 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=DrZtg47v0pKo45EnZG3OOS/rKBJMkOEf/VT8BmfhUJTpw/vyiMMYeWNW0gc82ksWr0YFbmOBJXFRSzP3xjY07VjaKquUnx7y0nJUunV8OdqvmH9Hk/625hqaA/9ypTkoarZFNAySdeQrTQ9RjYKu4b/3w8Uc8Fzc2d/ml8s9MGZA1LJhoACpXcd8GRkElnYvfAyVmngyxNERcCQJLfeKpBNhAky3F6TUj3gFasEHeiVPn/yyqtf6/cN4WBnn2eYrF5s+qMlKAukIHsYf6p/y75CT4ooaJN+FYOfM8IF7h4LOGB6hAP4UODpLq3Qmg3xb9GmThQ40kuRg0pG4BwBkTw== 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=McNoPz53TY1pW/cw5HIfYeMnKYXhJemVAqrAfi7q7I4=; b=NtP1tpIckwa45IgFKvjx2wjk3U/f3LkMezdaW1cxr2EgQmvtBQLusU7J7xZ7eGuzCDc4nE5sP5rrXPHSrsJTgN10H1/z1uAK15aV/LiMaNqA0ADXGvumfOQzhXCh64aPa5iwQg0JyvRAGCWmIor6TOuQiYkrKjtM4CyuSKwaugmZCb81YnQXISq7leytndbDWbGZudplAiU0dAfvHer0qzI815EuIFdWDeXBzcOOq3k3+MzO7PeENPJXHuFTvABQCMSneQ0R4WprAYVp7GcW5G2FmSiI5Lc+ieQ/nYfwdfmGVqafcTnQAE4ZcGWe9/yuiyQjBHDgaZVOrHtQ4cN4+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from VE1EUR01FT015.eop-EUR01.prod.protection.outlook.com (2a01:111:e400:7e19::52) by VE1EUR01HT157.eop-EUR01.prod.protection.outlook.com (2a01:111:e400:7e19::253) 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 15:16:29 +0000 Received: from AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM (2a01:111:e400:7e19::53) by VE1EUR01FT015.mail.protection.outlook.com (2a01:111:e400:7e19::237) 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 15:16:29 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:83BC23BB4411F1C7D6C71A526597303F915E7726BE3C169997BDAE784EBA0FD9; UpperCasedChecksum:6F1748AA735A01855C360E47540AB42B1AB67464D98A2144590595C34D0EB883; SizeAsReceived:8968; 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 15:16:29 +0000 Subject: Re: [PATCH] Fix the crash at the end of the runtest To: Simon Marchi , Andrew Burgess Cc: "gdb-patches@sourceware.org" References: <20210722124457.GC1872618@embecosm.com> <20210722132020.GD1872618@embecosm.com> From: Bernd Edlinger Message-ID: Date: Thu, 22 Jul 2021 17:16:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TMN: [8JnMctclMDOreHkV7pIHCEdzX5eqWwB3] X-ClientProxiedBy: AM0PR03CA0063.eurprd03.prod.outlook.com (2603:10a6:208::40) To AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:364::23) X-Microsoft-Original-Message-ID: <8d4cd4d9-f737-784d-cee6-c8ff8d29a8e2@hotmail.de> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.101] (88.76.118.196) by AM0PR03CA0063.eurprd03.prod.outlook.com (2603:10a6:208::40) 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 15:16:28 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: fb381b1f-ad67-4ff0-77d1-08d94d23ae19 X-MS-TrafficTypeDiagnostic: VE1EUR01HT157: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7g8YsSWk0sT76gt6owp2fWnO5yQadiwpDlVV/g//8o0zvwaj0iZSFP78hMV8213bUbUdrIroltYc9V4gHXAU8gb6fmtr0cg8T5bGW9BIQDTrjySnJbChB+8VKDx1CGdrmxWR/3EsJ0YAEcWmG0oiq7igeOtuA2iuehrlCokeQID8nBl/n/0iUCSRjDqU8DWEvW8uNYFA1zzU6HWjz2RsB99tKxR/IglAXqXOGaIkqInyBvwbm5h2h74RgDR8JO86KXX6R78Jt3VD75crOu2HJwPCEvku1gMdekc4cUjoiHQhF/A+8UUIuZuG6p+IhLRwwBcinDYb4Ed9TFSJr6Yj+TpE7P/hKbsa2nNoSR0aNxZZs79yRYPDezD0Intvk5VUzqtASaJH3eEyz4v/KRgyPWH25LK3jV7kHFpVMKNjEwX8mfSkAuwkTLuWgK04vd7k89H9qqU2Pjo4rvaNrTZzdbTATHioAfnr5sJSF7wYPa0= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: eoBbyhTFJUPPt+6FoTcJq7SyFm5F+E6Jj085HV1+K96a9duDo7x66mcEmWx0Pap2e+sbE1FKjTt76HkcLQFhugVOlzGSOWuYbZoi5tOv83ZXUjirYBzrzo9hsK/JRssuUP86NczBM7nd+cOHtylMYg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fb381b1f-ad67-4ff0-77d1-08d94d23ae19 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2021 15:16:29.1964 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: VE1EUR01FT015.eop-EUR01.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: VE1EUR01HT157 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, FORGED_MUA_MOZILLA, FREEMAIL_FROM, GIT_PATCH_0, KAM_DMARC_STATUS, MSGID_FROM_MTA_HEADER, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Thu, 22 Jul 2021 15:16:33 -0000 On 7/22/21 5:14 PM, Simon Marchi wrote: > On 2021-07-22 9:20 a.m., Andrew Burgess wrote: >> 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. >> this looks quite good, but should we mention the fixed crash here? Thanks Bernd. >> 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) > > Not caused by your patch, but: pedantically, the "if" should perhaps > verify that "spawn_out(slave,name)" specifically exists, not just > "spawn_out". Currently (according to "man expect"), > "spawn_out(slave,name)" is the only possible "spawn_out" contents. But > let's say that the next Expect version sets "spawn_out(foo)", then that > code will break (we will enter the "if" and try to read > "spawn_out(slave,name)", which may not exist). > >> } else { >> - unset ::last_spawn_tty_name >> + unset -nocomplain ::last_spawn_tty_name > > Perhaps a small comment above this line would be nice. > > Otherwise, LGTM with or without changes, thanks for looking into it. > > Simon >