From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id dl8jLCisvGai5AYAWB0awg (envelope-from ) for ; Wed, 14 Aug 2024 09:07:52 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=FF/qx3gB; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=FF/qx3gB; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id A469F1E0D0; Wed, 14 Aug 2024 09:07:52 -0400 (EDT) Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4C4971E08C for ; Wed, 14 Aug 2024 09:07:50 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C98193858427 for ; Wed, 14 Aug 2024 13:07:49 +0000 (GMT) Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on20624.outbound.protection.outlook.com [IPv6:2a01:111:f403:260c::624]) by sourceware.org (Postfix) with ESMTPS id EEC443858D34 for ; Wed, 14 Aug 2024 13:07:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EEC443858D34 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EEC443858D34 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:260c::624 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1723640840; cv=pass; b=gOtBMae8AGpr6pBEk+PQ4HnC8V+qN4BlYqh2easuqek2lJz4mMinYnqyXR2hox7ZSxg1e2GmYMYcS0KKC7L4IkZMK3h3Chc2LioEZAoXE4I7P1Gqda7Bbq1dUlDflK00le4tUz48yCTDpdKqKrUKqOkOl/R+Upu41X7eIcXGxP8= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1723640840; c=relaxed/simple; bh=tZRFfjAC9Y95oeR6VIpfHJlk165fq8SgkYMMuEIi+GQ=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:Subject:To:From: MIME-Version; b=EvVtlsYwPhL8sM0BoM3KLS13eVDeChNDsQv+wcEvDm3HbO4XsRHvO57A+ZHv0m5pMXS6MX5Gwj9Rc55fCZ6eXh/jgBj5sAEYkPlm6y3uJkgH9ogMCCFv+jl4HAYqZdA0lQg7mlVGhwBVD4Ck8SsZHAw9ZkelrhBNq2sB4Fb5NvM= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=VkB6EocF/ulJQBcyMaSH21yT4NH26cSZKhYEjYpUYKKgzRvJfLSBFd4jJmCNA9U46TXxmsZv1xPCoZNED4k/hCGcRqIXS61UODCNFq3E6n1BfXVUj4OU8W7un9BVhrfWB9W89xNEfv1KHo9MZ4IHeqoEl2AE/4/iqy6DokcZgMMdHsLJwDenXAU9kutC2z5xFTWotoihVr/u7CwWfqzCkORfLIq0Qqb+XGQZcodhDkhRUNg5YA4Pn0Xl2fnQUJDflMdVZh5A8Y7rCXUhpxSdl/DBlfxhSxAXmP9G87VQnGtH5oQ0aNMtJl0VCHjqTHbZr/VV9e0/74fAGYTwyojPww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gz9YAlaFSs9SVsY6i2TkivwDL/DQCeeCstygyWER6eM=; b=SncaaegyErhdDvypOxMZ1qG2jaSMF6Dl55Yb6khoMRA2MPDoiniv//SZTJ/ILBG1Yul2Y/b6iLpkzdDFVbvPQZM1ZnAsQN8XE/Pq1Fxvzg6R0d4DOwY8Wj8lFZdZCLLjqxy+rq88Qd+DlDZ521ZWJoWhdoboMCBrUUEsNyv6+/w9qrZUtFp8NaNqwwI2WC3kGwV0fIxQC3Ax+G7a/1XA0siL8nuTbVFzmWTO2mTUbrS82mb9XUWWutpMrcstLKkD8Yby6L5HWb/ix/JIC9qPUqPl1hH3VXcJwyxpp2kNjk3qRSR1vgTZfb1Z34Uszl6hTZd0QxSLaZTbj04QvY880Q== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gz9YAlaFSs9SVsY6i2TkivwDL/DQCeeCstygyWER6eM=; b=FF/qx3gBW8aEuBylNUbnU07VOHnSQ3/YWZoJ1tB2XY1X5KsihEEIxSi/y/Gs0PM+0taJ1BqrId3R5mI8+BxcWXs2/w7SyWmha5zQR7p3JoDw27KUTugp7qBQ2tu7SOeA1UZZzNlO18nL2uggFH+ddbu6fVvjPeSixkpueDuWfJ4= Received: from AM6PR10CA0056.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:80::33) by PAXPR08MB6526.eurprd08.prod.outlook.com (2603:10a6:102:df::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.16; Wed, 14 Aug 2024 13:07:07 +0000 Received: from AMS0EPF000001B1.eurprd05.prod.outlook.com (2603:10a6:209:80:cafe::1f) by AM6PR10CA0056.outlook.office365.com (2603:10a6:209:80::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend Transport; Wed, 14 Aug 2024 13:07:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AMS0EPF000001B1.mail.protection.outlook.com (10.167.16.165) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7849.8 via Frontend Transport; Wed, 14 Aug 2024 13:07:07 +0000 Received: ("Tessian outbound 1b5e57ba80b9:v403"); Wed, 14 Aug 2024 13:07:06 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: cb97872dd647a057 X-CR-MTA-TID: 64aa7808 Received: from Ld23c54a9a151.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D7BAC204-B70F-47A8-AE7B-712426EAF948.1; Wed, 14 Aug 2024 13:06:59 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id Ld23c54a9a151.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 14 Aug 2024 13:06:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GMMb5SxViGVHkfINyTb/1rh/ssgjLDLobWMGskLTIb41V0nsPeIeN234V7Sb9hsw/GZlM5mHKJPS3b+QdvjuZVZeadpt0quoR2G1o67E8DJ/zrTFnMUiPBOQFWOwjkeoufT+Cf3i18O5lE+mxOjnihuyNQV/IvfRgHl0morDi0oZ9Nfz2Bhkf5z7jB2moECOlapOCoI5FXrwq5imQMIUPpvNUm6Rhu8xOLpqeQ1ZroaofsPdCYC4cXgq1kA3qOQwp3rt1XglJpYNAWZ4k6k16JuyU75klWsM2eTTtJ0keg+0Q1uUL3b9PrJzXj5tnrSTuKNw7e5Itw2rQlJ5wOt/nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gz9YAlaFSs9SVsY6i2TkivwDL/DQCeeCstygyWER6eM=; b=iHJP/cJ/iJllgcRtYrMLOb7Qwn5JO9FYHsduj0sGTNHXdPyn4DB0Xa1pn6AGxt9SQyJIReGPanr/4SWOIHgDMEqvCyprd4e52JFnfY1rMRhM1hWMGksKhw6HMCPaDQ1SGiyQ0S4y8P39RxK8uw8IOSXs8D/8SR2MB3vQJU8sdx935gdxGBMl+03aLgBp849lD+GEdhezvLHy8kMxcZpT5AbXwDu80EBeIIt/djHinbE1NN8qt1XytyNlJk9TtR7WApHLyX6fHmMJL5w5Lb1D6HS4vXZTAAqdKsmteEI7SSFtAVit5wEgwM8PoLqC2BeOzMRpwVbSVWNpkxop2y6o2g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gz9YAlaFSs9SVsY6i2TkivwDL/DQCeeCstygyWER6eM=; b=FF/qx3gBW8aEuBylNUbnU07VOHnSQ3/YWZoJ1tB2XY1X5KsihEEIxSi/y/Gs0PM+0taJ1BqrId3R5mI8+BxcWXs2/w7SyWmha5zQR7p3JoDw27KUTugp7qBQ2tu7SOeA1UZZzNlO18nL2uggFH+ddbu6fVvjPeSixkpueDuWfJ4= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from PR3PR08MB5852.eurprd08.prod.outlook.com (2603:10a6:102:8e::21) by GV2PR08MB8195.eurprd08.prod.outlook.com (2603:10a6:150:7b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.15; Wed, 14 Aug 2024 13:06:55 +0000 Received: from PR3PR08MB5852.eurprd08.prod.outlook.com ([fe80::f44:d113:1c29:825d]) by PR3PR08MB5852.eurprd08.prod.outlook.com ([fe80::f44:d113:1c29:825d%3]) with mapi id 15.20.7875.015; Wed, 14 Aug 2024 13:06:55 +0000 Message-ID: <7b23d70f-7392-4729-aff7-fc1190d4a274@arm.com> Date: Wed, 14 Aug 2024 14:06:53 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/4] gdb/testsuite: track if a caching proc calls gdb_exit or not To: Andrew Burgess , gdb-patches@sourceware.org References: <5dc846ffb6cd8f76ba2769ee7679f5d1b01fae0a.1717438458.git.aburgess@redhat.com> <97973506-79f4-4216-9c0b-57401b3933f5@arm.com> <878qx8z9nt.fsf@redhat.com> <9fbc6f52-bc2f-43c8-80b0-3f4c495df76e@arm.com> <8f70328b-8a35-463f-b153-25c0b63956d7@arm.com> <865dd933-bbfe-44d9-94e2-b7e133b05ed5@arm.com> <875xsbysp9.fsf@redhat.com> <67150769-8f37-4457-ab8e-7f4910bc449f@arm.com> <87bk1wxu5p.fsf@redhat.com> Content-Language: en-US From: Luis Machado In-Reply-To: <87bk1wxu5p.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0679.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:351::12) To PR3PR08MB5852.eurprd08.prod.outlook.com (2603:10a6:102:8e::21) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: PR3PR08MB5852:EE_|GV2PR08MB8195:EE_|AMS0EPF000001B1:EE_|PAXPR08MB6526:EE_ X-MS-Office365-Filtering-Correlation-Id: e7322102-85a7-4658-ab8c-08dcbc61ffe8 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info-Original: =?utf-8?B?NU5aQVM1czJNVjNaNms4UEgrMzJWYUJONVNQTmFaOCtPZkd1ZG9PcS91UlZ1?= =?utf-8?B?eUVITkJ0d1F2My9oL2NsR3drTHlyYnhtbjRmdXQvNi95TW5JYWlsZTQyRjQ2?= =?utf-8?B?VUhYZm5Tb3hKcjVDV3BIOFp1elROY2l0NEhQdnU0WFp2amFRU3RDMHBReFA2?= =?utf-8?B?R2FTTUJuZWRrTENCTUpPMXhBVElzcUNKRytiQWh2MGthTTh0NTZkSWQydnp6?= =?utf-8?B?MGc4UHBKTDVjVGpjSkhSTk5TaWlZL1lxbktDM1ZSMGVVY0poQU90cXE0eHFG?= =?utf-8?B?SFRQSVQ0bFVXUklCOEhNZElFUHBrZmREWFlSL0RSWDNxeGVsN2Fha0d0WU4w?= =?utf-8?B?dGVKT0tCeWR6U053d2N4dE9Kb1l3MXp4K0crSkhFZHRBVkk0RlVFQURCSGpz?= =?utf-8?B?ZFhmeUFQZXhiWmFIZG16dEtvcnBudGlESWFoNjlJUnNQcTJnMjhrald0QmMv?= =?utf-8?B?Q2s2K3h0cmZJMnd5QVYwSS8zSTloNlRUaHRPdVk3SmhZMWQ2VXpNSTFXSkcr?= =?utf-8?B?M2lxQXlvR1FMVnNmMXZTckN6MElLS0ZYQUZHcWtLampGczJVcFNQL0tGSDJX?= =?utf-8?B?R3pwUGUrZ091NXdVdGE3SFlkTWUycE5pbmNaZGFaSzdieFdpcDBWTFZIS0c3?= =?utf-8?B?N210cThUZXhqcEFSUCtRUkpteHY1eFFMZkU1UVRKbDdmcTdiV2d5c0Mzei9Z?= =?utf-8?B?Nkt0N1kyNUNqWk9qL21BcTM5MW1xUmNYMHJyV2F2TnFmazhwcERVVzdXNTRN?= =?utf-8?B?dXBQYTJWSEhCZE5yWS9KU01JNi9tT0NhckpLanFRZFowcy9CaFc3aU9wL2lv?= =?utf-8?B?NmttTGpZWUdOSDViMEVnM3pZKzN3ZkRkYnhrWDZPbVhveVB5TCtjc0VLZ29r?= =?utf-8?B?V0tkS2QycENUK2x5YUVtK1dpbDRCVTg3RFhKUjhSVDl0WTdLWmNJOU95Q1BF?= =?utf-8?B?QlFvUmZNM1BhNzNKdFkwM1l0YXlVVWpGNG1OK1lSRmVwY0hJNjYyQnl3T1VO?= =?utf-8?B?WWQ2R2JrWDYxRkV5bXoycW10YU5qc3R2U1lvS0p1UlpNTGVCd0tFcFVHTUVp?= =?utf-8?B?NlBmdEN3am9ZV2ZXVWtCcTQzTnhKU0pFYnRrUGlFZUZnWHdPQzZjN05Fa2tp?= =?utf-8?B?SlJlaDVLeDZiWU1WaU80ZUtOQUtuaDhTYkhxYUsxa3U4S0VwWHdnZGc3VW5Y?= =?utf-8?B?R1dSRzFsUi9wMWZKUVdPTTZxd0l6Qlk5WEtUZEFpSUJiQWN3cTE0dnlnbUhX?= =?utf-8?B?QzNTVElTRExhRHZNUUtRcDB5NTE2ODVUYWVjc0ZNd0I0ZlBad1ozUTcwMHJY?= =?utf-8?B?bE11U25kQ295NVpRZ0c5SEcxbU9Xa0IrNE9ML2F5OGQyY1dOR2J3L2Y0VEFN?= =?utf-8?B?ZWxhSDcwL0lvbEpWYmxwMStaVTVJSk1VNUNQZTI4YkV3anE5U3g4Q2l5N3c5?= =?utf-8?B?UVJkMW9vZU9QYmdLTWk1Y1VYR2M1U2xpajNaMW9aV0xXR0w2eUxjeTlDampY?= =?utf-8?B?TzFPbVlJaHVYVkphYlA5Vkc2Qm02cjA5MzIrZ0FZK3lWZmEzUzllTTk1dXdk?= =?utf-8?B?UVhONTZ1N005a043MEEyQVNydzRaVUZjM1hCMjJydHI4S2pFeVFQd0F1RkRZ?= =?utf-8?B?aXFWeHBWZG5pVlpBZ1llejlIcCt3elZ6dVhvTzBmWlY5WHRVd1lWaTVkeGRP?= =?utf-8?B?enFySm4xaWIzU2c5NWNzWjJUUGI2VXZLR3pWa05qQkwzUmVGYWNzakh5YmNz?= =?utf-8?Q?mC4KntAzYGbQ+cbuLQ=3D?= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PR3PR08MB5852.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8195 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-SkipListedInternetSender: ip=[2603:10a6:102:8e::21]; domain=PR3PR08MB5852.eurprd08.prod.outlook.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: AMS0EPF000001B1.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 3aec3b46-84f2-4edb-ffc7-08dcbc61f8fa X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|35042699022|82310400026|376014; X-Microsoft-Antispam-Message-Info: OQXTVDzdCcg6DohZkXkbx1los3yGw24hFsz5Tj1SwJBWLQSY40eZX0qd3HG3gXW0mVgFuIEgVP6NCHVvfMFsbV4PJZT03FL51y8R/H0BYXkImqr/EaiUeMg5Acr4XbgK1w5ZZU79Gu0Za1tTS0e8SptYFmF5ERTscZgHkavwnVF7ETuvqFffVKQDPFjZ3ka5ZP2+L2E/k0QU9S+6ytFIofAfClJRTTekeWVrV7JGTT5qyENWE0DczBEvh37rHyOKdo+oAlawzInFC2rkVA3Pn+niIC5DwNZNrJSpHzA3g+x9KmkOeg5YWTcGJwnFWQqHT6nPdsZheWsP7Txh5iH7aUpKM2VNdmBh0jhTPlF8WNtCAJm6kO1RjiL3IBR8SvyligRxSpxFWVrYEVsXL91OIDZdRMVBjDRmpKjOIalGv4F1r52laEvpMcb9CN5Sm2q+hLdisbj/nBQSak0pPrvvKvw98sz1y3vG8uAWXmdzouBOXIOjCadmWZ5mMdugq4cggdwmSSmKLCcsMtAEeJxKZU22YfMEary84R7XdKnM+DizDP8ZZHAPNABDp4ZdeFC9tQmyoqBBRM771o8MgLW5754oMugVkC3JzjbqcHvHQqXMxMTYhZrQGVEfwNMRu8gp06LKpZ2KS8OVrrGDIZWIdn0lCQtsJxdOYPZGOeg/Zc0gUoxpl2uO2/BBc+0MB9A75fbHOJLpMu5jnDXf0ym4mw== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230040)(36860700013)(1800799024)(35042699022)(82310400026)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 13:07:07.0274 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e7322102-85a7-4658-ab8c-08dcbc61ffe8 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AMS0EPF000001B1.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6526 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 8/13/24 17:30, Andrew Burgess wrote: > Luis Machado writes: > >> On 8/8/24 15:50, Andrew Burgess wrote: >>> Luis Machado writes: >>> >>>> On 8/8/24 11:50, Luis Machado wrote: >>>>> On 8/8/24 11:20, Luis Machado wrote: >>>>>> On 8/7/24 15:31, Andrew Burgess wrote: >>>>>>> Luis Machado writes: >>>>>>> >>>>>>>> Hi Andrew, >>>>>>>> >>>>>>>> On 6/3/24 19:16, Andrew Burgess wrote: >>>>>>>>> After a recent patch review I asked myself why can_spawn_for_attach >>>>>>>>> exists. This proc currently does some checks, and then calls >>>>>>>>> can_spawn_for_attach_1 which is an actual caching proc. >>>>>>>>> >>>>>>>>> The answer is that can_spawn_for_attach exists in order to call >>>>>>>>> gdb_exit the first time can_spawn_for_attach is called within any test >>>>>>>>> script. >>>>>>>>> >>>>>>>>> The reason this is useful is that can_spawn_for_attach_1 calls >>>>>>>>> gdb_exit. If imagine the user calling can_spawn_for_attach_1 directly >>>>>>>>> then a problem might exist. Imagine a test written like this: >>>>>>>>> >>>>>>>>> gdb_start >>>>>>>>> >>>>>>>>> if { [can_spawn_for_attach_1] } { >>>>>>>>> ... do stuff that assumes GDB is running ... >>>>>>>>> } >>>>>>>>> >>>>>>>>> If this test is NOT the first test run, and if an earlier test calls >>>>>>>>> can_spawn_for_attach_1, then when the above test is run the >>>>>>>>> can_spawn_for_attach_1 call will return the cached value and gdb_exit >>>>>>>>> will not be called. >>>>>>>>> >>>>>>>>> But, if the above test IS the first test run then >>>>>>>>> can_spawn_for_attach_1 will not returned the cached value, but will >>>>>>>>> instead compute the cached value, a process that ends up calling >>>>>>>>> gdb_exit. When the body of the if is executed GDB would no longer be >>>>>>>>> running and the test would fail! >>>>>>>>> >>>>>>>>> So can_spawn_for_attach was added which ensures that we _always_ call >>>>>>>>> gdb_exit the first time can_spawn_for_attach is called within a single >>>>>>>>> test script, this ensures that in the above case, even if the above is >>>>>>>>> not the first test run, gdb_exit will still be called. This avoids >>>>>>>>> some hidden bugs in the testsuite. >>>>>>>>> >>>>>>>>> However, what I observe is that can_spawn_for_attach is not the only >>>>>>>>> caching proc that calls gdb_exit. Why does can_spawn_for_attach get >>>>>>>>> special treatment when surely the same issue exists for any other >>>>>>>>> caching proc that calls gdb_exit? >>>>>>>>> >>>>>>>>> I think a better solution is to move the logic from >>>>>>>>> can_spawn_for_attach into cache.exp and generalise it so that it >>>>>>>>> applies to all caching procs. >>>>>>>>> >>>>>>>>> This commit does this by: >>>>>>>>> >>>>>>>>> 1. When the underlying caching proc is executed we wrap gdb_exit. >>>>>>>>> This wrapper sets a global to true if gdb_exit is called. The >>>>>>>>> value of this global is stored in gdb_data_cache (using a ',exit' >>>>>>>>> suffix), and also written to the cache file if appropriate. >>>>>>>>> >>>>>>>>> 2. When a cached value is returned from gdb_do_cache, if the >>>>>>>>> underlying proc would have called gdb_exit, and if this is the >>>>>>>>> first use of the caching proc in this test script, then we call >>>>>>>>> gdb_exit. >>>>>>>>> >>>>>>>>> When storing the ',exit' value into the on-disk cache file, the flag >>>>>>>>> value is stored on a second line. Currently every cached value only >>>>>>>>> occupies a single line, and a check is added to ensure this remains >>>>>>>>> true in the future. >>>>>>>>> >>>>>>>>> One issue did come up in testing, a FAIL in gdb.base/break-interp.exp, >>>>>>>>> this was caused by can_spawn_for_attach_1 calling gdb_start without >>>>>>>>> first calling gdb_exit. Under the old way of doing things >>>>>>>>> can_spawn_for_attach would call gdb_exit _before_ possibly calling the >>>>>>>>> actual caching proc. Under the new scheme gdb_exit is called _after_ >>>>>>>>> calling the actual caching proc. What was happening was that >>>>>>>>> break-interp.exp would leave GDB running then call >>>>>>>>> can_spawn_for_attach, when the test in can_spawn_for_attach_1 tried to >>>>>>>>> attach to the inferior, state left in the running GDB would cause some >>>>>>>>> unexpected behaviour. Fixed by having can_spawn_for_attach_1 call >>>>>>>>> gdb_exit before calling gdb_start, this ensures we have a fresh GDB. >>>>>>>>> >>>>>>>>> With this done can_spawn_for_attach_1 can be renamed to >>>>>>>>> can_spawn_for_attach, and the existing can_spawn_for_attach can be >>>>>>>>> deleted. >>>>>>>>> --- >>>>>>>>> gdb/testsuite/lib/cache.exp | 86 +++++++++++++++++++++++++++++++------ >>>>>>>>> gdb/testsuite/lib/gdb.exp | 83 +++++++++-------------------------- >>>>>>>>> 2 files changed, 93 insertions(+), 76 deletions(-) >>>>>>>>> >>>>>>>>> diff --git a/gdb/testsuite/lib/cache.exp b/gdb/testsuite/lib/cache.exp >>>>>>>>> index e7b9114058b..fef065ec8b0 100644 >>>>>>>>> --- a/gdb/testsuite/lib/cache.exp >>>>>>>>> +++ b/gdb/testsuite/lib/cache.exp >>>>>>>>> @@ -46,6 +46,40 @@ proc gdb_do_cache_wrap {real_name args} { >>>>>>>>> return $result >>>>>>>>> } >>>>>>>>> >>>>>>>>> +# Global written to by wrap_gdb_exit. Set to true if wrap_gdb_exit is >>>>>>>>> +# called. >>>>>>>>> + >>>>>>>>> +set gdb_exit_called false >>>>>>>>> + >>>>>>>>> +# Wrapper around gdb_exit. Use with_override to replace gdb_exit with >>>>>>>>> +# wrap_gdb_exit, the original gdb_exit is renamed to orig_gdb_exit. >>>>>>>>> + >>>>>>>>> +proc wrap_gdb_exit {} { >>>>>>>>> + set ::gdb_exit_called true >>>>>>>>> + orig_gdb_exit >>>>>>>>> +} >>>>>>>>> + >>>>>>>>> +# If DO_EXIT is false then this proc does nothing. If DO_EXIT is true >>>>>>>>> +# then call gdb_exit the first time this proc is called for each >>>>>>>>> +# unique value of NAME within a single test. Every subsequent time >>>>>>>>> +# this proc is called within a single test (for a given value of >>>>>>>>> +# NAME), don't call gdb_exit. >>>>>>>>> + >>>>>>>>> +proc gdb_cache_maybe_gdb_exit { name do_exit } { >>>>>>>>> + if { !$do_exit } { >>>>>>>>> + return >>>>>>>>> + } >>>>>>>>> + >>>>>>>>> + # To track if this proc has been called for NAME we create a >>>>>>>>> + # global variable. In gdb_cleanup_globals (see gdb.exp) this >>>>>>>>> + # global will be deleted when the test has finished. >>>>>>>>> + set global_name __${name}__cached_gdb_exit_called >>>>>>>>> + if { ![info exists ::${global_name}] } { >>>>>>>>> + gdb_exit >>>>>>>>> + set ::${global_name} true >>>>>>>>> + } >>>>>>>>> +} >>>>>>>>> + >>>>>>>>> # A helper for gdb_caching_proc that handles the caching. >>>>>>>>> >>>>>>>>> proc gdb_do_cache {name args} { >>>>>>>>> @@ -71,10 +105,12 @@ proc gdb_do_cache {name args} { >>>>>>>>> >>>>>>>>> set is_cached 0 >>>>>>>>> if {[info exists gdb_data_cache(${cache_name},value)]} { >>>>>>>>> - set cached $gdb_data_cache(${cache_name},value) >>>>>>>>> - verbose "$name: returning '$cached' from cache" 2 >>>>>>>>> + set cached_value $gdb_data_cache(${cache_name},value) >>>>>>>>> + set cached_exit $gdb_data_cache(${cache_name},exit) >>>>>>>>> + verbose "$name: returning '$cached_value' from cache" 2 >>>>>>>>> if { $cache_verify == 0 } { >>>>>>>>> - return $cached >>>>>>>>> + gdb_cache_maybe_gdb_exit $name $cached_exit >>>>>>>>> + return $cached_value >>>>>>>>> } >>>>>>>>> set is_cached 1 >>>>>>>>> } >>>>>>>>> @@ -83,24 +119,46 @@ proc gdb_do_cache {name args} { >>>>>>>>> set cache_filename [make_gdb_parallel_path cache $cache_name] >>>>>>>>> if {[file exists $cache_filename]} { >>>>>>>>> set fd [open $cache_filename] >>>>>>>>> - set gdb_data_cache(${cache_name},value) [read -nonewline $fd] >>>>>>>>> + set content [split [read -nonewline $fd] \n] >>>>>>>>> close $fd >>>>>>>>> - set cached $gdb_data_cache(${cache_name},value) >>>>>>>>> - verbose "$name: returning '$cached' from file cache" 2 >>>>>>>>> + set gdb_data_cache(${cache_name},value) [lindex $content 0] >>>>>>>>> + set gdb_data_cache(${cache_name},exit) [lindex $content 1] >>>>>>>>> + set cached_value $gdb_data_cache(${cache_name},value) >>>>>>>>> + set cached_exit $gdb_data_cache(${cache_name},exit) >>>>>>>>> + verbose "$name: returning '$cached_value' from file cache" 2 >>>>>>>>> if { $cache_verify == 0 } { >>>>>>>>> - return $cached >>>>>>>>> + gdb_cache_maybe_gdb_exit $name $cached_exit >>>>>>>>> + return $cached_value >>>>>>>>> } >>>>>>>>> set is_cached 1 >>>>>>>>> } >>>>>>>>> } >>>>>>>>> >>>>>>>>> - set real_name gdb_real__$name >>>>>>>>> - set gdb_data_cache(${cache_name},value) [gdb_do_cache_wrap $real_name {*}$args] >>>>>>>>> + set ::gdb_exit_called false >>>>>>>>> + with_override gdb_exit wrap_gdb_exit orig_gdb_exit { >>>>>>>>> + set real_name gdb_real__$name >>>>>>>>> + set gdb_data_cache(${cache_name},value) [gdb_do_cache_wrap $real_name {*}$args] >>>>>>>>> + } >>>>>>>>> + set gdb_data_cache(${cache_name},exit) $::gdb_exit_called >>>>>>>>> + >>>>>>>>> + # If a value being stored in the cache contains a newline then >>>>>>>>> + # when we try to read the value back from an on-disk cache file >>>>>>>>> + # we'll interpret the second line of the value as the ',exit' value. >>>>>>>>> + if { [regexp "\[\r\n\]" $gdb_data_cache(${cache_name},value)] } { >>>>>>>>> + set computed_value $gdb_data_cache(${cache_name},value) >>>>>>>>> + error "Newline found in value for $cache_name: $computed_value" >>>>>>>>> + } >>>>>>>>> + >>>>>>>>> if { $cache_verify == 1 && $is_cached == 1 } { >>>>>>>>> - set computed $gdb_data_cache(${cache_name},value) >>>>>>>>> - if { $cached != $computed } { >>>>>>>>> - error [join [list "Inconsistent results for $cache_name:" >>>>>>>>> - "cached: $cached vs. computed: $computed"]] >>>>>>>>> + set computed_value $gdb_data_cache(${cache_name},value) >>>>>>>>> + set computed_exit $gdb_data_cache(${cache_name},exit) >>>>>>>>> + if { $cached_value != $computed_value } { >>>>>>>>> + error [join [list "Inconsistent value results for $cache_name:" >>>>>>>>> + "cached: $cached_value vs. computed: $computed_value"]] >>>>>>>>> + } >>>>>>>>> + if { $cached_exit != $computed_exit } { >>>>>>>>> + error [join [list "Inconsistent exit results for $cache_name:" >>>>>>>>> + "cached: $cached_exit vs. computed: $computed_exit"]] >>>>>>>>> } >>>>>>>>> } >>>>>>>>> >>>>>>>>> @@ -110,9 +168,11 @@ proc gdb_do_cache {name args} { >>>>>>>>> # Make sure to write the results file atomically. >>>>>>>>> set fd [open $cache_filename.[pid] w] >>>>>>>>> puts $fd $gdb_data_cache(${cache_name},value) >>>>>>>>> + puts $fd $gdb_data_cache(${cache_name},exit) >>>>>>>>> close $fd >>>>>>>>> file rename -force -- $cache_filename.[pid] $cache_filename >>>>>>>>> } >>>>>>>>> + gdb_cache_maybe_gdb_exit $name $gdb_data_cache(${cache_name},exit) >>>>>>>>> return $gdb_data_cache(${cache_name},value) >>>>>>>>> } >>>>>>>>> >>>>>>>>> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp >>>>>>>>> index 8235d4f28eb..d29fd740f91 100644 >>>>>>>>> --- a/gdb/testsuite/lib/gdb.exp >>>>>>>>> +++ b/gdb/testsuite/lib/gdb.exp >>>>>>>>> @@ -6186,14 +6186,23 @@ proc gdb_exit { } { >>>>>>>>> catch default_gdb_exit >>>>>>>>> } >>>>>>>>> >>>>>>>>> -# Helper function for can_spawn_for_attach. Try to spawn and attach, and >>>>>>>>> -# return 0 only if we cannot attach because it's unsupported. >>>>>>>>> - >>>>>>>>> -gdb_caching_proc can_spawn_for_attach_1 {} { >>>>>>>>> - # For the benefit of gdb-caching-proc-consistency.exp, which >>>>>>>>> - # calls can_spawn_for_attach_1 directly. Keep in sync with >>>>>>>>> - # can_spawn_for_attach. >>>>>>>>> - if { [is_remote target] || [target_info exists use_gdb_stub] } { >>>>>>>>> +# Return true if we can spawn a program on the target and attach to >>>>>>>>> +# it. >>>>>>>>> + >>>>>>>>> +gdb_caching_proc can_spawn_for_attach {} { >>>>>>>>> + # We use exp_pid to get the inferior's pid, assuming that gives >>>>>>>>> + # back the pid of the program. On remote boards, that would give >>>>>>>>> + # us instead the PID of e.g., the ssh client, etc. >>>>>>>>> + if {[is_remote target]} { >>>>>>>>> + verbose -log "can't spawn for attach (target is remote)" >>>>>>>>> + return 0 >>>>>>>>> + } >>>>>>>>> + >>>>>>>>> + # The "attach" command doesn't make sense when the target is >>>>>>>>> + # stub-like, where GDB finds the program already started on >>>>>>>>> + # initial connection. >>>>>>>>> + if {[target_info exists use_gdb_stub]} { >>>>>>>>> + verbose -log "can't spawn for attach (target is stub)" >>>>>>>>> return 0 >>>>>>>>> } >>>>>>>>> >>>>>>>>> @@ -6218,6 +6227,9 @@ gdb_caching_proc can_spawn_for_attach_1 {} { >>>>>>>>> set test_spawn_id [spawn_wait_for_attach_1 $obj] >>>>>>>>> remote_file build delete $obj >>>>>>>>> >>>>>>>>> + # In case GDB is already running. >>>>>>>>> + gdb_exit >>>>>>>>> + >>>>>>>>> gdb_start >>>>>>>>> >>>>>>>>> set test_pid [spawn_id_get_pid $test_spawn_id] >>>>>>>>> @@ -6239,61 +6251,6 @@ gdb_caching_proc can_spawn_for_attach_1 {} { >>>>>>>>> return $res >>>>>>>>> } >>>>>>>>> >>>>>>>>> -# Return true if we can spawn a program on the target and attach to >>>>>>>>> -# it. Calls gdb_exit for the first call in a test-case. >>>>>>>>> - >>>>>>>>> -proc can_spawn_for_attach { } { >>>>>>>>> - # We use exp_pid to get the inferior's pid, assuming that gives >>>>>>>>> - # back the pid of the program. On remote boards, that would give >>>>>>>>> - # us instead the PID of e.g., the ssh client, etc. >>>>>>>>> - if {[is_remote target]} { >>>>>>>>> - verbose -log "can't spawn for attach (target is remote)" >>>>>>>>> - return 0 >>>>>>>>> - } >>>>>>>>> - >>>>>>>>> - # The "attach" command doesn't make sense when the target is >>>>>>>>> - # stub-like, where GDB finds the program already started on >>>>>>>>> - # initial connection. >>>>>>>>> - if {[target_info exists use_gdb_stub]} { >>>>>>>>> - verbose -log "can't spawn for attach (target is stub)" >>>>>>>>> - return 0 >>>>>>>>> - } >>>>>>>>> - >>>>>>>>> - # The normal sequence to use for a runtime test like >>>>>>>>> - # can_spawn_for_attach_1 is: >>>>>>>>> - # - gdb_exit (don't use a running gdb, we don't know what state it is in), >>>>>>>>> - # - gdb_start (start a new gdb), and >>>>>>>>> - # - gdb_exit (cleanup). >>>>>>>>> - # >>>>>>>>> - # By making can_spawn_for_attach_1 a gdb_caching_proc, we make it >>>>>>>>> - # unpredictable which test-case will call it first, and consequently a >>>>>>>>> - # test-case may pass in say a full test run, but fail when run >>>>>>>>> - # individually, due to a can_spawn_for_attach call in a location where a >>>>>>>>> - # gdb_exit (as can_spawn_for_attach_1 does) breaks things. >>>>>>>>> - # To avoid this, we move the initial gdb_exit out of >>>>>>>>> - # can_spawn_for_attach_1, guaranteeing that we end up in the same state >>>>>>>>> - # regardless of whether can_spawn_for_attach_1 is called. However, that >>>>>>>>> - # is only necessary for the first call in a test-case, so cache the result >>>>>>>>> - # in a global (which should be reset after each test-case) to keep track >>>>>>>>> - # of that. >>>>>>>>> - # >>>>>>>>> - # In summary, we distinguish between three cases: >>>>>>>>> - # - first call in first test-case. Executes can_spawn_for_attach_1. >>>>>>>>> - # Calls gdb_exit, gdb_start, gdb_exit. >>>>>>>>> - # - first call in following test-cases. Uses cached result of >>>>>>>>> - # can_spawn_for_attach_1. Calls gdb_exit. >>>>>>>>> - # - rest. Use cached result in cache_can_spawn_for_attach_1. Calls no >>>>>>>>> - # gdb_start or gdb_exit. >>>>>>>>> - global cache_can_spawn_for_attach_1 >>>>>>>>> - if { [info exists cache_can_spawn_for_attach_1] } { >>>>>>>>> - return $cache_can_spawn_for_attach_1 >>>>>>>>> - } >>>>>>>>> - gdb_exit >>>>>>>>> - >>>>>>>>> - set cache_can_spawn_for_attach_1 [can_spawn_for_attach_1] >>>>>>>>> - return $cache_can_spawn_for_attach_1 >>>>>>>>> -} >>>>>>>>> - >>>>>>>>> # Centralize the failure checking of "attach" command. >>>>>>>>> # Return 0 if attach failed, otherwise return 1. >>>>>>>>> >>>>>>>> >>>>>>>> This is a bit after the fact, but I tracked down some aarch64 sme test regressions >>>>>>>> to this particular patch. I'm still investigating exactly why it stopped working, but I >>>>>>>> can tell it only happens if we run 2 or more tests in the same run. It is not >>>>>>>> clear if making things parallel has an impact, or if it is just the fact we >>>>>>>> run 2+ tests in the same run. >>>>>>>> >>>>>>>> I suspect we may be calling gdb_exit when we shouldn't, and then things just >>>>>>>> stop working. >>>>>>>> >>>>>>>> --- >>>>>>>> >>>>>>>> Running target unix >>>>>>>> Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target. >>>>>>>> Using /usr/share/dejagnu/config/unix.exp as generic interface file for target. >>>>>>>> Using repos/binutils-gdb/gdb/testsuite/config/unix.exp as tool-and-target-specific interface file. >>>>>>>> Running repos/binutils-gdb/gdb/testsuite/gdb.arch/aarch64-sme-core-0.exp ... >>>>>>>> Running repos/binutils-gdb/gdb/testsuite/gdb.arch/aarch64-sme-regs-unavailable-3.exp ... >>>>>>>> ERROR: no fileid for ubuntu >>>>>>>> ERROR: no fileid for ubuntu >>>>>>>> ERROR: no fileid for ubuntu >>>>>>>> ERROR: no fileid for ubuntu >>>>>>>> FAIL: gdb.arch/aarch64-sme-regs-unavailable-3.exp: prctl, vl=32 svl=256: check_regs: incorrect ZA state >>>>>>>> ERROR: no fileid for ubuntu >>>>>>>> ERROR: no fileid for ubuntu >>>>>>>> ERROR: no fileid for ubuntu >>>>>>>> ERROR: no fileid for ubuntu >>>>>>>> ERROR: no fileid for ubuntu >>>>>>>> ERROR: no fileid for ubuntu >>>>>>>> ERROR: no fileid for ubuntu >>>>>>>> FAIL: gdb.arch/aarch64-sme-regs-unavailable-3.exp: gdb, vl=32 svl=256: check_regs: incorrect ZA state >>>>>>> >>>>>>> Luis, >>>>>>> >>>>>>> Could you please test the patch below to see if this fixes the issues >>>>>>> you are seeing. This is also running through local testing at my side, >>>>>>> but I thought I'd get your feedback early. >>>>>>> >>>>>>> Thanks, >>>>>>> Andrew >>>>>>> >>>>>> >>>>>> Well, it's one of those things I guess. I saw some errors the first time I tried the patch, but then >>>>>> I couldn't reproduce it anymore. So far it's been running pretty smoothly for both parallel and >>>>>> serialized runs. So I'd say this patch does the job and we should push it. >>>>>> Thanks for putting it together. >>>>>> >>>>>> I'll do a complete run overnight just to make sure, but it will take a little bit before I can report >>>>>> it. >>>>> >>>>> Of course, a short while after sending this, I managed to reproduce the error. >>>>> >>>>> I'm running the following: >>>>> >>>>> make check-gdb TESTS=gdb.arch/*.exp -j$(nproc). Let me fetch some more information. >>>> >>>> It seems we're hitting the same situation with aarch64_initialize_sve_information via aarch64_supports_sve_vl, >>>> which causes the testsuite to call gdb_exit. >>>> >>>> It is as you described, it is the first time we're running gdb.arch/aarch64-sme-core-2.exp, so we go through >>>> caching etc. >>>> >>>> --- >>>> >>>> Running builds/binutils-gdb/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.arch/aarch64-sme-core-2.exp ... >>>> gdb_caching_proc allow_aarch64_sve_tests caused gdb_exit to be called >>>> stack trace is Stack trace: >>>> gdb_cache_maybe_gdb_exit proc_name='allow_aarch64_sve_tests' cache_name='unix/allow_aarch64_sve_tests' >>>> gdb_do_cache name='allow_aarch64_sve_tests' args='' >>>> allow_aarch64_sve_tests >>> >>> This makes sense assuming that this is not the first time >>> `allow_aarch64_sve_tests` was called in this test run. This looks like >>> its using the previously cached result. >>> >>> If all had gone as expected then this should have marked `gdb_exit` as >>> having been called for both `allow_aarch64_sve_tests` and >>> `aarch64_initialize_sve_information`, though given what happens below I >>> guess that the marker for `aarch64_initialize_sve_information` isn't >>> being created correctly. >>> >>> You could try applying this patch: >>> >>> ### START ### >>> >>> diff --git a/gdb/testsuite/lib/cache.exp b/gdb/testsuite/lib/cache.exp >>> index 7e1eae9259e..d6027b352f1 100644 >>> --- a/gdb/testsuite/lib/cache.exp >>> +++ b/gdb/testsuite/lib/cache.exp >>> @@ -98,6 +98,7 @@ proc gdb_cache_maybe_gdb_exit { proc_name cache_name } { >>> set ::${global_name} true >>> >>> foreach other_name $gdb_data_cache(${cache_name},also_called) { >>> + verbose -log " gdb_caching_proc $other_name also called exit" >>> set global_name __${other_name}__cached_gdb_exit_called >>> set ::${global_name} true >>> } >>> @@ -110,6 +111,8 @@ proc gdb_do_cache {name args} { >>> global gdb_data_cache objdir >>> global GDB_PARALLEL >>> >>> + verbose -log "gdb_do_cache: $name ( $args )" >>> + >>> # Normally, if we have a cached value, we skip computation and return >>> # the cached value. If set to 1, instead don't skip computation and >>> # verify against the cached value. >>> >>> ### END ### >>> >>> which will log the "other" caching procs that are recorded as having >>> been called. >>> >>> Also, if you are running `make -j...." then you can look into the cache >>> files which will be 'gdb/testsuite/cache/unix/allow_aarch64_sve_tests' >>> and 'gdb/testsuite/cache/unix/aarch64_initialize_sve_information' as >>> this should also include the information about the nested caching proc >>> structure. >>> >>>> >>>> gdb_caching_proc allow_aarch64_sme_tests caused gdb_exit to be called >>>> stack trace is Stack trace: >>>> gdb_cache_maybe_gdb_exit proc_name='allow_aarch64_sme_tests' cache_name='unix/allow_aarch64_sme_tests' >>>> gdb_do_cache name='allow_aarch64_sme_tests' args='' >>>> allow_aarch64_sme_tests >>>> >>>> get_compiler_info: gcc-13-2-0 >>>> Executing on host: gcc -fno-stack-protector -fdiagnostics-color=never -g3 -march=armv8.5-a+sve -c -g -o builds/binutils-gdb/gdb/testsuite/outputs/gdb.arch/aarch64-sme-core-2/aarch64-sme-core-20.o builds/binutils-gdb/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.arch/aarch64-sme-core.c (timeout = 300) >>>> builtin_spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -g3 -march=armv8.5-a+sve -c -g -o builds/binutils-gdb/gdb/testsuite/outputs/gdb.arch/aarch64-sme-core-2/aarch64-sme-core-20.o builds/binutils-gdb/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.arch/aarch64-sme-core.c >>>> Executing on host: gcc -fno-stack-protector builds/binutils-gdb/gdb/testsuite/outputs/gdb.arch/aarch64-sme-core-2/aarch64-sme-core-20.o -fdiagnostics-color=never -g3 -march=armv8.5-a+sve -g -lm -o builds/binutils-gdb/gdb/testsuite/outputs/gdb.arch/aarch64-sme-core-2/aarch64-sme-core-2 (timeout = 300) >>>> builtin_spawn -ignore SIGHUP gcc -fno-stack-protector builds/binutils-gdb/gdb/testsuite/outputs/gdb.arch/aarch64-sme-core-2/aarch64-sme-core-20.o -fdiagnostics-color=never -g3 -march=armv8.5-a+sve -g -lm -o builds/binutils-gdb/gdb/testsuite/outputs/gdb.arch/aarch64-sme-core-2/aarch64-sme-core-2 >>>> builtin_spawn builds/binutils-gdb/gdb/testsuite/../../gdb/gdb -nw -nx -q -iex set height 0 -iex set width 0 -data-directory builds/binutils-gdb/gdb/data-directory >>>> (gdb) set height 0 >>>> (gdb) set width 0 >>>> (gdb) dir >>>> Reinitialize source path to empty? (y or n) y >>>> Source directories searched: $cdir:$cwd >>>> (gdb) dir builds/binutils-gdb/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.arch >>>> Source directories searched: builds/binutils-gdb/gdb/testsuite/../../../../repos/binutils-gdb/gdb/testsuite/gdb.arch:$cdir:$cwd >>>> (gdb) kill >>>> The program is not being run. >>>> (gdb) file builds/binutils-gdb/gdb/testsuite/outputs/gdb.arch/aarch64-sme-core-2/aarch64-sme-core-2 >>>> Reading symbols from builds/binutils-gdb/gdb/testsuite/outputs/gdb.arch/aarch64-sme-core-2/aarch64-sme-core-2... >>>> (gdb) gdb_caching_proc aarch64_initialize_sve_information caused gdb_exit to be called >>>> stack trace is Stack trace: >>>> gdb_cache_maybe_gdb_exit proc_name='aarch64_initialize_sve_information' cache_name='unix/aarch64_initialize_sve_information' >>>> gdb_do_cache name='aarch64_initialize_sve_information' args='' >>>> aarch64_initialize_sve_information >>>> aarch64_supports_sve_vl length='16' >>>> test_sme_core_file id_start='50' id_end='74' >>> >>> This should have been prevented by the earlier allow_aarch64_sve_tests >>> call. Either we failed to correctly spot the relationship between the >>> two caching procs, or we're failing to mark this second one as having >>> been called for some reason... >>> >>> I think we need more data to try and debug this... >> >> I did some more debugging on this, and I think I see what's going on here. I haven't >> checked the flow in detail yet, but hopefully it will ring some bells. >> >> My theory is that your patch's logic is sane, but we're hitting concurrency issues when >> running things in parallel, or parallel enough. For instance, I consistently hit issues when >> using -j4, but I can't hit it with anything below -j4. >> >> I added a couple debugging statements in gdb_do_cache, at the end within the if {[info exists GDB_PARALLEL]} block. >> >> The statements check if the $cache_filename exists and what the contents are, before we rename >> $cache_filename.[pid] to $cache_filename, essentially overwriting the old cache file. >> >> What I saw was the following: >> >> --- >> >> gdb_do_cache: aarch64_initialize_sve_information ( ) >> gdb_caching_proc aarch64_initialize_sve_information caused gdb_exit to be called >> Stack trace: >> gdb_cache_maybe_gdb_exit proc_name='aarch64_initialize_sve_information' cache_name='unix/aarch64_initialize_sve_information' >> gdb_do_cache name='aarch64_initialize_sve_information' args='' >> aarch64_initialize_sve_information >> gdb_real__allow_aarch64_sve_tests >> allow_aarch64_sve_tests >> >> XXXX: File builds/binutils-gdb/gdb/testsuite/cache/unix/allow_aarch64_sve_tests already exists before rename. >> XXXX: Old contents: 1 true aarch64_initialize_sve_information >> XXXX: New contents: 1 true {} >> gdb_caching_proc allow_aarch64_sve_tests caused gdb_exit to be called >> Stack trace: >> gdb_cache_maybe_gdb_exit proc_name='allow_aarch64_sve_tests' cache_name='unix/allow_aarch64_sve_tests' >> gdb_do_cache name='allow_aarch64_sve_tests' args='' >> allow_aarch64_sve_tests >> >> --- >> >> So we replace a cache file that contains more information with a copy that has less information. >> >> Eventually we call aarch64_initialize_sve_information again, via a different function, and things go bad. >> >> I'm guessing the logic of updating the cache files needs to be atomic, and we're having some timing issues >> where two (or more) tests try to update the same file and we end up losing information. > > Thanks for doing the leg work on this. The information you provided is > spot on, and it was indeed a timing issue as you predicted. Here's > what's happening: > > In thread #1 we call 'allow_aarch64_sme_tests', there's no cache file > yet we eval the body, this calls 'aarch64_initialize_sme_information'. > So we try to create two cache files in this order: > > unix/aarch64_initialize_sme_information > value: ... whatever ... > exit_called?: true > also_called: {} > > unix/allow_aarch64_sme_tests > value: ... whatever ... > exit_called?: true > also_called: aarch64_initialize_sme_information > > In thread #2 we also call 'allow_aarch64_sme_tests', however, if we > manage to land after the first cache file was created but before the > second file was created then we pick up the cached result for > 'aarch64_initialize_sme_information'. > > And this is where my bug was: I didn't add > 'aarch64_initialize_sme_information' to the also_called list for a > caching proc if we managed to find a cached value. As a result, the > thread #2 cache file looked like this: > > unix/allow_aarch64_sme_tests > value: ... whatever ... > exit_called?: true > also_called: {} > > which then overwrote the first cache file (atomically). > > A later test would call 'allow_aarch64_sme_tests' and then separately > call 'aarch64_initialize_sme_information'. Due to the corrupted cache > file calling 'allow_aarch64_sme_tests' would not mark > 'aarch64_initialize_sme_information' as having been called. So when we > separately call 'aarch64_initialize_sme_information' gdb_exit would be > called which broke the test. > > The fix, of course, is to ensure that when we get a cache hit we still > record the called function as being something that is "also called". > > I have a new patch below (discard the previous patch I sent) which I > think should resole the problems you're having. I'm still running the > full tests on my end, but initial (limited) testing looks good. Great. Glad the information was useful. I gave the attached patch a try and managed to run all the sme tests in parallel and did not see any FAIL's or errors. I'm doing a few more runs just in case, but I think we're good. > > Thanks, > Andrew > > --- > > commit 7384f334613a548bc26eaf238650076537c9b8fb > Author: Andrew Burgess > Date: Wed Aug 7 14:51:06 2024 +0100 > > gdb/testsuite: track nested caching proc calls > > It was pointed out in this email: > > https://inbox.sourceware.org/gdb-patches/97973506-79f4-4216-9c0b-57401b3933f5@arm.com > > that this commit: > > commit 0726729d344fecf98f8d138e688e77201cc3cece > Date: Mon Jun 3 13:56:54 2024 +0100 > > gdb/testsuite: track if a caching proc calls gdb_exit or not > > had broken some AArch64 tests. > > What is going on is that there are two caching procs: > > allow_aarch64_sme_tests > aarch64_initialize_sme_information > > the allow_aarch64_sme_tests proc makes a call to > aarch64_initialize_sme_information, but > aarch64_initialize_sme_information is also called from other > non-caching procs, like aarch64_supports_sme_svl. > > Both of the caching procs mentioned above compile and run a helper > program, and both of them call gdb_exit. > > After the above commit, the first call to any caching proc, the body > of which calls gdb_exit, will result in a gdb_exit call even if the > body is not executed and the result is fetched from the cache. > > What was observed is that in the first test script > allow_aarch64_sme_tests is called, the body of this caching proc is > run which calls gdb_exit. Then allow_aarch64_sme_tests calls > aarch64_initialize_sme_information, the body of which is run and > gdb_exit is called again. The results from both procs are added to > the cache. > > In the next test script allow_aarch64_sme_tests is called. This > results in a cache hit, but gdb_exit is also called as this is the > first call in this second test script. > > Later in the test script aarch64_supports_sme_svl is called which > calls aarch64_initialize_sme_information. As this is the first call > to aarch64_initialize_sme_information in this second test > script (remember the body of allow_aarch64_sme_tests was never run) > then gdb_exit is called. This call to gdb_exit is new after the above > commit and is unexpected. > > I think the idea behind the above commit is still sound. If the call > to allow_aarch64_sme_tests was removed from the second test script > then we would want the extra gdb_exit call as this would expose a real > bug in the test. The problem is that after the above commit the > nested nature of the caching proc calls becomes important: a call to > allow_aarch64_sme_tests should mean that we've also called > aarch64_initialize_sme_information, and that relationship isn't > currently captured. > > So in this commit I'm adding another field to the global > gdb_data_cache (in lib/cache.exp). This new field is 'also_called'. > For every caching proc we populate this field with a list of names, > these are the names of any nested caching procs that are called when > the body of a caching proc is executed. > > Now when we get a cache hit in gdb_data_cache we mark every proc in > the 'also_called' list as having been called. This means that further > calls to these procs will no longer trigger a gdb_exit call. > > diff --git a/gdb/testsuite/lib/cache.exp b/gdb/testsuite/lib/cache.exp > index 092b7f136e8..ca3dca22f96 100644 > --- a/gdb/testsuite/lib/cache.exp > +++ b/gdb/testsuite/lib/cache.exp > @@ -59,13 +59,38 @@ proc gdb_exit_called { args } { > set ::gdb_exit_called true > } > > -# If DO_EXIT is false then this proc does nothing. If DO_EXIT is true > -# then call gdb_exit the first time this proc is called for each > -# unique value of NAME within a single test. Every subsequent time > -# this proc is called within a single test (for a given value of > -# NAME), don't call gdb_exit. > +# While calling the implementation of a caching proc, that > +# implementation might itself call additional caching procs. We need > +# to track all of the nested caching procs that are called and we do > +# that in this list which is a list containing the names of any nested > +# caching procs that are called. > > -proc gdb_cache_maybe_gdb_exit { name do_exit } { > +set gdb_nested_caching_proc_calls {} > + > +# Called before returning from gdb_do_cache. NAME is the name of the > +# caching proc that was called. > +# > +# When DO_EXIT is true then this proc should call gdb_exit before > +# returning, otherwise gdb_exit is not called. > +# > +# ALSO_CALLED is a list of the names all the nested caching procs that > +# the proc NAME called. This proc appends NAME as well as everything > +# in ALSO_CALLED to the global GDB_NESTED_CACHING_PROC_CALLS, this > +# aids in tracking recursive caching proc calls. > + > +proc gdb_cache_maybe_gdb_exit { name do_exit also_called } { > + > + # Record all the procs that have been called, but only if the exit > + # trace is in place (this is done in gdb_do_cache) and indicates > + # that we are in data gathering mode. > + if { [info exists ::gdb_exit_trace_in_place] } { > + set ::gdb_nested_caching_proc_calls \ > + [list {*}$::gdb_nested_caching_proc_calls $name {*}$also_called] > + } > + > + # The cache 'exit' entry will be true if this caching proc, or any > + # caching proc that is recursively called from this caching proc, > + # called exit. > if { !$do_exit } { > return > } > @@ -76,7 +101,15 @@ proc gdb_cache_maybe_gdb_exit { name do_exit } { > set global_name __${name}__cached_gdb_exit_called > if { ![info exists ::${global_name}] } { > gdb_exit > + verbose -log "gdb_caching_proc $name caused gdb_exit to be called" > set ::${global_name} true > + verbose -log " gdb_caching_proc $name marked as called" > + > + foreach other_name $also_called { > + verbose -log " gdb_caching_proc $other_name marked as called" > + set global_name __${other_name}__cached_gdb_exit_called > + set ::${global_name} true > + } > } > } > > @@ -86,6 +119,8 @@ proc gdb_do_cache {name args} { > global gdb_data_cache objdir > global GDB_PARALLEL > > + verbose -log "gdb_do_cache: $name ( $args )" > + > # Normally, if we have a cached value, we skip computation and return > # the cached value. If set to 1, instead don't skip computation and > # verify against the cached value. > @@ -107,9 +142,10 @@ proc gdb_do_cache {name args} { > if {[info exists gdb_data_cache(${cache_name},value)]} { > set cached_value $gdb_data_cache(${cache_name},value) > set cached_exit $gdb_data_cache(${cache_name},exit) > + set cached_also_called $gdb_data_cache(${cache_name},also_called) > verbose "$name: returning '$cached_value' from cache" 2 > if { $cache_verify == 0 } { > - gdb_cache_maybe_gdb_exit $name $cached_exit > + gdb_cache_maybe_gdb_exit $name $cached_exit $cached_also_called > return $cached_value > } > set is_cached 1 > @@ -123,11 +159,13 @@ proc gdb_do_cache {name args} { > close $fd > set gdb_data_cache(${cache_name},value) [lindex $content 0] > set gdb_data_cache(${cache_name},exit) [lindex $content 1] > + set gdb_data_cache(${cache_name},also_called) [lindex $content 2] > set cached_value $gdb_data_cache(${cache_name},value) > set cached_exit $gdb_data_cache(${cache_name},exit) > + set cached_also_called $gdb_data_cache(${cache_name},also_called) > verbose "$name: returning '$cached_value' from file cache" 2 > if { $cache_verify == 0 } { > - gdb_cache_maybe_gdb_exit $name $cached_exit > + gdb_cache_maybe_gdb_exit $name $cached_exit $cached_also_called > return $cached_value > } > set is_cached 1 > @@ -164,9 +202,29 @@ proc gdb_do_cache {name args} { > set old_gdb_exit_called $::gdb_exit_called > set ::gdb_exit_called false > > + # As with the exit tracking above we also need to track any nested > + # caching procs that this proc might call. To do this we backup > + # the current global list of nested caching proc calls and reset > + # the global back ot the empty list. As nested caching procs are > + # called their names are added to the global list, see > + # gdb_cache_maybe_gdb_exit for where this is done. > + set old_gdb_nested_caching_proc_calls $::gdb_nested_caching_proc_calls > + set ::gdb_nested_caching_proc_calls {} > + > set real_name gdb_real__$name > set gdb_data_cache(${cache_name},value) [gdb_do_cache_wrap $real_name {*}$args] > set gdb_data_cache(${cache_name},exit) $::gdb_exit_called > + set gdb_data_cache(${cache_name},also_called) \ > + [lsort -unique $::gdb_nested_caching_proc_calls] > + > + # Now that the actual implementation of this caching proc has been > + # executed the gdb_nested_caching_proc_calls global will contain > + # the names of any nested caching procs that were called. We > + # append this new set of names onto the set of names we backed up > + # above. > + set ::gdb_nested_caching_proc_calls \ > + [list {*}$old_gdb_nested_caching_proc_calls \ > + {*}$::gdb_nested_caching_proc_calls] > > # See comment above where OLD_GDB_EXIT_CALLED is set: if > # GDB_EXIT_CALLED was previously true then this is a recursive > @@ -183,6 +241,7 @@ proc gdb_do_cache {name args} { > trace remove execution gdb_exit enter gdb_exit_called > unset ::gdb_exit_trace_in_place > set ::gdb_exit_called false > + set ::gdb_nested_caching_proc_calls {} > } > > # If a value being stored in the cache contains a newline then > @@ -196,6 +255,7 @@ proc gdb_do_cache {name args} { > if { $cache_verify == 1 && $is_cached == 1 } { > set computed_value $gdb_data_cache(${cache_name},value) > set computed_exit $gdb_data_cache(${cache_name},exit) > + set computed_also_called $gdb_data_cache(${cache_name},also_called) > if { $cached_value != $computed_value } { > error [join [list "Inconsistent value results for $cache_name:" > "cached: $cached_value vs. computed: $computed_value"]] > @@ -204,6 +264,10 @@ proc gdb_do_cache {name args} { > error [join [list "Inconsistent exit results for $cache_name:" > "cached: $cached_exit vs. computed: $computed_exit"]] > } > + if { $cached_also_called != $computed_also_called } { > + error [join [list "Inconsistent also_called results for $cache_name:" > + "cached: $cached_also_called vs. computed: $computed_also_called"]] > + } > } > > if {[info exists GDB_PARALLEL]} { > @@ -213,10 +277,12 @@ proc gdb_do_cache {name args} { > set fd [open $cache_filename.[pid] w] > puts $fd $gdb_data_cache(${cache_name},value) > puts $fd $gdb_data_cache(${cache_name},exit) > + puts $fd $gdb_data_cache(${cache_name},also_called) > close $fd > file rename -force -- $cache_filename.[pid] $cache_filename > } > - gdb_cache_maybe_gdb_exit $name $gdb_data_cache(${cache_name},exit) > + gdb_cache_maybe_gdb_exit $name $gdb_data_cache(${cache_name},exit) \ > + $gdb_data_cache(${cache_name},also_called) > return $gdb_data_cache(${cache_name},value) > } > >