From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 28D71385842D for ; Tue, 7 Sep 2021 12:16:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 28D71385842D Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 63C9A1FF78; Tue, 7 Sep 2021 12:16:30 +0000 (UTC) Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id 4E9FE13A24; Tue, 7 Sep 2021 12:16:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id fw36ER5YN2FFYwAAGKfGzw (envelope-from ); Tue, 07 Sep 2021 12:16:30 +0000 Subject: Re: [PATCH 00/30] Rewrite the DWARF "partial" reader From: Tom de Vries To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20210826021937.1490292-1-tom@tromey.com> <554345a9-ad2c-845e-9179-320a6967b07d@suse.de> <87lf4nlws2.fsf@tromey.com> <87r1ebj7nt.fsf@tromey.com> <875yvdjxmi.fsf@tromey.com> Message-ID: <0a0c42a2-31dc-feec-0f74-6ee582f2197a@suse.de> Date: Tue, 7 Sep 2021 14:16:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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: Tue, 07 Sep 2021 12:16:32 -0000 On 9/7/21 12:58 PM, Tom de Vries wrote: > the > gdb.dwarf2/fission-multi-cu still fails. I'm getting 1000/1000 with: ... diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index f4c6ee8c223..af57a6761f8 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -9820,6 +9820,10 @@ allocate_dwo_file_hash_table () xcalloc, xfree)); } +#if CXX_STD_THREAD +static std::mutex dwo_files_mutex; +#endif /* CXX_STD_THREAD */ + /* Lookup DWO file DWO_NAME. */ static void ** @@ -10536,6 +10540,10 @@ create_dwo_unit_in_dwp_v1 (dwarf2_per_objfile *per_objfile, sections.line.get_id (), sections.loc.get_id (), sections.str_offsets.get_id ()); + +#if CXX_STD_THREAD + std::lock_guard guard (dwo_files_mutex); +#endif /* Can we use an existing virtual DWO file? */ dwo_file_slot = lookup_dwo_file_slot (per_objfile, virtual_dwo_name.c_str (), comp_dir); @@ -10721,6 +10729,9 @@ create_dwo_unit_in_dwp_v2 (dwarf2_per_objfile *per_objfile, (long) (sections.loc_size ? sections.loc_offset : 0), (long) (sections.str_offsets_size ? sections.str_offsets_offset : 0)); +#if CXX_STD_THREAD + std::lock_guard guard (dwo_files_mutex); +#endif /* Can we use an existing virtual DWO file? */ dwo_file_slot = lookup_dwo_file_slot (per_objfile, virtual_dwo_name.c_str (), comp_dir); @@ -10892,6 +10903,9 @@ create_dwo_unit_in_dwp_v5 (dwarf2_per_objfile *per_objfile, ? sections.str_offsets_offset : 0), (long) (sections.macro_size ? sections.macro_offset : 0), (long) (sections.rnglists_size ? sections.rnglists_offset: 0)); +#if CXX_STD_THREAD + std::lock_guard guard (dwo_files_mutex); +#endif /* Can we use an existing virtual DWO file? */ dwo_file_slot = lookup_dwo_file_slot (per_objfile, virtual_dwo_name.c_str (), @@ -11661,6 +11675,9 @@ lookup_dwo_cutu (dwarf2_cu *cu, const char *dwo_name, const char *c omp_dir, { /* No DWP file, look for the DWO file. */ +#if CXX_STD_THREAD + std::lock_guard guard (dwo_files_mutex); +#endif dwo_file_slot = lookup_dwo_file_slot (per_objfile, dwo_name, comp_dir); if (*dwo_file_slot == NULL) { ... Thanks, - Tom