[PATCH 06/10 v2] Add tests/thread-safety-subr.sh

2025-02-04 Thread Aaron Merey
thread-safety-subr.sh contains subroutine check_thread_safety_enabled which skips further testing when USE_LOCKS is false. * tests/Makefile.am (EXTRA_DIST): Add thread-safety-subr.sh. * tests/thread-safety-subr.sh: New file. Signed-off-by: Aaron Merey --- v2 changes: Removed chec

[PATCH 05/10 v2] Add configure option --enable-helgrind

2025-02-04 Thread Aaron Merey
Like --enable-valgrind but uses helgrind instead of memcheck. If both --enable-valgrind and --enable-helgrind are given then helgrind takes priority. --enable-helgrind requires --enable-valgrind-annotations. * configure.ac: Add --enable-helgrind option. * tests/Makefile.am: If US

Re: [PATCH 4/5] tests/test-elf_cntl_gelf_getshdr.c: Close fd unconditionally

2025-02-04 Thread Aaron Merey
Hi Mark, On Mon, Feb 3, 2025 at 8:36 AM Mark Wielaard wrote: > > I think this subtly changes what is being tested here. If I remember > correctly this tests that gelf_getshdr works correctly even when the > underlying fd is closed and the file is either mmapped or elf_cntl > with ELF_C_FDREAD is

Re: [PATCH 09/10 v5] Add tests/run-eu-search-lines.sh

2025-02-04 Thread Aaron Merey
Hi Mark, On Mon, Feb 3, 2025 at 7:40 AM Mark Wielaard wrote: > > Found the issue with the patches not showing up on the list. > They were sent to elfutils-patches@ which doesn't exists... > Add elfutils-devel to the CC now. Apologies, I mixed up elfutils-devel@ and gdb-patches@. I've reposted th

[PATCH 09/10 v5] Add tests/run-eu-search-lines.sh

2025-02-04 Thread Aaron Merey
* tests/.gitignore: Add eu_search-lines. * tests/Makefile.am: Add eu_search_lines, run-eu-search-lines.sh. * tests/eu_search_lines.c: New file. tests/run-eu-search-lines.sh: New file. Signed-off-by: Heather S. McIntyre Signed-off-by: Aaron Merey Signed-off

[PATCH 08/10 v5] Add tests/run-eu-search-macros.sh

2025-02-04 Thread Aaron Merey
* tests/.gitignore: Add eu_search_macros.sh * tests/Makefile.am: Add eu_search_macros, run-eu-search-macros.sh. * tests/eu_search_macros.c: New file. * tests/run-eu-search-macros.sh: New file. Signed-off-by: Heather S. McIntyre Signed-off-by: Aaron Merey S

[PATCH 07/10 v5] Add tests/run-eu-search-cfi.sh

2025-02-04 Thread Aaron Merey
From: Heather McIntyre * tests/.gitignore: Add eu_search_cfi. * tests/Makefile.am: Add eu_search_cfi, run-eu-search-cfi.sh. * tests/eu_search_cfi.c: New file. * tests/run-eu-search-cfi.sh: New file. Signed-off-by: Heather S. McIntyre Signed-off-by: Aaron Merey S

[PATCH 10/10 v5] Add tests/run-eu-search-die.sh

2025-02-04 Thread Aaron Merey
* tests/.gitignore: Add eu_search_die. * tests/Makefile.am: Add eu_search_die, run-eu-search-die.sh. * tests/eu_search_die.c: New file. * tests/run-eu-search-die.sh: New file. Signed-off-by: Heather S. McIntyre Signed-off-by: Aaron Merey Signed-off-by: Mark Wielaa

[PATCH 03/10 v2] libdw: Add locking to dwarf_getsrcfiles and dwarf_getsrclines

2025-02-04 Thread Aaron Merey
* libdw/dwarf_getsrcfiles.c (dwarf_getsrcfiles): Use dwarf_lock. * libdw/dwarf_getsrclines.c (dwarf_getsrclines): Use dwarf_lock. Signed-off-by: Aaron Merey --- v2 changes: Combined from v1 patches 04/15 and 05/15. libdw/dwarf_getsrcfiles.c | 11 +++ libdw/dwarf_getsrcli

[PATCH 04/10 v2] dwarf_offdie.c: Add locking

2025-02-04 Thread Aaron Merey
* libdw/dwarf_offdie.c (__libdw_offdie): Use dwarf_lock. Signed-off-by: Aaron Merey --- v2 changes: Lock only for the duration of __libdw_findcu. libdw/dwarf_offdie.c | 4 1 file changed, 4 insertions(+) diff --git a/libdw/dwarf_offdie.c b/libdw/dwarf_offdie.c index 883720de..a972

[PATCH 01/10 v2] Change type of dwarf_lock from rwlock to mutex

2025-02-04 Thread Aaron Merey
Change type of dwarf_lock to mutex in order to take advantage of built-in support for recursive locking. * lib/locks.h: Add macros for locking, unlocking, initializing and destroying mutexes. * libdw/dwarf_begin_elf.c (dwarf_end): Replace rwlock macro with mutex mac

[PATCH 02/10 v2] dwarf_filesrc.c: Add locking

2025-02-04 Thread Aaron Merey
* libdw/dwarf_getsrclines.c (read_srcfiles): Initialize Dwarf member. * libdw/dwarf_filesrc.c (dwarf_filesrc): Use dwarf_lock. * libdw/libdwP.h (struct Dwarf_Files_s): Add Dwarf member. Signed-off-by: Aaron Merey --- v2 changes: Combined v1 patches 03/15 and 06/15

[PATCH] libelf: fix DEREF_OF_NULL.RET in objdump.c

2025-02-04 Thread Anton Moryakov
Report of the static analyzer: Pointer, returned from function 'elf_getarhdr' at objdump.c:314, may be NULL and is dereferenced at objdump.c:317. (CWE-476, CWE-690) Corrections explained: When processing archive elements, the code could dereference a NULL pointer if 'elf_getarhdr' returns NULL. Th