From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id c+eBMvFCDWZnXSEAWB0awg (envelope-from ) for ; Wed, 03 Apr 2024 07:52:17 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=bIWWupNH; dkim=pass (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=bIWWupNH; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id BAFD41E0C0; Wed, 3 Apr 2024 07:52:17 -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 7A3331E030 for ; Wed, 3 Apr 2024 07:52:15 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B9BC3384607B for ; Wed, 3 Apr 2024 11:52:14 +0000 (GMT) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2045.outbound.protection.outlook.com [40.107.21.45]) by sourceware.org (Postfix) with ESMTPS id 4944C384607A for ; Wed, 3 Apr 2024 11:51:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4944C384607A 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 4944C384607A Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.21.45 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1712145108; cv=pass; b=qbDZPEGR8XpndIfJiCM2/zCfazj9jgzfE/GKITb3LDQaBVT7HVYwEw/wbtFv4bXSJXP9AUQMjWHhHsotz4CTE93HfTuEhIbV9YvvoHm1fLY+x2ixBzSXL7kebwo3dcN+OKtr1C5FEvJABU0JNdomiinqQsVNxnX7dpwrk2MTI3g= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1712145108; c=relaxed/simple; bh=mq0wDGJkpRaz6l55hPJ29J1cTaHbes5U++c1uzQ5C3Y=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:Subject:To:From: MIME-Version; b=V5gLMWwHu1PTtTGUThYt/0bKG5NHumuVTAgsuabWR/2D9IlJEvoILkqJe0vNV8CASZKo0Oqpe1h9JXBbJSU/XghFC6qWll6Nm3es9yt2GSxZ4+09rMjrbj141xaQ3mdYu7gMfRcq8reYbzCF35xAg6Fsjdp3+gQ+SPife72LWgY= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=JiowVfybCznli96UITUQCpkbr34tmLAoQNgDy1Amz8l3FSz4sIV0ToBC/3Lae2tSMvKnjDENUoYvUCGJfNWicbcqRovRVJsldqa8CDSVxze4dY31/IUYEwOGTB1N1r6+u1WAgPTZUQ47h1zfm6qolC4xPjiBi52/3ZqTONu4lnlvLg+gvhIX1uB19C412oP/EKE/AUEPs0vi+INZRWxTDTptIt5SakKwSxrmDcrdn5oa170lRKnEUvW9qh9yfQYY5/c1BXTene5QDWCpXv4jQXf5xgy8FKG1KgEnAk1+qOs3WMOMFbB8OStZuYv6LtLbQR4phMa55+MaKjG2MnZoEw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=Pe6We5VHp6SfNGqk0J8uIky8MsOKZGVClAQm5Ne/d5Y=; b=NU1BMXgM/nPT1Z3QECm096kQPhfcVt/Ix2DJ5MGAi6dHhiUrHQyON7fnQevKAUpZQJR+dcFenZP4ot7y9KleZm1oOz6P3lGS2IfKFLXIxKQX8LjpicNXuH3Hc3cQCa7pYi9z7dGz5Nz4z813t8C75suoor7Io5P7OTv8nnQNEMWhfdH4d9wD9owJrV1W0Vz9vwxSOiRdsXkXxptICPCtFVWKYB6HVc7+Gm9ROrH8QYD1VcPr4SuBf6pl2rfKuhKi4AwRFGOG6BpoFOVVG51E7BckoCqd/4zMLvRNkqb6UmWskbqYbMHbx21Lkn4YiBCr6QMtjuCSmlCX+YPuPWx/pA== 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=armh.onmicrosoft.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=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Pe6We5VHp6SfNGqk0J8uIky8MsOKZGVClAQm5Ne/d5Y=; b=bIWWupNH1S5sNSj0AQHzJNCz1OIcOHMDtmDyKZYS/mK7Sjh6LPwir+V4PfUV11/B2kBor5DlUDuiy8UZtik9Sq6U5yC1hNnFHI8T4j3H6MgHXfE+/S6EKQi0bVLtb1xW/85pqNDEUrQxKZ5N2G2Lv3UCAfVuiP324c2Ayov2dho= Received: from DUZPR01CA0352.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b8::15) by DU0PR08MB7589.eurprd08.prod.outlook.com (2603:10a6:10:31e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.27; Wed, 3 Apr 2024 11:51:39 +0000 Received: from DB5PEPF00014B95.eurprd02.prod.outlook.com (2603:10a6:10:4b8:cafe::d4) by DUZPR01CA0352.outlook.office365.com (2603:10a6:10:4b8::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46 via Frontend Transport; Wed, 3 Apr 2024 11:51:39 +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=armh.onmicrosoft.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 DB5PEPF00014B95.mail.protection.outlook.com (10.167.8.233) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Wed, 3 Apr 2024 11:51:39 +0000 Received: ("Tessian outbound ff4e98f65004:v300"); Wed, 03 Apr 2024 11:51:39 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 6e5f14107e3856e3 X-CR-MTA-TID: 64aa7808 Received: from a2bc0cbccfdc.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id DD3FBDE5-57C6-4367-A057-F6E3D5C8E000.1; Wed, 03 Apr 2024 11:51:33 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a2bc0cbccfdc.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 03 Apr 2024 11:51:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bRhDwSLJOCIYnQwa2RdmEf0tGTOHIk84tVripxhCaEbNajB4BDsstpmX8XOh+L2cBWDqVpL2NNJntTdNulGa3dbwvcvmr/CJ81C1bL0o1w45kiTjlzY7pLglxDprz+MlQbZR/osRT+S0fXrLIq2ECZ/DCosuV7w9IWvPg7k8i0WD9bHtHmi13eC1+ruFaN8asE6YHg4kALa2hwBjVEfdcIAiArA/CD0PanjU1sQ+Fm+bjkyiAbpLe7NHL87S2lSyLIbb+1B5ke8SHjGiTcCCF41gl7c/VgOsxVXJGOZFB+89Nu2Ju2Aysl7vksMT8uK9KT+1nQMdXksZdX4sZSB5FA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Pe6We5VHp6SfNGqk0J8uIky8MsOKZGVClAQm5Ne/d5Y=; b=AdLsrlHmVSyXdfecRC2TZ/BKanxYSizxssj8WcpdRjJt6roZqV6yUc7YQ0PnZGb2cMze9BywEcrL4CrV08HOPpDJasW/p2mavBXDVuVgqneBy+x0LXJpo/ubT3GglWOG5MxmkmVZ9l+E/DQLFNaOzS43M5CWpXPJ3IkJccZsQTUWZnPAys+CIZ9BwCpUcl5HfaF9dZ0yb55vh5MBNgUbv/oBDzBj1Jyirge4uSbAAFvD/GWNZtHsw1hEwAm2Pz3IfboZxI/K+RzdSPU+TBIUeREPNhtAdgjGyBR2QkU63OD6lUAKavyOVqvDN1vQsQ07agQZxWLQ3hXIVHV+dwInlw== 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=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Pe6We5VHp6SfNGqk0J8uIky8MsOKZGVClAQm5Ne/d5Y=; b=bIWWupNH1S5sNSj0AQHzJNCz1OIcOHMDtmDyKZYS/mK7Sjh6LPwir+V4PfUV11/B2kBor5DlUDuiy8UZtik9Sq6U5yC1hNnFHI8T4j3H6MgHXfE+/S6EKQi0bVLtb1xW/85pqNDEUrQxKZ5N2G2Lv3UCAfVuiP324c2Ayov2dho= Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by AS8PR08MB7888.eurprd08.prod.outlook.com (2603:10a6:20b:52f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Wed, 3 Apr 2024 11:51:30 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::363f:3fc8:fc36:58ed]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::363f:3fc8:fc36:58ed%5]) with mapi id 15.20.7409.042; Wed, 3 Apr 2024 11:51:28 +0000 Message-ID: <3d9dfd09-739d-45c9-a16c-9459734a4685@arm.com> Date: Wed, 3 Apr 2024 12:51:25 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 0/4] Add another way to check for MTE-tagged addresses on remote targets To: Gustavo Romero , gdb-patches@sourceware.org Cc: thiago.bauermann@linaro.org References: <20240328224850.2785280-1-gustavo.romero@linaro.org> Content-Language: en-US From: Luis Machado In-Reply-To: <20240328224850.2785280-1-gustavo.romero@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P265CA0204.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:318::14) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|AS8PR08MB7888:EE_|DB5PEPF00014B95:EE_|DU0PR08MB7589:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: VQEc95HSWMNEJ8nXTzQH9AimqwE1TQMgVs7XlUp1Q8VrtzOc2K/v0sWFPjNu5T+B0nSi03zsmFAxpMYRszNc5lXU+3Kf/hD+keJYEosKtWWZMUddzm5LwfLGzuidj7H1nkeTtXX8M7WwI8OiuyxDl8FRU/WasZwJMtkuX4UJyKXHJge/te+Zz9d/87AFOjQB5atmTqlU3d17OCraJo3v/FXzOZJ1Z4s78eYWkrum6Q8HGVpsZ5+BXqQvczHe4VjyqOQOMC9W2zvfVko3tNby0Xt7gUx6FI+NQZlcTYaPbG8JZ1voON3RTjNH/ZuUzyy/R+/DSnkNKqH0/fxvxfcu6Sv5xWupzH/E3JRFSu5okdX8E/mYnOyygOD5XoHYa7BhP5tnTasmQVNDrmQpsMhvF1CzeyUnMW9OLaBvWnSlOXI1UPq5cmUH0rl7mq5iIRuCAUI2x317kaSoRyBwCmHs9Mnfiu9hF5vNQ7OtpXZCaOasZi3zQ9KDLrBglQOAOhtuAJb1xG3xNI4IJmBeSz0pOpamqLssMdPJ6LmuCuAR1h8nIeiPWwxEfuwX5iSoA7aO6ngCFsfr5wO0rE62am+G8LexrDh2Sfp9IpqniQL41MY= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR08MB3919.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(1800799015)(366007); DIR:OUT; SFP:1102; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7888 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5PEPF00014B95.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f5e8fc58-82bf-4eae-b77e-08dc53d46c39 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /t5R4pNxofehWfb9JwlxMoUMOR4I4x9e6zRWZ5fjJ+8O5gg7wS+cg9Sf4hkmSOQihUuX8Lr+3508Xl2Wwy24OhhASMf6Swy0Elr23VF9pHw/4Spho9v/bZAGFhaXMSRgrJLCJpTcgoWvSM8/AakHL8sf6L0KqJ35UCNrAbUd5Dqf+TxbKRFX90ktynzL1aRvIHUEMlhiM/95qpekghy5VxnyTF/fB9mPN/J2B3BfFXpfbYJzvCksr8ToUDjyZJFmL5C9LovVFcOQE8QQBEy58DwVhc8EpVezdmp2kCG5ocQpYjNuhLTEapkN7w/WQ9IWMsC3+qRVIb8VTXCcjfVHegf4QkkMNRTlevJVJ/9hJhS6Vr2b1qQSQp4lae8Li0FUQe7s4KD84mwZ7qZBiuPUczMHCc+vA3N8GL66TM8ncO9E9WdrPLG3sNs2S64y4i9Vvj/jmBxPerhiqciy8W6zMkXVUwRYeIqca+sB4j9tQgvhhQcVYKwpd323VP4BWGhwG92ScvnisjCXJJ5tJc26ev0Ilz4sMnTC/5bw3QgFpyMoZevmMOwy2ANKQrL9/W3+fIKR6+j+zaw9BaEOZXjfckjBSg3eWO/3UpC307Gvz3io/BpHpYaXQT9gp4tjZdyPPzH+ZXgEc0YT/Jk+cuGfCA6m1lWWcggs0LcyP8PBtZhyuMBRCtGDNU7HbOhYr7DuSYaRLAZATRkmHYGBfrXt7A== 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:(13230031)(82310400014)(36860700004)(1800799015)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2024 11:51:39.3661 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f5e8fc58-82bf-4eae-b77e-08dc53d46c39 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: DB5PEPF00014B95.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB7589 X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, KAM_DMARC_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, UNPARSEABLE_RELAY autolearn=no 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 Hi, On 3/28/24 22:48, Gustavo Romero wrote: > This series introduces a new method to check for MTE-tagged addresses on > remote targets. > > A new remote packet, qMemTagAddrCheck, is introduced, along with a new > remote feature associated with it, 'memory-tagging-check-add+'. Only > when 'memory-tagging-check-add+' feature is advertised GDB will use the > new packet to query if an address is tagged. > > This new mechanism allows for checking MTE addresses in an OS-agnostic > way, which is necessary when debugging targets that do not support > '/proc//smaps', as the current method of reading the smaps contents > fails in such cases. > > Since v1: > - Fixed build error "no match for ‘operator!=’ (operand types are ‘packet_result’ and ‘packet_status’)" > reported by Linaro CI bot, caused by a last-minute rebase; > - Added instructions on how to test the series on a remote target using > QEMU gdbstub (-g option) -- see below. > > ---- > > This series can be tested with the 'mte_t' binary found in: > https://people.linaro.org/~gustavo.romero/gdb, using the GDB > 'memory-tag print-allocation-tag' command to show the allocation > tag for array pointer 'a'. To download mte_t: > > $ wget https://people.linaro.org/~gustavo.romero/gdb/mte_t > $ chmod +x ./mte_t > > ... or build it from source: > > $ wget https://people.linaro.org/~gustavo.romero/gdb/mte_t.c > $ gcc -march=armv8.5-a+memtag -static -g3 -O0 mte_t.c -o mte_t > > For example, testing the address check for the aarch64_linux_nat.c > target: > > gromero@arm64:~/code$ ~/git/binutils-gdb_remote/build/gdb/gdb -q ./mte_t > Reading symbols from ./mte_t... > (gdb) run > Starting program: /home/gromero/code/mte_t > a[] address is 0xfffff7ffc000 > a[0] = 1 a[1] = 2 > 0x100fffff7ffc000 > a[0] = 3 a[1] = 2 > Expecting SIGSEGV... > > Program received signal SIGSEGV, Segmentation fault > Memory tag violation > Fault address unavailable. > 0x0000000000418658 in write () > (gdb) bt > #0 0x0000000000418658 in write () > #1 0x000000000040a3bc in _IO_new_file_write () > #2 0x0000000000409574 in new_do_write () > #3 0x000000000040ae20 in _IO_new_do_write () > #4 0x000000000040b55c in _IO_new_file_overflow () > #5 0x0000000000407414 in puts () > #6 0x000000000040088c in main () at mte_t.c:119 > (gdb) frame 6 > #6 0x000000000040088c in main () at mte_t.c:119 > 119 printf("...haven't got one\n"); > (gdb) memory-tag print-logical-tag a > $1 = 0x1 > (gdb) memory-tag print-allocation-tag &a[16] > $2 = 0x0 > (gdb) # Tag mismatch > (gdb) > > > Testing address check on a core file: > > gromero@arm64:~/code$ ulimit -c unlimited > gromero@arm64:~/code$ ./mte_t > a[] address is 0xffffb3bcc000 > a[0] = 1 a[1] = 2 > 0x900ffffb3bcc000 > a[0] = 3 a[1] = 2 > Expecting SIGSEGV... > Segmentation fault (core dumped) > gromero@arm64:~/code$ ~/git/binutils-gdb_remote/build/gdb/gdb -q ./mte_t ./core > Reading symbols from ./mte_t... > [New LWP 256036] > Core was generated by `./mte_t'. > Program terminated with signal SIGSEGV, Segmentation fault > Memory tag violation > Fault address unavailable. > #0 0x0000000000418658 in write () > (gdb) bt > #0 0x0000000000418658 in write () > #1 0x000000000040a3bc in _IO_new_file_write () > #2 0x0000000000409574 in new_do_write () > #3 0x000000000040ae20 in _IO_new_do_write () > #4 0x000000000040b55c in _IO_new_file_overflow () > #5 0x0000000000407414 in puts () > #6 0x000000000040088c in main () at mte_t.c:119 > (gdb) frame 6 > #6 0x000000000040088c in main () at mte_t.c:119 > 119 printf("...haven't got one\n"); > (gdb) memory-tag print-logical-tag a > $1 = 0x9 > (gdb) memory-tag print-allocation-tag &a[16] > $2 = 0x0 > (gdb) # Tag mismatch > (gdb) > > > And, finally, testing it on a remote target using QEMU gdbstub > which supports the new 'memory-tagging-check-add+' feature (WIP). > > Clone and build QEMU: > > $ git clone --depth=1 --single-branch -b mte https://github.com/gromero/qemu.git > $ mkdir qemu/build && cd qemu/build > $ ../configure --target-list=aarch64-linux-user --disable-docs > $ make -j > $ wget https://people.linaro.org/~gustavo.romero/gdb/mte_t > $ chmod +x ./mte_t > $ ./qemu-aarch64 -g 1234 ./mte_t > > ... and connect to QEMU gdbstub from GDB: > > gromero@amd:~/git/binutils-gdb/build$ ./gdb/gdb -q > (gdb) target remote localhost:1234 > Remote debugging using localhost:1234 > Reading /tmp/qemu/build/mte_t from remote target... > warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead. > Reading /tmp/qemu/build/mte_t from remote target... > Reading symbols from target:/tmp/qemu/build/mte_t... > (gdb) c > Continuing. > > Program received signal SIGSEGV, Segmentation fault > Memory tag violation > Fault address unavailable. > 0x0000000000407290 in puts () > (gdb) bt > #0 0x0000000000407290 in puts () > #1 0x000000000040088c in main () at mte_t.c:119 > (gdb) frame 1 > #1 0x000000000040088c in main () at mte_t.c:119 > 119 > (gdb) memory-tag print-allocation-tag a > $1 = 0x2 > (gdb) set debug remote on > (gdb) memory-tag print-allocation-tag a > [remote] Sending packet: $qMemTagAddrCheck:200400000802000#1f > [remote] Received Ack > [remote] Packet received: 01 > [remote] Sending packet: $qMemTags:400000802000,1:1#6f > [remote] Received Ack > [remote] Packet received: m02 > $2 = 0x2 > (gdb) Out of curiosity, I see you exercised native, core and QEMU-based remote debugging. Did you give the gdbserver-based remote debugging a try? I think that is an important check given a gdb + gdbserver debugging session will also use the remote target, but will instead rely on accessing the remote smaps file.