Re: [PATCH] Fix thread-safety for elfutils

2023-10-10 Thread Mark Wielaard
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 26921 > and bug 26930 >

[PATCH 03/16] libelf: Fix deadlock in __libelf_readall

2023-10-10 Thread Mark Wielaard
From: Heather McIntyre * libelf/elf_readall.c (__libelf_readall): Move rwlock_unlock before libelf_acquire_all. Signed-off-by: Heather S. McIntyre Signed-off-by: Mark Wielaard --- libelf/elf_readall.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib

[PATCH 02/16] libelf: Make elf_version thread-safe

2023-10-10 Thread Mark Wielaard
From: Heather McIntyre * elf_version.c (version_once): Define once. (initialize_version): New static function. (elf_version): Use initialize_version version_once. Signed-off-by: Heather S. McIntyre Signed-off-by: Mark Wielaard --- libelf/elf_version.c | 11 ++-

[PATCH 05/16] libelf: Fix elf_end deadlock

2023-10-10 Thread Mark Wielaard
From: Heather McIntyre * libelf/elf_end.c (elf_end): Add rwlock_unlock before early return. Signed-off-by: Heather S. McIntyre Signed-off-by: Mark Wielaard --- libelf/elf_end.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libelf/elf_end.c b/libelf/el

[PATCH 04/16] libelf: Fix deadlock in elf_cntl

2023-10-10 Thread Mark Wielaard
From: Heather McIntyre * libelf/elf_cntl.c (elf_cntl): Move rwlock_wrlock, rwlock_unlock, inside case switch statements. Signed-off-by: Heather S. McIntyre Signed-off-by: Mark Wielaard --- libelf/elf_cntl.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) dif

[PATCH 01/16] lib: Add new once_define and once macros to eu-config.h

2023-10-10 Thread Mark Wielaard
From: Heather McIntyre * lib/eu-config.h New macros. [USE_LOCKS] (ONCE_CALL): (once_define, once) Signed-off-by: Heather S. McIntyre Signed-off-by: Mark Wielaard --- lib/eu-config.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/lib/eu-config.h b/lib/eu-config.h in

[PATCH 08/16] libcpu: Change calls for tsearch/tfind to eu_tsearch/eu_tfind.

2023-10-10 Thread Mark Wielaard
From: Heather McIntyre * libcpu/Makefile.am: Add USE_LOCKS condition for -pthread. * libcpu/i386_parse.y: Add eu-search.h and remove search.h. Change calls for tsearch/tfind to eu_tsearch/eu_tfind. Signed-off-by: Heather S. McIntyre Signed-off-by: Mark Wielaard --- lib

[PATCH 06/16] libelf: Make elf32_getchdr and elf64_getchdr thread-safe

2023-10-10 Thread Mark Wielaard
From: Heather McIntyre * libelf/elf32_getchdr.c: Move getchdr function to elf32_getchdr.h. * libelf/elf32_getchdr.h: New file. Add macro to create getchdr_wrlock. * libelf/elf32_updatenull.c: Change call from getchdr to getchdr_wrlock. * lib

[PATCH 07/16] lib: Add eu_tsearch and eu_tfind

2023-10-10 Thread Mark Wielaard
From: Heather McIntyre * lib/eu-search.h: New file. Declarations for read/write locked eu_tsearch/eu_tfind. * lib/eu-search.c: New file. Definitions for read/write locked eu_tsearch/eu_tfind. * Makefile.am (libeu_a_SOURCES): Add eu-search.c. Signed-off-by:

[PATCH 11/16] libdw: Add locking around __libdw_dieabbrev for dwarf_hasattr

2023-10-10 Thread Mark Wielaard
From: Heather McIntyre * libdw/dwarf_hasattr.c (dwarf_hasattr): Use die_abbrev_lock around __libdw_dieabbrev call. Signed-off-by: Heather S. McIntyre Signed-off-by: Mark Wielaard --- libdw/dwarf_hasattr.c | 9 + 1 file changed, 9 insertions(+) diff --git a/libdw/dwarf

[PATCH 12/16] libdw: Make libdw_find_split_unit thread-safe

