From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 66B203858D32 for ; Tue, 10 Oct 2023 13:40:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 66B203858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from r6.localdomain (82-217-174-174.cable.dynamic.v4.ziggo.nl [82.217.174.174]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 1F43B300B302; Tue, 10 Oct 2023 15:40:14 +0200 (CEST) Received: by r6.localdomain (Postfix, from userid 1000) id C45EF34031B; Tue, 10 Oct 2023 15:40:13 +0200 (CEST) Message-ID: <301fac87e83ebbbd677750579ae9a3429b461bdf.camel@klomp.org> Subject: Re: [PATCH] Fix thread-safety for elfutils From: Mark Wielaard To: Heather McIntyre , elfutils-devel@sourceware.org Cc: John Mellor-Crummey Date: Tue, 10 Oct 2023 15:40:13 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-Spam-Status: No, score=-3027.0 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Heather, On Tue, 2023-08-08 at 12:07 -0500, Heather McIntyre via Elfutils-devel wrote: > This patch was created to address thread-safety issues reported in bug 26= 921 > and bug 26930 > . > Additionally, other thread-safety fixes were applied during the process. >=20 > Brief Description: > Locking was implemented for tsearch and tfind. > Changes to multiple files within the libelf library were made such that > USE_LOCKS no longer causes tests to fail when enabled. > New tests were added to confirm thread-safety. Very nice. That is a lot of work. And I must admit that I cannot hold that much work in my little head at the same time. So I have split up your commit into (what I hope are) logical independent parts. That will make it easier to review. I might have split it into too many parts, but that at least makes it easier to just add those parts that are trivially correct. The only changes I made were: 1. Move the ChangeLog entries into the commit message (This is something we do now and makes cherry picking small changes easier, but I see it isn't actually documented in CONTRIBUTING, sorry. I'll try to update that.) 2. Fixed up some Copyright notices as discussed off-list. 3. Made some whitespace/indentation changes which made the diffs slightly smaller (in most cases). I'll comment/review the individual commits. Which I'll post to the list. Heather McIntyre (16): lib: Add new once_define and once macros to eu-config.h libelf: Make elf_version thread-safe libelf: Fix deadlock in __libelf_readall libelf: Fix deadlock in elf_cntl libelf: Fix elf_end deadlock libelf: Make elf32_getchdr and elf64_getchdr thread-safe lib: Add eu_tsearch and eu_tfind libcpu: Change calls for tsearch/tfind to eu_tsearch/eu_tfind. src: Use eu-search in nm and findtextrel. libdw: make dwarf_getalt thread-safe libdw: Add locking around __libdw_dieabbrev for dwarf_hasattr libdw: Make libdw_find_split_unit thread-safe libdw: Make libdw_findcu thread-safe libdw,libdwfl: Use eu-search for thread-safety tests: Add eu-search tests configure: No longer mark --enable-thread-safety as EXPERIMENTAL Which can also be found here: https://code.wildebeest.org/git/user/mjw/elfutils/log/?h=3Dthread-safety Cheers, Mark