From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2123.outbound.protection.outlook.com [40.107.22.123]) by sourceware.org (Postfix) with ESMTPS id 3AAAA3839C66 for ; Mon, 30 May 2022 07:10:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3AAAA3839C66 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=Syrmia.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Syrmia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dqZb+vy31o3Ubjc4+jUSewtOYEQcyG5X5H0khu6ZIjW89ZJED7oXlUa0QbLs/G42K4RQO8ZZe1nIvvMW9f6WNuK4V+I6ue+zjytO6Q5J9YPCilPRNG1C+5yzO35Vt/4Ur/eVAYZq+kHqvthohLOBqWTNIeKWxSfWOSi2e8D44lrNbSza2H2jg+PigrGQDTAswzdbfbgZhZWX9gf3ije4+ORVafJTonMsJQrW82SnXZ5gyR/7Gu6vn/dlMhmO1r8C+A5Mhm+2b+jdJhVIYIQwSp+wqYMwHLkKW3tA4GlzGcuEJWVZYTDGZcpbnAr8dTOwNdEsXpu5KVzL9oQKL8OaBQ== 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=9cJWtF73KAQd6RtE3c9rNSjZMfywG8OjLrLMiSxdLm4=; b=AN6yclBZvYmiZQI6mPR3E6Bkt6s7qDAbeInNDuqZ9+D1HnzcK+7htnNmeobarWBdTmU3F8gz/Urf66prGi6J5IdlQmOtjlqyHVick3uZTk1nLve1uA6ZyO48S0OsbZ0ckqYj43UmRQ8glZP8vXLV0y9IbIwqVmMfYfUS7FVZDCBBV5jB0ctsFwuDByyepUed+hEF1odjHNhYGDfkFA20c/YCgPtgdOtx4Ojob3HSkxc7RgmHeZqzzXqAxHR2nqGll6mePGJHFxwaDMbAhS00mSOQ7UXtnVOR3lz46g7MbPBRmW263jKTrCHI5v6NMCYGy9w2acUWMEwvV2K4Ro/zWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=syrmia.com; dmarc=pass action=none header.from=syrmia.com; dkim=pass header.d=syrmia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=syrmia.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9cJWtF73KAQd6RtE3c9rNSjZMfywG8OjLrLMiSxdLm4=; b=Jj7931blrhQecYhLqIKzM8pkAIDFwjcH9LAsS9R33Td+7a9h1pXXL01WQz/OaccfJhaibQp6q0BOyseaZUKAdr6APeOTFNEhLyILRgkMSsDazcCsbi5+5pyaoNn6rAHpYDRwCvIt//tZqIbm3aZIgK3KiMNvub1B4J8hfh4irbM= Received: from AM0PR03MB4882.eurprd03.prod.outlook.com (2603:10a6:208:fb::17) by DB6PR0302MB2728.eurprd03.prod.outlook.com (2603:10a6:4:b1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.19; Mon, 30 May 2022 07:10:30 +0000 Received: from AM0PR03MB4882.eurprd03.prod.outlook.com ([fe80::b5d4:70dc:8a0:6d02]) by AM0PR03MB4882.eurprd03.prod.outlook.com ([fe80::b5d4:70dc:8a0:6d02%4]) with mapi id 15.20.5293.019; Mon, 30 May 2022 07:10:30 +0000 From: Dimitrije Milosevic To: Xi Ruoyao , "gcc-patches@gcc.gnu.org" CC: Djordje Todorovic Subject: Re: [PATCH] Mips: Enable asynchronous unwind tables with both ASAN and TSAN Thread-Topic: [PATCH] Mips: Enable asynchronous unwind tables with both ASAN and TSAN Thread-Index: AQHYcn4I0I45Pn2LTE2LxMfdNXuhBa02/brF Date: Mon, 30 May 2022 07:10:30 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: suggested_attachment_session_id: 35b23ea3-2232-e370-025c-b63850917baf authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=Syrmia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e3296cb2-a651-4f5b-ec59-08da420b7b0b x-ms-traffictypediagnostic: DB6PR0302MB2728:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Ntl4mgK0UmDpNH/9UHO7/LEmnhxGc7b+cE6HQo4SdGYReEG8M7HAH7byMl9q8UPCMdU2b1uK0PfvCjsFlzD60Wf6PEme8vkHO4msBT0SPTZVgh1t0Dma4UGz6ApXQX0Uf9goU+unODe9kvPmho42X0tht/l7Vdf4SwkWWtLMltyDcN1hVkVHoLfx+oEnA1ER0DY0ztknfSmdXByFMNSEolrXWSQEHp1uliAHj7a1R0AuqvoRL94rMux8hmTrB/eQsEtyyqMncHfTTBL9S2qfVARgDyAh+FhMtJXOzIE5jymVBUshPnDkYdSq0Kyod5B3u5KQRVBq1V1dOvSHrj3QK4g+3MkGAJOovi2GZFm24qIgwkOziMwFkmNteXK+7BExlhpo8ydXwjsS57xXHR5GgWfuf+Mzzgq6Xm5Dp4CoZ97YU+ajQBVsEs1akoW3ixrNNB/ZAOFqRQauAoav25SLjzuIadNO9Q59a3CPl2CGH7TvjvjK+mG+z9Eaq/mNxFmg5zos5eFblaX9F7pDqEjNO/Qhyy9GLHrH6IzZsDV//IM13IhVqQhzjIsEuQiVS8Kr6GfR8uslhn9BZjWe0QtiVMmGTES0uxq8eMdxfMP03D6GOgy+FnT2oeZGuooAALBnA0jFUxvCx/lzVudvMvHDLgBrBpgAOfEx8vu3ivE88WsOsmCN4rn3bKVDDBYclVpnVMwDCzIjktcInLUtsd1vvv09rF5Grn2/6bB+CGptdsA6Isx5DmNtFjpSWXWP/L0NNN9TeeuwNbVi+kHzWbcCdqolMkCQIcsW71R2CzT4ZhY= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR03MB4882.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(396003)(346002)(136003)(39830400003)(366004)(376002)(6506007)(7696005)(2906002)(316002)(110136005)(53546011)(26005)(9686003)(19627235002)(19627405001)(122000001)(38070700005)(83380400001)(55016003)(8936002)(66946007)(38100700002)(5660300002)(86362001)(52536014)(4326008)(64756008)(66556008)(66476007)(21615005)(166002)(76116006)(66446008)(8676002)(91956017)(71200400001)(33656002)(966005)(508600001)(41300700001)(107886003)(186003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?tQDWWVRKErI3jTazEFfFvjWMcElIYx8M//5H0lez2eZY5XW23y0W1AP/Sh?= =?iso-8859-1?Q?08iDo6ebciOM08+a5MUb4l/WqR6/ZKWuLlpY+OpJOR5Ed9gjJEAW50ayKr?= =?iso-8859-1?Q?hS1Y19sYzVleKY6Yb1dfFFRLl/D/6qHP4AqATky7Q/T8uwcZPaS/BqY3r7?= =?iso-8859-1?Q?ZaRLo6TA3wMzvUPrwMODUXrKVsj1On06ELB3Pk+91Qbz80lpb6UebScGi4?= =?iso-8859-1?Q?Y4JOrtFxKMevCCSXwRU9hKXm2uRggER2MeTiJS0KyBNh/fq8wAobPCbHWy?= =?iso-8859-1?Q?bnnIEqggEG/Rdp6+VpPyqgpYkC/0F27ZMu5FSYLoxWTCNUwQCZLldJOFsJ?= =?iso-8859-1?Q?/pmPpDPRlq+TRNVUfGs5ctnrXnjaHdx631ue7DunszN9nzjooEbon29EHq?= =?iso-8859-1?Q?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65QF6QDIg3veCC2e8iYxub?= =?iso-8859-1?Q?UETnMqYqQ7slbNRM9VhkSfpxAHMt6c4/Dvsb6cVRNcsCaQuW4Gbsn7C8Ic?= =?iso-8859-1?Q?P/30EGNLE/rEZsBOieuPFjU6ZcsgMkEt4TC9r64os5jDTZmcWFvE5XF0fk?= =?iso-8859-1?Q?cezSNMUXDd5a03KXFhHbR3l3cL7UbXpLbV/6BrzXhEelkRd6g5Kpk1MI0K?= =?iso-8859-1?Q?fDuomjfIeTFKM+uOs8cCalXJUrsqo+pHhLgk8hCmZppgUh4cLZPFAARusO?= =?iso-8859-1?Q?7tvsgAhf7W2GhXMpprnvUgYDFmRR6yuJt8sPO8HsN+DMusiEbSfp6oEYV/?= =?iso-8859-1?Q?A1EU6EvMUB178JWvkXVjnreMMB08Aw/6oA798L5PRRoedlnd6g56aO81NR?= =?iso-8859-1?Q?0yblxMQNHZhJA5rO8xgC8ziId/5Re9yd5B8wMI2uTyByP8a2XyKZrNA25a?= =?iso-8859-1?Q?57OT3lVCx/dV8GU3evXjsEnfypjSyllFZQu2CCKbTz3MdY3wWeJ186B7D7?= =?iso-8859-1?Q?Cx8lQ+o1TEwnOEugF7R3XcZc4V81Sy0=3D?= MIME-Version: 1.0 X-OriginatorOrg: syrmia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM0PR03MB4882.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e3296cb2-a651-4f5b-ec59-08da420b7b0b X-MS-Exchange-CrossTenant-originalarrivaltime: 30 May 2022 07:10:30.2642 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 19214a73-c1ab-4e19-8f59-14bdcb09a66e X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: iZHNgpz7MgR8bxHPIVCpZTSHFVRuT1nUNoYhj83ij/aR7yMlnIs8cziOAnueMxdcppk5SijUz1dUgq1JVIXIoa9sJy5jQVLSxyJ4werhabI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0302MB2728 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 May 2022 07:10:34 -0000 Hi Xi, thanks for pointing this out. I'd definitely say that the https://cl= ang.llvm.org/docs/ThreadSanitizer.html documentation is outdated. According= to https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual#supp= orted-platforms TSAN is supported on Mips64. Furthermore, there are actual = code segments (in compiler-rt/lib/tsan/rtl/tsan_platforms.h, for example) r= elated to Mips64. I didn't add the 64-bit target check, however. Here is the updated version = of the patch. gcc/ChangeLog: * config/mips/mips.cc (mips_option_override): Enable asyncronous unwind tables with both ASAN and TSAN. --- gcc/config/mips/mips.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc index e64928f4113..2dce4007678 100644 --- a/gcc/config/mips/mips.cc +++ b/gcc/config/mips/mips.cc @@ -20115,10 +20115,16 @@ mips_option_override (void) target_flags |=3D MASK_64BIT; } - /* -fsanitize=3Daddress needs to turn on -fasynchronous-unwind-tables in - order for tracebacks to be complete but not if any - -fasynchronous-unwind-table were already specified. */ - if (flag_sanitize & SANITIZE_USER_ADDRESS + /* -fsanitize=3Daddress, and -fsanitize=3Dthread need to turn + on -fasynchronous-unwind-tables in order for tracebacks + to be complete but not if any -fasynchronous-unwind-table + were already specified. */ + /* FIXME: HWSAN is currently only available on AArch64, + but could also utilize -fasynchronous-unwind-tables. + FIXME: We would also like to check if -ffreestanding is passed in. + However, it is only available in C-ish frontends. */ + if (((flag_sanitize & SANITIZE_USER_ADDRESS) + || (TARGET_64BIT && (flag_sanitize & SANITIZE_THREAD))) && !global_options_set.x_flag_asynchronous_unwind_tables) flag_asynchronous_unwind_tables =3D 1; --- ________________________________ From: Xi Ruoyao Sent: Saturday, May 28, 2022 12:30 PM To: Dimitrije Milosevic ; gcc-patches@gcc.g= nu.org Cc: Djordje Todorovic Subject: Re: [PATCH] Mips: Enable asynchronous unwind tables with both ASAN= and TSAN On Thu, 2022-05-26 at 14:18 +0000, Dimitrije Milosevic wrote: > Enable asynchronous unwind tables with both ASAN and TSAN for correct bac= k-trace. > LLVM currently enables asynchronous unwind tables for: ASAN, HWSAN, TSAN,= MSAN, and DFSAN. > HWSAN is currently available only on AArch64, while MSAN and DFSAN are no= t available at all. > Also, LLVM checks is '-ffreestanding' is not passed in. '-ffreestanding' = is only available in C-family frontends, hence why no such check is include= d. > TODO: Not sure if any tests should be added. According to https://clang.llvm.org/docs/ThreadSanitizer.html, TSAN is not supported on MIPS. Is this doc outdated? -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University