2023-10-10 Thread Mark Wielaard
From: Heather McIntyre * (try_split_file): Use eu_tsearch. Add lock for cu->split. Signed-off-by: Heather S. McIntyre Signed-off-by: Mark Wielaard --- libdw/libdw_find_split_unit.c | 43 +-- 1 file changed, 36 insertions(+), 7 deletions(-) diff

[PATCH 10/16] libdw: make dwarf_getalt thread-safe

2023-10-10 Thread Mark Wielaard
From: Heather McIntyre * libdw/dwarf_getalt.c: Add lock for dbg->alt_dwarf/main->alt_dwarf. Signed-off-by: Heather S. McIntyre Signed-off-by: Mark Wielaard --- libdw/dwarf_getalt.c | 27 ++- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a

[PATCH 16/16] configure: No longer mark --enable-thread-safety as EXPERIMENTAL

2023-10-10 Thread Mark Wielaard
From: Heather McIntyre * configure.ac (--enable-thread-safety): Remove experimental warning. Signed-off-by: Heather S. McIntyre Signed-off-by: Mark Wielaard --- configure.ac | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac i

[PATCH 13/16] libdw: Make libdw_findcu thread-safe

2023-10-10 Thread Mark Wielaard
From: Heather McIntyre * libdw/libdw_findcu.c (findcu_cb): Use eu_tsearch. (__libdw_findcu): Use eu_tfind and next_tucu_offset_lock. (__libdw_findcu_addr): Use eu_tfind. (__libdw_find_split_dbg_addr): Likewise. Signed-off-by: Heather S. McIntyre Signed-off-by: Ma

[PATCH 09/16] src: Use eu-search in nm and findtextrel.

2023-10-10 Thread Mark Wielaard
From: Heather McIntyre * src/Makefile.am: Add USE_LOCKS condition for -pthread. * src/findtextrel.c: Add eu-search.h and remove search.h. Change calls of tsearch/tfind to eu_tsearch/eu_tfind. * src/nm.c: Likewise. Signed-off-by: Heather S. McIntyre Signed-off-by:

[PATCH 14/16] libdw,libdwfl: Use eu-search for thread-safety

2023-10-10 Thread Mark Wielaard
From: Heather McIntyre * libdw/cie.c: Add eu-search.h and remove search.h. Change calls of tsearch/tfind to eu_tsearch/eu_tfind. * libdw/dwarf_getlocation.c: Likewise. * libdw/dwarf_getmacros.c: Likewise. * libdw/dwarf_getsrclines.c: Likewise. * lib

[PATCH 15/16] tests: Add eu-search tests

2023-10-10 Thread Mark Wielaard
From: Heather McIntyre * tests/eu_search_cfi.c: New file. * tests/eu_search_die.c: New file. * tests/eu_search_lines.c: New file. * tests/eu_search_macros.c: New file. * tests/run-eu-search-tests.sh: New test. * tests/Makefile.am: Add USE_LOCKS cond

Re: [PATCH 01/16] lib: Add new once_define and once macros to eu-config.h

2023-10-10 Thread Mark Wielaard
Hi Heather, On Tue, 2023-10-10 at 15:42 +0200, Mark Wielaard wrote: > From: Heather McIntyre > > * lib/eu-config.h New macros. > [USE_LOCKS] (ONCE_CALL): (once_define, once) > > Signed-off-by: Heather S. McIntyre > Signed-off-by: Mark Wielaard > --- > lib/eu-config.h | 7 +++

Re: [PATCH 02/16] libelf: Make elf_version thread-safe

2023-10-10 Thread Mark Wielaard
Hi Heather, On Tue, 2023-10-10 at 15:42 +0200, Mark Wielaard wrote: > From: Heather McIntyre > > * elf_version.c (version_once): Define once. > (initialize_version): New static function. > (elf_version): Use initialize_version version_once. > > Signed-off-by: Heather S. McInty

Re: [PATCH 03/16] libelf: Fix deadlock in __libelf_readall

2023-10-10 Thread Mark Wielaard
Hi Heather, On Tue, 2023-10-10 at 15:42 +0200, Mark Wielaard wrote: > From: Heather McIntyre > > * libelf/elf_readall.c (__libelf_readall): Move rwlock_unlock > before libelf_acquire_all. > > Signed-off-by: Heather S. McIntyre > Signed-off-by: Mark Wielaard > --- > libelf/elf_rea

