From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id tbD+HG8rFWgTmBEAWB0awg (envelope-from ) for ; Fri, 02 May 2025 16:30:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1746217839; bh=EAHptM+SD2GuFVVjqTW2XxJnWDbQrT/qYigx6Jozkwk=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=bMfgXZErdXo4Hcky4AGGoB/+3zxnoM/r9rM2TjDszUertP6dQNYB6s5CUx92LGeDC xeMbfG6xYxSe6MBE8pzaoxqVJWsuO213H5m/LV6ShnDaOkF3UY72UUDZITnxVsnJp2 3RWw2W+AwPUOckT6Yi9KB1LvzkpEkADQT2MNPyQA= Received: by simark.ca (Postfix, from userid 112) id 68E1D1E10E; Fri, 2 May 2025 16:30:39 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-9.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE autolearn=unavailable autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=GLUhBh24; dkim=pass (1024-bit key) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=UXNaOM1C; dkim-atps=neutral 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 2E1E61E089 for ; Fri, 2 May 2025 16:30:38 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BF9273858C41 for ; Fri, 2 May 2025 20:30:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF9273858C41 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=GLUhBh24; dkim=pass (1024-bit key) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=UXNaOM1C Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id EDA473858D20 for ; Fri, 2 May 2025 20:30:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EDA473858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EDA473858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1746217806; cv=none; b=jaJw2445bLGpoS3aGSaIdTt843Z9ciI5rXEsIakGB6+34XjHqAx/WKswywZrOwWUA2ACYzMaINrzZtIFgUOr8decMci5nH/a0yz2vxrT07ShOhtU3oU2mlqd3yDCh+Y3iLz2YzaokkrZS61+rip4QrRixRN1MylgYxs5g0rPZho= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1746217806; c=relaxed/simple; bh=EAHptM+SD2GuFVVjqTW2XxJnWDbQrT/qYigx6Jozkwk=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:MIME-Version: Subject:To:From; b=GfT7huSNcUlo05VLfWYLlSmsPVdpdm82ZIHYt07QtO0Ns92+k30/qNTLCDrERICnZQcsPk1h6FttcbzkcbN52XtzZ8P8pKXP4PBfGWMkh0vn8B5B9ENn8KIxdR/W+/PWKjahOiP+EVsquooBZE4w+FNkFn5iSQOsUjthRVTavKE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EDA473858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1746217805; bh=EAHptM+SD2GuFVVjqTW2XxJnWDbQrT/qYigx6Jozkwk=; h=Date:Subject:To:References:From:In-Reply-To:From; b=GLUhBh24i+a79oVDLg6fbXbw+BJfn57J8fbmIzSMl4T/JCDdLd+AfSPRrQE9U81D6 ioxByvtQBns4EFwd2GZFMQ63jpvIJmZyAVTzCaU0ZRp3n5QNjjt4z3Fp4cejxvJ79P pq9CV7GyFGWx6e4bB1jgeDQBgAKFD3A4mIvpOSfU= Received: by simark.ca (Postfix, from userid 112) id A5D711E10E; Fri, 2 May 2025 16:30:05 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1746217804; bh=EAHptM+SD2GuFVVjqTW2XxJnWDbQrT/qYigx6Jozkwk=; h=Date:Subject:To:References:From:In-Reply-To:From; b=UXNaOM1CAcczmPLSmxXPm3iaQnGr4+6IMlpCRZ9YhZGlZMlYFEj9nr13Y+eimN6jk nmC00GDv9nlQXjJu7cg3sYlMAZ7Wg6bc8lpITjP1XeiJb9kq/HvAHCRlyLGbADYE+T UKbg0F5Wz6U2uWuLUCJKpa6ISF388J7tPVWOqagc= Received: from [10.0.0.11] (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id BB1291E089; Fri, 2 May 2025 16:30:04 -0400 (EDT) Message-ID: <0dfbab20-4262-4dca-b2dd-fece5f93df08@simark.ca> Date: Fri, 2 May 2025 16:30:04 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Fix "set debug parser" To: Tom Tromey , gdb-patches@sourceware.org References: <20250426231242.926679-1-tom@tromey.com> Content-Language: en-US From: Simon Marchi In-Reply-To: <20250426231242.926679-1-tom@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 2025-04-26 19:12, Tom Tromey wrote: > While debugging my longer series, I discovered that I broken "set > debug parser" a couple years ago. This patch fixes it and adds a > minimal test case so that it, hopefully, will not break again. > > This patch also adds parser debugging to the C++ name canonicalizer. I think this introduced some tsan failures, since multiple threads write yydebug without synchronization: WARNING: ThreadSanitizer: data race (pid=1311054) Read of size 4 at 0x58c55ad4a1f0 by thread T5: #0 scoped_restore_tmpl::scoped_restore_tmpl(int*, bool) /home/simark/src/binutils-gdb/gdb/../gdbsupport/scoped_restore.h:71 (gdb+0xb7a0fe) (BuildId: 8f118bec5111347e0f2a78a7dc2fed594eb4ef55) #1 scoped_restore_tmpl make_scoped_restore(int*, bool) /home/simark/src/binutils-gdb/gdb/../gdbsupport/scoped_restore.h:115 (gdb+0xb6bdbd) (BuildId: 8f118bec5111347e0f2a78a7dc2fed594eb4ef55) #2 cp_demangled_name_to_comp(char const*, std::__cxx11::basic_string, std::allocator >*) /home/simark/src/binutils-gdb/gdb/cp-name-parser.y:2051 (gdb+0xfaec69) (BuildId: 8f118bec5111347e0f2a78a7dc2fed594eb4ef55) #3 cp_canonicalize_string(char const*) /home/simark/src/binutils-gdb/gdb/cp-support.c:635 (gdb+0xfbf01d) (BuildId: 8f118bec5111347e0f2a78a7dc2fed594eb4ef55) #4 c_canonicalize_name(char const*) /home/simark/src/binutils-gdb/gdb/c-lang.c:732 (gdb+0xe70f6f) (BuildId: 8f118bec5111347e0f2a78a7dc2fed594eb4ef55) #5 cooked_index_shard::finalize(parent_map_map const*) /home/simark/src/binutils-gdb/gdb/dwarf2/cooked-index-shard.c:273 (gdb+0x104cbcf) (BuildId: 8f118bec5111347e0f2a78a7dc2fed594eb4ef55) Changing yydebug to be an std::atomic would probably fix it, but it's generated by bison, not sure this is an option. We'll probably need to do a custom scoped restore type for this. Simon