Re: [PATCH] backends: allocate enough stace for null terminator

2024-07-17 Thread Mark Wielaard
Hi Sergei, On Mon, 2024-07-15 at 22:23 +0100, Sergei Trofimovich wrote: > `gcc-15` added a new warning in https://gcc.gnu.org/PR115185: > > i386_regs.c:88:11: error: initializer-string for array of 'char' is too > long [-Werror=unterminated-string-initialization] >88 | "ax"

[PATCH v2] backends: allocate enough stace for null terminator

2024-07-17 Thread Sergei Trofimovich
`gcc-15` added a new warning in https://gcc.gnu.org/PR115185: i386_regs.c:88:11: error: initializer-string for array of 'char' is too long [-Werror=unterminated-string-initialization] 88 | "ax", "cx", "dx", "bx", "sp", "bp", "si", "di", "ip" | ^~~~ `elfut

[PATCH 0/9 v2] Fix thread-safety for elfutils

2024-07-17 Thread Aaron Merey
v1 can be found at https://sourceware.org/pipermail/elfutils-devel/2023q3/006329.html Heather McIntyre is the original author of v1 of these patches. Heather and myself co-wrote v2. Aaron Merey (9): libelf: Fix deadlock in __libelf_readall libelf: Fix deadlock in elf_cntl lib: Add eu_tsearc

[PATCH 2/9 v2] libelf: Fix deadlock in elf_cntl

2024-07-17 Thread Aaron Merey
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: Aaron Merey Signed-off-by: Mark Wielaard --- v2 changes: Remove unnecessary locking and checking of elf->

[PATCH 1/9 v2] libelf: Fix deadlock in __libelf_readall

2024-07-17 Thread Aaron Merey
From: Heather McIntyre Apply locking during __libelf_readall. Signed-off-by: Heather S. McIntyre Signed-off-by: Aaron Merey Signed-off-by: Mark Wielaard --- v2 changes: Add locking for all early returns in __libelf_readall. libelf_{acquire,release}_all have been renamed to libelf_{acquire,

[PATCH 4/9 v2] libdw: make dwarf_getalt thread-safe

2024-07-17 Thread Aaron Merey
From: Heather McIntyre * libdw/dwarf_getalt.c (dwarf_getalt): Add locking. Signed-off-by: Heather S. McIntyre Signed-off-by: Aaron Merey Signed-off-by: Mark Wielaard v2 changes: Write lock now applies to all of dwarf_getalt. --- libdw/dwarf_getalt.c | 18 -- 1 file

[PATCH 6/9 v2] libdw: Make libdw_find_split_unit thread-safe

2024-07-17 Thread Aaron Merey
From: Heather McIntyre * (__libdw_find_split_unit): Add lock for cu->split. Signed-off-by: Heather S. McIntyre Signed-off-by: Aaron Merey Signed-off-by: Mark Wielaard --- v2 changes: Locking applied to __libdw_find_split_unit instead of try_split_file. libdw/libdw_find_split_unit.

[PATCH 5/9 v2] libdwP.h: Add locking to __libdw_dieabbrev,

2024-07-17 Thread Aaron Merey
From: Heather McIntyre Signed-off-by: Heather S. McIntyre Signed-off-by: Aaron Merey Signed-off-by: Mark Wielaard --- v2 changes: This replaces patch "libdw: Add locking around __libdw_dieabbrev for dwarf_hasattr". Mark suggested that we remove lazy abbrev reading in order to simplify the l

[PATCH 8/9 v2] tests: Add eu-search tests

2024-07-17 Thread Aaron Merey
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

[PATCH 3/9 v2] lib: Add eu_tsearch, eu_tfind, eu_tdelete and eu_tdestroy

2024-07-17 Thread Aaron Merey
From: Heather McIntyre Add new struct search_tree to hold tree root and lock. Add new eu_t* functions for ensuring synchronized tree access. Replace tsearch, tfind, etc with eu_t* equivalents. Move the rwlock_* macros out of eu-config.h and into a new header file locks.h. This was done so tha

[PATCH 7/9 v2] libdw: Make libdw_findcu thread-safe

2024-07-17 Thread Aaron Merey
From: Heather McIntyre * libdw/libdw_findcu.c (__libdw_findcu): Use eu_tfind and dwarf_lock (__libdw_intern_next_unit): Use per-Dwarf_CU locks. Signed-off-by: Heather S. McIntyre Signed-off-by: Aaron Merey Signed-off-by: Mark Wielaard --- v2 changes: Use per-Dwarf_CU

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

2024-07-17 Thread Aaron Merey
From: Heather McIntyre * configure.ac (--enable-thread-safety): Remove experimental warning. Signed-off-by: Heather S. McIntyre Signed-off-by: Aaron Merey Signed-off-by: Mark Wielaard --- No changes in v2. However PR31967 (datarace in elf_compress[_gnu]) was recently filed a