Re: [PATCH 04/16] libelf: Fix deadlock in elf_cntl

2023-10-10 Thread Mark Wielaard
Hi Heather, On Tue, 2023-10-10 at 15:42 +0200, Mark Wielaard wrote: > From: Heather McIntyre > > * libelf/elf_cntl.c (elf_cntl): Move rwlock_wrlock, rwlock_unlock, > inside case switch statements. > > Signed-off-by: Heather S. McIntyre > Signed-off-by: Mark Wielaard > --- > libel

Re: [PATCH 05/16] libelf: Fix elf_end deadlock

2023-10-10 Thread Mark Wielaard
Hi Heather, On Tue, 2023-10-10 at 15:42 +0200, Mark Wielaard wrote: > From: Heather McIntyre > > * libelf/elf_end.c (elf_end): Add rwlock_unlock before > early return. > > Signed-off-by: Heather S. McIntyre > Signed-off-by: Mark Wielaard > --- > libelf/elf_end.c | 5 - > 1 fi

Re: [PATCH 06/16] libelf: Make elf32_getchdr and elf64_getchdr thread-safe

2023-10-10 Thread Mark Wielaard
Hi Heather, On Tue, 2023-10-10 at 15:42 +0200, Mark Wielaard wrote: > From: Heather McIntyre > > * libelf/elf32_getchdr.c: Move getchdr function to > elf32_getchdr.h. > * libelf/elf32_getchdr.h: New file. > Add macro to create getchdr_wrlock. That is clever. I do wonder

Re: [PATCH 07/16] lib: Add eu_tsearch and eu_tfind

2023-10-10 Thread Mark Wielaard
Hi Heather, On Tue, 2023-10-10 at 15:42 +0200, Mark Wielaard wrote: > From: Heather McIntyre > > * lib/eu-search.h: New file. > Declarations for read/write locked eu_tsearch/eu_tfind. Like in the previous case, don't forget to add such a new header to noinst_HEADERS so make dist add

[Bug debuginfod/30962] New: ensure x-debuginfod-file / -archive headers always return full path names

2023-10-10 Thread fche at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30962 Bug ID: 30962 Summary: ensure x-debuginfod-file / -archive headers always return full path names Product: elfutils Version: unspecified Status: NEW Severity:

PATCH PR30962, debuginfod

2023-10-10 Thread Frank Ch. Eigler
commit e967988e419121cad1d7f40013a316059b1173f0 Author: Frank Ch. Eigler Date: Tue Oct 10 16:21:00 2023 -0400 PR30962: debuginfod: full paths for X-DEBUGINFOD-FILE/ARCHIVE response headers Previous code was inconsistent in offering basename versus full pathname for these heade

Re: [PATCH 08/16] libcpu: Change calls for tsearch/tfind to eu_tsearch/eu_tfind.

2023-10-10 Thread Mark Wielaard
Hi Heather, On Tue, Oct 10, 2023 at 03:42:52PM +0200, Mark Wielaard wrote: > From: Heather McIntyre > > * libcpu/Makefile.am: Add USE_LOCKS condition for -pthread. > * libcpu/i386_parse.y: Add eu-search.h and remove search.h. > Change calls for tsearch/tfind to eu_tsearch/eu_tf

Re: [PATCH 09/16] src: Use eu-search in nm and findtextrel.

2023-10-10 Thread Mark Wielaard
Hi Heather, On Tue, Oct 10, 2023 at 03:42:53PM +0200, Mark Wielaard wrote: > From: Heather McIntyre > > * src/Makefile.am: Add USE_LOCKS condition for -pthread. > * src/findtextrel.c: Add eu-search.h and remove search.h. > Change calls of tsearch/tfind to eu_tsearch/eu_tfind. >

Re: [PATCH 10/16] libdw: make dwarf_getalt thread-safe

2023-10-10 Thread Mark Wielaard
Hi Heather, On Tue, Oct 10, 2023 at 03:42:54PM +0200, Mark Wielaard wrote: > * libdw/dwarf_getalt.c: Add lock for > dbg->alt_dwarf/main->alt_dwarf. This takes care of dwarf_getalt. Shouldn't dwarf_setalt also use locking? > Signed-off-by: Heather S. McIntyre > Signed-off-by: Mark Wi