From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-oln040092073032.outbound.protection.outlook.com [40.92.73.32]) by sourceware.org (Postfix) with ESMTPS id 6AB373857C71 for ; Wed, 21 Jul 2021 19:54:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6AB373857C71 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=QF9YrueG5b04GrgEG1e4S9++WL5S/5z1rZWbjybqmhEPQ0Ccps4VYsqfk9mSUxs6HX59BMhF1saXbdlomnAAzJPAZiwzzvKkEHjChopg4ekG9ZVqZzlu7WCZ0MP52kqSt7t2B9Ty2XFCSyDxCs1seWjVdF6pIIz68JJmMZJj4+gQmBud4IVG6uKSdMuCEBcEoyE12P7z0nwBkZgk2kg9YiYSbJ82hytz1+/kCV73u9/f0tSGM2wxsT3b5ufF+imEUQ05LmaPtmpg83TU1IiQe1GvC+AUBrb+LNo+XNm1VSQbQSbIM+y77IqgJeK7qUaVtXnOgui3XCgZULE2gslmJw== 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=Y6Ix1XVoDk5CMV532rn18lPD/hrBMpY4vxFVYetf/VA=; b=XW6cTnvX/b6RlAVoUXfbhooZI2X6D6IPskwifr5QXPg5mOWlAUMGOqwqPv+Y7eNjxOpU1lx9m/pG2MqLC+vTxm6fUu0xnEz03M/oXu67SKrxTUxpNSpyw91xJWXJjGTdN+j39TJVTtAi+GlLeHf4eWFX31Fz1t9yEihUboFZNIm95elQD2pe62hea2Svl8qMYcU0556eGsBjUCQeZPO1EkyhvdMNE2y49puyxCvFDDh5qw2jKZx8T8WPTMT2VECu2frBCZYsLIw59D2B7fjlGU7KMexH2hq8oPthqgs5UONHCIguMvq0WXl+vucFSydMIFl0hxKOGXS6Z5LxlQjkzg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from DB3EUR04FT007.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0c::48) by DB3EUR04HT075.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0c::332) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24; Wed, 21 Jul 2021 19:54:35 +0000 Received: from AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM (2a01:111:e400:7e0c::4a) by DB3EUR04FT007.mail.protection.outlook.com (2a01:111:e400:7e0c::178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24 via Frontend Transport; Wed, 21 Jul 2021 19:54:35 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:45B29AE512039BB91A5929C414A4CD1E2778E2AB0B0CCBE7A9EA31FF2E0B7BEF; UpperCasedChecksum:80198A0158A4DD99928B86CAB4EE4C62678D5F89423B1FF3639957D1FF8ACF4E; SizeAsReceived:9326; Count:47 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; Wed, 21 Jul 2021 19:54:35 +0000 Subject: Re: [PATCH] gdb/testsuite: capture GDB tty name in default_gdb_spawn From: Bernd Edlinger To: Simon Marchi , Tom Tromey , Simon Marchi via Gdb-patches References: <20210608212126.1673188-1-simon.marchi@polymtl.ca> <874ke7jcrv.fsf@tromey.com> <269336aa-5500-c03e-9e00-81279c24e5be@polymtl.ca> <87a6nxinjj.fsf@tromey.com> <86a3df13-64c5-6c4a-aa38-bd0abe34e3d7@polymtl.ca> Message-ID: Date: Wed, 21 Jul 2021 21:54:33 +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: [FOru2JWd20+6wuKFORT7w7n1eb8jwdaX] X-ClientProxiedBy: AM0PR03CA0088.eurprd03.prod.outlook.com (2603:10a6:208:69::29) To AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:364::23) X-Microsoft-Original-Message-ID: <3d4efaf1-35c7-d5bb-3144-443d62df094f@hotmail.de> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.101] (88.76.118.196) by AM0PR03CA0088.eurprd03.prod.outlook.com (2603:10a6:208:69::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.26 via Frontend Transport; Wed, 21 Jul 2021 19:54:34 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 47 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 56bba371-b1f1-4997-f189-08d94c815d70 X-MS-TrafficTypeDiagnostic: DB3EUR04HT075: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9FM3Z9uFL2BvtROid3UceG4d8fsSuZr055AfN450D1DLfdPcqgXdh9XyfLWsyKSE6euKioScb7grPh8L+da6QQocbNG5PWHi8Z3BChqXVw4oPROPHgPI+dh/vOikVHDC4mbvB5HSkBoK7HpK7JgpftpeZVWGZsshJMItLCF3S5epUtpQwuYrOfOztuwQ+dwEjH19FzjybVmmD7Qr18SRlSRqxrBpbzP9lWs2N8M84nj5T4lPocq+vHtscvWiYRMdnLKKG3JZjm+/W1r+FfCPslUOs6249j0yFrMstr9UQuJ+bUU6BGKBk8Rhs7cqw7IcJLVfwPZVfgZ+FkpKqjs4WUdT1exAcNWuWssyBcuSeVxzbm99i61KSWbmiO+x/1sTwJfF2lrK1+OgJJtczVpS60YbAZrT5Hpz68ut7WpbCWDWjmMMCEigqVWCw1AzbDLS X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RmnHrAqTW/BFc1vcSBPaRXBed+o2HF4xJxH/CAvi5XY/j2XwAXHT/YGSCibkw4Ep5iiqJwLrOnEGwzXOu38mBhE72fMAy/irlcjVewscxYvEQ7Y3rjM0YLrOTroazaap//tK+8/IcJE8mcC3dd9dkw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 56bba371-b1f1-4997-f189-08d94c815d70 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2021 19:54:35.4608 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DB3EUR04FT007.eop-eur04.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: DB3EUR04HT075 X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00, FORGED_MUA_MOZILLA, FREEMAIL_FROM, 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=no 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: Wed, 21 Jul 2021 19:54:38 -0000 On 7/20/21 10:28 PM, Bernd Edlinger wrote: > On 7/20/21 7:14 AM, Simon Marchi wrote: >> On 2021-07-19 3:05 p.m., Bernd Edlinger wrote: >>> expect 5.45.4-2build1 >>> tcl 8.6.9+1 >>> dejagnu 1.6.2-1 >> >> For the record, I do see it on my Ubuntu 20.04 machine. It can be >> reproduced by running `runtest --status` manually in gdb/testsuite, that >> could make it a bit easier to debug. >> >> I attached GDB to runtest while it was doing its thing and waited for it >> to segfault, that gave me the following backtrace (after installing the >> appropriate -dbgsym packages): >> >> #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 >> > > I narrowed it down to the following test case: > > make check-gdb RUNTESTFLAGS="gdb.base/gnu-debugdata.exp" > This seems to fix the problem for me: --- a/gdb/testsuite/gdb.base/gnu-debugdata.exp +++ b/gdb/testsuite/gdb.base/gnu-debugdata.exp @@ -56,6 +56,7 @@ proc pipeline {test args} { $input $output]} { return -1 } + unset ::last_spawn_tty_name set input_file $output } No Idea what is going on here, there are other places where run_on_host is called, and I don't see how run_on_host can call spawn, it calls [eval remote_exec ...] but I don't see how that is implemented. How can last_spawn_tty_name cause an expect crash? It appears to me, that changing the builtin spawn command causes some kind of undefined behavior. Bernd.