Re: [PATCH 2/5] readelf: Adapt src/readelf -h/-S/-r/-w/-l/-d/-a on mips

2023-08-01 Thread Mark Wielaard
Hi Ying, On Mon, 2023-07-24 at 16:35 +0800, Ying Huang wrote: > Hi Mark, > > > > diff --git a/libebl/eblreloctypecheck.c b/libebl/eblreloctypecheck.c > > > index 80e67ef7..e3c43944 100644 > > > --- a/libebl/eblreloctypecheck.c > > > +++ b/libebl/

Re: [PATCH 2/5] readelf: Adapt src/readelf -h/-S/-r/-w/-l/-d/-a on mips

2023-08-01 Thread Mark Wielaard
impler than creating a full new HOOK for reloc_type_check. Cheers, Mark

Re: [PATCH 2/5] readelf: Adapt src/readelf -h/-S/-r/-w/-l/-d/-a on mips

2023-08-01 Thread Mark Wielaard
s elf specification we are following? Cheers, Mark

Re: [PATCH] libelf: Free and clear rawdata_base and zdata_base consistently

2023-08-02 Thread Mark Wielaard
Hi, On Sun, Jul 30, 2023 at 05:44:20PM +0200, Mark Wielaard wrote: > There could be a leak if a program called elf_strptr on a compressed > section, but the program never requests the (uncompressed) section data, > but does explicitly (re)compress that same section data. > &

[PATCH] libelf, readelf, elflint: Add RELR support

2023-08-23 Thread Mark Wielaard
accept a Dwfl_Module. (handle_relocs_relr): New function. (print_dwarf_addr): Make static and declare early. (process_elf_file): Pass dwflmod to print_relocs. (handle_dynamic): Handle DT_RELRSZ and DTRELRENT. Signed-off-by: Mark Wielaard --- libebl

Re: [PATCH] libelf, readelf, elflint: Add RELR support

2023-08-24 Thread Mark Wielaard
Hi Omar, On Thu, Aug 24, 2023 at 12:40:19PM -0700, Omar Sandoval wrote: > On Thu, Aug 24, 2023 at 12:02:11AM +0200, Mark Wielaard wrote: > > > > * libelf/gelf.h (Gelf_Relr): New typedef for Elf64_Relr. > > > > +/* Relative relocation entry (in section of type

Re: [PATCH] libelf, readelf, elflint: Add RELR support

2023-08-24 Thread Mark Wielaard
entioned.) > > Maybe this can be wrapped in an #ifdef DT_RELR or something like that? Another good point. Yes, we should do that, we did the same when SHF_COMPRESSED and ELFCOMPRESS_ZSTD were introduced. I'll also update rawhide asap with your suggested fixes. Thanks, Mark

[PATCHv2] libelf, readelf, elflint: Add RELR support

2023-08-24 Thread Mark Wielaard
): Likewise. https://sourceware.org/bugzilla/show_bug.cgi?id=28495 Signed-off-by: Mark Wielaard --- v2 - Fix GElf_Relr typedef name - Add RELR typedefs/defines if missing from system elf.h - Add a system-elf-gelf-test libebl/eblsectiontypename.c | 3 +- libelf/elf32_updatenull.c| 3

Re: [PATCH] Fix thread-safety for elfutils

2023-08-25 Thread Mark Wielaard
with all work. But I certainly haven't forgotten. I will try to look at it soon since it would be exciting to finally be able to enable thread safety. Cheers, Mark

[COMMITTED] libelf: Remove elf_scncnt from libelf.map

2023-08-28 Thread Mark Wielaard
Reported-by: Kostadin Shishmanov Signed-off-by: Mark Wielaard --- libelf/libelf.map | 1 - 1 file changed, 1 deletion(-) diff --git a/libelf/libelf.map b/libelf/libelf.map index 10dc5059..25760bc4 100644 --- a/libelf/libelf.map +++ b/libelf/libelf.map @@ -50,7 +50,6 @@ ELFUTILS_1.0 { elf_rand

Re: [PATCHv2] libelf, readelf, elflint: Add RELR support

2023-08-29 Thread Mark Wielaard
Hi, On Fri, 2023-08-25 at 01:33 +0200, Mark Wielaard wrote: > Handle RELR as defined here: > https://groups.google.com/g/generic-abi/c/bX460iggiKg/m/YT2RrjpMAwAJ > > Introduce new ELF_T_RELR Elf_Type and handle it for SHT_RELR. Check > various properties in elflint. Print RELR

Re: [PATCH v2 2/2] debuginfod-client.c: Fix x-debuginfod-size counts differently than CURLINFO_SIZE_DOWNLOAD_T

2023-08-29 Thread Mark Wielaard
mpressed indicates where the total > size is from and those CURLINFO_SIZE* is skipped. Maybe I should rename > the variable to something else (it's not always compressed). > > Or do you mean that you want to always use written_size even when the > progress may go beyond 100%? What is the status of this patch/discussion? Thanks, Mark

Re: [PATCH 2/2] backends: Update list of LoongArch relocations

2023-08-29 Thread Mark Wielaard
On Tue, 2023-08-29 at 21:14 +0800, Xi Ruoyao via Elfutils-devel wrote: > * backends/loongarch_reloc.def: Add DELETE, ALIGN, PCREL20_S2, > CFA, ADD6, SUB6, ADD_ULEB128, SUB_ULEB128, 64_PCREL. Thanks, looks correct. Pushed, Mark

Re: [PATCH 1/2] libelf: Sync elf.h from Glibc

2023-08-29 Thread Mark Wielaard
On Tue, 2023-08-29 at 21:14 +0800, Xi Ruoyao via Elfutils-devel wrote: > Adds new LoongArch relocations. > > * elf.h: Update from glibc. Thanks, matches current glibc elf/elf.h. Pushed, Mark

Re: ☠ Buildbot (Sourceware): elfutils - failed test (failure) (master)

2023-08-29 Thread Mark Wielaard
only the "child" thread can be unwound, but not the main thread. I don't know why however, since it doesn't happen always. It could be that the kernel generates a bad core file or that the main thread is in a weird state (without unwind cfi) after the clone. Cheers, Mark

Re: PR30809, was Re: [PATCH v2 2/2] debuginfod-client.c: Fix x-debuginfod-size counts differently than CURLINFO_SIZE_DOWNLOAD_T

2023-08-29 Thread Mark Wielaard
uncompressed service. Hand testing with > (unmodified) fedora-38 gdb and debuginfod-find shows dramatically > improved progress displays: all have quantitative figures when > fetching from real (unmodified) upstream servers. > > Signed-off-by: Frank Ch. Eigler Very nice and simple. Looks good. Thanks, Mark

Re: Issue 62071 in oss-fuzz: elfutils:fuzz-libdwfl: Null-dereference READ in chunk_compare

2023-09-07 Thread Mark Wielaard
happen. Thanks, Mark On Tue, 2023-09-05 at 22:01 -0700, ClusterFuzz-External via monorail via Elfutils-devel wrote: > Status: New > Owner: > CC: elfut...@sourceware.org, da...@adalogics.com, evv...@gmail.com, > izz...@google.com > Labels: ClusterFuzz Stability-Memory-A

Re: Issue 62071 in oss-fuzz: elfutils:fuzz-libdwfl: Null-dereference READ in chunk_compare

2023-09-07 Thread Mark Wielaard
in _start > ``` > The fuzz target can be found at > https://github.com/google/oss-fuzz/blob/master/projects/elfutils/fuzz-libdwfl.c Thanks. But this doesn't really get me much further. Somehow a NULL key got into the search tree and I am still unclear how that can happen. If there is a reproducer/input file that would be really helpful. Cheers, Mark

Re: Issue 62071 in oss-fuzz: elfutils:fuzz-libdwfl: Null-dereference READ in chunk_compare

2023-09-07 Thread Mark Wielaard
ly I have still been unable to replicate the crash. But by reading the code carefully I think I have identified how this might happen. You must get a somewhat unfortunate out of memory or read error at precisely the wrong point. The attached patch should fix it. Cheers, Mark From 189a689a73db567f2c2c

Re: [PATCH] libelf: fix typos in comment

2023-09-10 Thread Mark Wielaard
Hi, On Sun, Sep 10, 2023 at 12:07:15AM +0800, COCOCO X via Elfutils-devel wrote: > bug -> but Thanks, pushed. Mark

Re: Issue 62071 in oss-fuzz: elfutils:fuzz-libdwfl: Null-dereference READ in chunk_compare

2023-09-11 Thread Mark Wielaard
Hi, On Thu, Sep 07, 2023 at 04:25:00PM +0200, Mark Wielaard wrote: > Subject: [PATCH] libelf: tdelete dummy key if anything goes wrong setting up > rawchunk > > elf_getdata_rawchunk uses a binary search tree cache. If a rawchunk is > not yet in the cache we setup a new entry.

Re: Building Elfutils with Mingw32

2023-09-15 Thread Mark Wielaard
ere is a mingw container setup on builder.sourceware.org which we might use for doing CI on the port? https://sourceware.org/cgit/builder/tree/builder/containers/Containerfile-fedora-mingw Thanks, Mark

Re: make check fails for version 0.189 on aarch64

2023-09-15 Thread Mark Wielaard
-prefix-map which I believe doesn't work correctly when also using LTO. And maybe your /usr/lib64/libc.so.6 might not have any symbols? Cheers, Mark

Re: [PATCH] PR30879: debuginfod intermittent terminate()

2023-10-01 Thread Mark Wielaard
ady catch (haha, pun intended) where/what caused that odd sparc uncaught exception? Cheers, Mark

Updating mailman settings to avoid From rewriting

2023-10-02 Thread Mark Wielaard
-patches mailinglists don't have an admin at the moment. Could someone volunteer to act as list admin for these? Cheers, Mark [*] https://sourceware.org/bugzilla/show_bug.cgi?id=29713

Re: [PATCH 01/14] libdw: Make try_split_file static

2023-10-03 Thread Mark Wielaard
Hi Omar, On Wed, 2023-09-27 at 11:20 -0700, Omar Sandoval wrote: > It's only used in libdw_find_split_unit.c. Obvious correct. Applied. Thanks, Mark

Re: [PATCH 02/14] libdw: Handle split DWARF in dwarf_entrypc

2023-10-03 Thread Mark Wielaard
, so this fails. > dwarf_lowpc already handles this fallback, so use it instead. Nice find. Also interesting varlocs already "tested" for that and we hadn't noticed before. Applied. Thanks, Mark

Re: [PATCH 03/14] libdw: Handle DW_AT_ranges in split DWARF 5 skeleton in dwarf_ranges

2023-10-03 Thread Mark Wielaard
.dwo otherwise. > > 1: https://lists.dwarfstd.org/pipermail/dwarf-discuss/2021-March/002009.html > 2: https://dwarfstd.org/issues/210310.1.html Thanks for all these references in the commit message. With that the 2 line change looks good. Applied. Thanks, Mark

Re: [PATCH 04/14] libdw: Handle other string forms in dwarf_macro_param2

2023-10-03 Thread Mark Wielaard
n extension for DWARF4 kept the old macinfo format, just moved it to the dwo. Thanks for catching this. Applied. Cheers, Mark

Re: [PATCH 05/14] libdw: Fix dwarf_macro_getsrcfiles for DWARF 5

2023-10-03 Thread Mark Wielaard
k here failed. Thanks for fixing. I had to think a bit on why we didn't need to set the address_size for the fake_cu. But that is only needed to read address class forms. Which aren't valid forms in macro data. Applied, Mark

Re: [PATCH 06/14] libdw: Handle split DWARF in dwarf_macro_getsrcfiles

2023-10-03 Thread Mark Wielaard
when it can't find DW_AT_stmt_list. Makes sense, it cannot really be any other offset than zero. Applied, Mark

Re: [PATCH 00/14] elfutils: DWARF package (.dwp) file support

2023-10-03 Thread Mark Wielaard
obviously caused by your patches. And both were spurious, later builds are green again. I'll go through the rest later. But there are more unreviewed patches, so it might take a bit. Thanks, Mark

[PATCH] libdw: Skip zero entries in aranges

2023-10-06 Thread Mark Wielaard
An address/length entry of two zeros is supposed to mark the end of a table. But in some cases a producer might leave zero entries in the table (for example when using gcc -ffunction-sections -gc-sections). Since we know the lenght of the table we can just skip such entries and continue to the

[COMMITTED] strip: Clean up a bit more after errors

2023-10-06 Thread Mark Wielaard
of return 1. Signed-off-by: Mark Wielaard --- src/strip.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/strip.c b/src/strip.c index 2a2cc801..7f4788b3 100644 --- a/src/strip.c +++ b/src/strip.c @@ -2543,8 +2543,7 @@ while computing checksum for debug information

Re: Updating mailman settings to avoid From rewriting

2023-10-06 Thread Mark Wielaard
Hi, On Tue, Oct 03, 2023 at 12:12:40AM +0200, Mark Wielaard wrote: > Currently the newlib, binutils, gdb-patches, elfutils-devel and > libabigail mailinglists rewrite the From header when a message is from > a (strict) dmarc domain. This is to avoid breaking the dmarc policy > and

Re: Updating mailman settings to avoid From rewriting

2023-10-08 Thread Mark Wielaard
Hi, On Sat, Oct 07, 2023 at 03:20:55PM +0300, Benson Muite wrote: > On 10/7/23 06:55, Thiago Jung Bauermann wrote: > > Mark Wielaard writes: > >>> Also the newlib and gdb-patches mailinglists don't have an admin at > >>> the moment. Could someone vo

Re: [PATCH] libdw: Skip zero entries in aranges

2023-10-09 Thread Mark Wielaard
Hi, On Fri, 2023-10-06 at 14:03 +0200, Mark Wielaard wrote: > An address/length entry of two zeros is supposed to mark the end of a > table. But in some cases a producer might leave zero entries in the > table (for example when using gcc -ffunction-sections -gc-sections). > > Si

Re: [PATCH] Fix thread-safety for elfutils

2023-10-10 Thread Mark Wielaard
g 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 ca

[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

[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

[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

[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

[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

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

2023-10-10 Thread Mark Wielaard
. * libelf/elf_getdata.c: Add elf_getdata_wrlock. * libelf/libelfP.h: Add internal function declarations. Signed-off-by: Heather S. McIntyre Signed-off-by: Mark Wielaard --- libelf/elf32_getchdr.c| 46 +++-- libelf/elf32_getchdr.h| 61

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

2023-10-10 Thread Mark Wielaard
: Heather S. McIntyre Signed-off-by: Mark Wielaard --- lib/Makefile.am | 2 +- lib/eu-search.c | 60 + lib/eu-search.h | 39 3 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 lib/eu-search.c

[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

[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 deleti

[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

[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

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

2023-10-10 Thread Mark Wielaard
: Mark Wielaard --- libdw/libdw_findcu.c | 54 1 file changed, 35 insertions(+), 19 deletions(-) diff --git a/libdw/libdw_findcu.c b/libdw/libdw_findcu.c index ed744231..e546fb0f 100644 --- a/libdw/libdw_findcu.c +++ b/libdw/libdw_findcu.c @@ -32,9 +32,13

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

2023-10-10 Thread Mark Wielaard
: Mark Wielaard --- src/Makefile.am | 3 +++ src/findtextrel.c | 10 +- src/nm.c | 10 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 10d59a48..fea5d43e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am

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

2023-10-10 Thread Mark Wielaard
. * libdw/fde.c: Likewise. * libdwfl/cu.c: Likewise. Signed-off-by: Heather S. McIntyre Signed-off-by: Mark Wielaard --- libdw/cie.c | 8 libdw/dwarf_getlocation.c | 16 libdw/dwarf_getmacros.c | 6 +++--- libdw/dwarf_getsrclines.c | 6 +++--- libdw

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

2023-10-10 Thread Mark Wielaard
-by: Heather S. McIntyre Signed-off-by: Mark Wielaard --- tests/Makefile.am| 16 ++- tests/eu_search_cfi.c| 234 +++ tests/eu_search_die.c| 262 +++ tests/eu_search_lines.c | 228

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 > --

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. > > Sig

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 Wiel

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-

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 > --- > libe

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 c

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_HEA

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/tfin

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_t

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 &

Re: PATCH PR30962, debuginfod

2023-10-11 Thread Mark Wielaard
?) path of the archive a source file was found in? Cheers, Mark

Re: PATCH PR30962, debuginfod

2023-10-11 Thread Mark Wielaard
t I think you should add an explanation or example to "Front-end proxies can also elide sensitive path name components" paragraph. So the user is fully aware what those "sensitive path names" are. Maybe even add that debuginfod-find -v example so people can double check. Thanks, Mark

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

2023-10-11 Thread Mark Wielaard
Hi Heather, On Tue, 2023-10-10 at 15:42 +0200, Mark Wielaard wrote: > 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 Wie

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

2023-10-11 Thread Mark Wielaard
Hi Heather, On Tue, Oct 10, 2023 at 03:42:56PM +0200, Mark Wielaard wrote: > 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 > --- > libd

Re: PATCH PR30962, debuginfod

2023-10-12 Thread Mark Wielaard
;sensitive path names" are. Maybe > > even add that debuginfod-find -v example so people can double check. > > OK, rewrote the related text in the man page: Looks really good and informative. Thanks, Mark

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

2023-10-12 Thread Mark Wielaard
Hi Heather, On Tue, Oct 10, 2023 at 03:42:57PM +0200, Mark Wielaard wrote: > 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

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

2023-10-12 Thread Mark Wielaard
Hi Heather, On Tue, Oct 10, 2023 at 03:42:58PM +0200, Mark Wielaard wrote: > > * 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_getmac

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

2023-10-12 Thread Mark Wielaard
Hi Heather, On Tue, Oct 10, 2023 at 03:43:00PM +0200, Mark Wielaard wrote: > > * configure.ac (--enable-thread-safety): Remove experimental > warning. > This all looks good. We should push this once we have all libelf fixes in. BTW. Your original ChangeLog entry also

Re: [PATCH] libelf: Sync elf.h from glibc

2023-10-13 Thread Mark Wielaard
bc elf/elf.h. Cheers, Mark

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

2023-10-13 Thread Mark Wielaard
Hi Heather, On Tue, 2023-10-10 at 15:42 +0200, Mark Wielaard wrote: > 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. >

Re: [PATCH] Fix thread-safety for elfutils

2023-10-14 Thread Mark Wielaard
Hi Heather, On Tue, 2023-10-10 at 15:40 +0200, Mark Wielaard wrote: > 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

Re: ☠ Buildbot (Sourceware): elfutils - failed test (failure) (master)

2023-10-14 Thread Mark Wielaard
ge-elf-file.sh test?) Happily things look pretty green for everything else: https://builder.sourceware.org/buildbot/#/builders?tags=elfutils Cheers, Mark

Re: [PATCH] Fix thread-safety for elfutils

2023-10-17 Thread Mark Wielaard
(or anyone else) from that server, so you don't need to setup git+email yourself locally. https://man.sr.ht/git.sr.ht/#sending-patches-upstream Cheers, Mark

Re: Some ideas for process improvements/changes

2023-10-19 Thread Mark Wielaard
Hi hackers, Coming back to this, because we did start doing some of these, but didn't actually document all of these suggestions. On Thu, 2023-04-06 at 18:30 +0200, Mark Wielaard wrote: > In general it feels like the elfutils community is working well, there > are regular releases wit

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

2023-10-19 Thread Mark Wielaard
ve one question though. __libelf_version is checked in elf_begin. Should that check be guarded by a lock too? Thanks, Mark

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

2023-10-19 Thread Mark Wielaard
y Srđan Milaković also from Rice University). What do you think? Cheers, Mark

Re: [PATCH] PR28204, debuginfod IMA

2023-10-23 Thread Mark Wielaard
/ChangeLog > +++ b/config/ChangeLog > @@ -1,3 +1,10 @@ > +2023-08-14 Ryan Goldberg > + > + * profile.csh.in: Set DEBUGINFOD_IMA_CERT_PATH directly. > + * profile.sh.in: Set DEBUGINFOD_IMA_CERT_PATH directly. > + * elfutils.spec.in: Add BuildRequires rpm-devel, > +

Re: [PATCH] PR28204, debuginfod IMA

2023-10-24 Thread Mark Wielaard
> + > keyid:FB:31:82:5D:D0:E0:73:68:5B:26:4E:30:38:96:36:73:F7:53:95:9A > + > +Signature Algorithm: sha256WithRSAEncryption > + 1a:1e:c1:2d:65:ad:f0:24:ec:9e:a7:fd:d4:ea:e1:54:dc:31: > + 1c:62:8c:29:0b:7a:56:6e:f7:b4:87:92:3e:ff:d5:40:4b:24: > +

Re: [PATCH] PR28204, debuginfod IMA

2023-10-24 Thread Mark Wielaard
r/include/imaevm.h:#define DATA_SIZE4096 OK, reading 4K blocks is fine. But bleah, that is a very generic name to use in an include header. Boo imaevm.h. > > > +/* Iterate over the directories in DEBUGINFOD_IMA_CERT_PATH looking > > > + * for the first verification certificate which matches keyid > > > + */ > > > +uint32_t keyid = ntohl(((struct signature_v2_hdr *)(bin_sig + > > > 1))->keyid); // The signature's keyid > > > > Eep. Could this have a comment and/or pointer to docs? +1? > > cast to struct? ntohl? > > Yeah. ntohl endianness conversion is not unusual in binary transport > protocols. So same as above, this seems like it might trigger undefined behavior. > > > + init_public_keys(tmp_file); > > > > What does init_public_keys do? Is it thread-safe? > > Good catch. It initialized a global inside libimaevm.c. It does not > appear thread-safe. Will wrap this in a pthread-once or somesuch. libimaevm.c seems not thread-safe in general. You might have to put a big lock around the whole signature extraction/checking block which uses those library functions. Another possible issue might be the initialization of openssl in the static constructure. How does that interact with how libcurl inits openssl? Cheers, Mark

Re: Some ideas for process improvements/changes

2023-10-25 Thread Mark Wielaard
Hi, On Thu, 2023-10-19 at 18:13 +0200, Mark Wielaard wrote: > > - Get rid of ChangeLog files and trivial ChangeLog entries > > I personally love ChangeLog entries. Writing them helps me > > double check I actually intended to make the changes. And > > it is a grea

Preparing for a 0.190 release end of next week

2023-10-26 Thread Mark Wielaard
m for a release Friday 3 November. Don't worry if a patch doesn't make it for this release, we'll try to do another early next year (normally there are just 3 or 4 months between releases, this one took 6, which is an exception). Cheers, Mark

Re: [PATCH] PR28204, debuginfod IMA

2023-10-31 Thread Mark Wielaard
bimaevm.c. It does not > > > appear thread-safe. Will wrap this in a pthread-once or somesuch. > > > libimaevm.c seems not thread-safe in general. You might have to put > > a big lock around the whole signature extraction/checking block > > which uses those library functions. > > OK, will take a look at that. What other global-state conflicting > things did you notice? A quick look at the code shows that various functions can read/write a static public_keys variable linked list, including (indirectly) ima_verify_signature. So that can cause data-races. One other issue I noticed is that it seems to be distributed under GPLv2-only. Which seems to mean that anything based on it should also be distributed under GPLv2-only, which would include libdebuginfod. Is there code we can rely on that is GPLv2+ and LGPLv3+ compatible? > > Another possible issue might be the initialization of openssl in the > > static constructure. How does that interact with how libcurl inits > > openssl? > > openssl's initialization is fine & thread-safe in practice, despite > the documentation's warnings. OK. But even if it is thread-safe, you also need to make sure it inits the same. This for example worries me a little: https://github.com/curl/curl/pull/12153 Cheers, Mark

Re: Building Elfutils with Mingw32

2023-11-01 Thread Mark Wielaard
ws. It would be great if we could get some volunteer for packaging elfutils for cygwin. Cheers, Mark

Re: Building Elfutils with Mingw32

2023-11-01 Thread Mark Wielaard
5310&state=* I have reviewed and pushed various of those patches where they made sense (to me). But as you can see there are various patches that were just rejected and others where I really don't understand the real issue/solution. If someone could help reviewing those that would be really appreciated. Thanks, Mark

Re: [PATCH 07/14] libdw: Recognize .debug_[ct]u_index sections in dwarf_elf_begin

2023-11-01 Thread Mark Wielaard
: Add IDX_debug_cu_index and > + IDX_debug_tu_index. > + (scn_to_string_section_idx): Ditto. > + (scn_dwarf_type): Check for .debug_cu_index, .debug_tu_index, > + .zdebug_cu_index, and .zdebug_tu_index. > + (check_section): Change .dwo suffix matching to account fo

Re: [PATCH] PR28204, debuginfod IMA

2023-11-01 Thread Mark Wielaard
searching) that we could fork out to. (OTOH, GPLv2 is > compatible with GPLv2+.) But GPLv2-only is not compatible with GPLv3 which is used by e.g. gdb. This is a bit of a pickle :{ > > > openssl's initialization is fine & thread-safe in practice, despite > > > the documentation's warnings. > > > > OK. But even if it is thread-safe, you also need to make sure it inits > > the same. [...] > > Interesting issue. One openssl initialization call is deep inside > libcurl, another one in libimaevm's solib ctor. Neither is > parametrized such that we could influence them. However, things are > working(tm). Thanks for checking. Cheers, Mark

Re: ☠ Buildbot (Sourceware): elfutils - failed test (failure) (master)

2023-11-01 Thread Mark Wielaard
I did the same for the elfutils-try-gentoo-sparc builder (changing the tag from elfutils-try to elfutils-try-build). So for try builds you won't get emails about the sparc builder anymore, but the results will show up on the builder website and in bunsen. Sam, could you please let us know wh

Re: [PATCH 08/14] libdw: Parse DWARF package file index sections

2023-11-01 Thread Mark Wielaard
Add dwarf_cu_dwp_section_info.c. > + * dwarf_end.c (dwarf_end): Free dwarf->cu_index and dwarf->tu_index. > + * dwarf_error.c (errmsgs): Add DWARF_E_UNKNOWN_SECTION. > + * libdw.h (dwarf_cu_dwp_section_info): New declaration. > + * libdw.map (ELFUTILS_0.190): Add d

Re: [PATCH] readelf: Support .gdb_index version 9

2023-11-02 Thread Mark Wielaard
Hi Aaron, On Tue, 2023-10-31 at 16:33 -0400, Aaron Merey wrote: > I'd like to merge this patch before the next release. Unless anyone objects > I'll merge it by Friday Nov 3. Looks good to me. Some small comments below. > Commit message: BTW if you add comments like the above after the first "

Re: [PATCH 09/14] libdw, libdwfl: Save original path of ELF file

2023-11-02 Thread Mark Wielaard
* The dir where we found the main Elf. > */ > + char *elfpath; /* The path where we found the main Elf. */ > >Dwarf *dw; /* libdw handle for its debugging info. */ >Dwarf *alt;/* Dwarf used for dwarf_setalt, or > NULL. */ > diff --git a/libdwfl/offline.c b/libdwfl/offline.c > index e090b42b..50abe8c3 100644 > --- a/libdwfl/offline.c > +++ b/libdwfl/offline.c > @@ -151,9 +151,9 @@ process_elf (Dwfl *dwfl, const char *name, const char > *file_name, int fd, >/* Don't keep the file descriptor around. */ >if (mod->main.fd != -1 && elf_cntl (mod->main.elf, ELF_C_FDREAD) == 0) > { > - /* Grab the dir path in case we want to report this file as > + /* Grab the path in case we want to report this file as >Dwarf later. */ > - mod->elfdir = __libdw_debugdir (mod->main.fd); > + mod->elfpath = __libdw_elfpath (mod->main.fd); > close (mod->main.fd); > mod->main.fd = -1; > } OK. Pushed, Mark

Re: [PATCH 10/14] libdw: Try .dwp file in __libdw_find_split_unit()

2023-11-02 Thread Mark Wielaard
l_function > __libdw_find_split_unit (Dwarf_CU *cu) > @@ -98,14 +159,18 @@ __libdw_find_split_unit (Dwarf_CU *cu) > same id as the skeleton. */ >if (cu->unit_type == DW_UT_skeleton) > { > + /* First, try the dwp file. */ > + try_dwp_file (cu); > + >Dwarf_Die cudie = CUDIE (cu); >Dwarf_Attribute dwo_name; > - /* It is fine if dwo_dir doesn't exists, but then dwo_name needs > - to be an absolute path. */ > - if (dwarf_attr (&cudie, DW_AT_dwo_name, &dwo_name) != NULL > - || dwarf_attr (&cudie, DW_AT_GNU_dwo_name, &dwo_name) != NULL) > + /* Try a dwo file. It is fine if dwo_dir doesn't exist, but then > + dwo_name needs to be an absolute path. */ > + if (cu->split == (Dwarf_CU *) -1 > + && (dwarf_attr (&cudie, DW_AT_dwo_name, &dwo_name) != NULL > + || dwarf_attr (&cudie, DW_AT_GNU_dwo_name, &dwo_name) != NULL)) > { > - /* First try the dwo file name in the same directory > + /* Try the dwo file name in the same directory >as we found the skeleton file. */ > const char *dwo_file = dwarf_formstring (&dwo_name); > const char *debugdir = cu->dbg->debugdir; OK. Because try_dwp_file will call __libdw_link_skel_split to set cu->split. This again will have to be analyzed carefully when we add the thread-safety work. Thanks, Mark

Re: [PATCH 11/14] tests: Handle DW_MACRO_{define, undef}_{strx, sup} in dwarf-getmacros

2023-11-02 Thread Mark Wielaard
Hi Omar, On Wed, Sep 27, 2023 at 11:21:00AM -0700, Omar Sandoval wrote: > + * dwarf-getmacros.c (mac): Add DW_MACRO_define_sup, > + DW_MACRO_define_strx, DW_MACRO_undef_sup, and DW_MACRO_undef_strx > + cases to opcode switch statement. Looks sane. Applied and pushed. Thanks, Mark

Re: [PATCH 12/14] tests: Optionally dump all units in dwarf-getmacros

2023-11-02 Thread Mark Wielaard
Hi Omar, On Wed, Sep 27, 2023 at 11:21:01AM -0700, Omar Sandoval wrote: > If instead of a CU offset an empty string is given as the second > argument, dump all units. Pushed, Mark

Re: [PATCH 13/14] libdw: Apply DWARF package file section offsets where appropriate

2023-11-02 Thread Mark Wielaard
c (dwarf_scnnames): Add IDX_debug_cu_index and > IDX_debug_tu_index. > (scn_to_string_section_idx): Ditto. > @@ -60,6 +66,8 @@ > __libdw_dwp_find_unit, and use it to adjust abbrev_offset and assign > newp->dwp_row. > * dwarf_cu_dwp_section_info

Re: [PATCH 00/14] elfutils: DWARF package (.dwp) file support

2023-11-02 Thread Mark Wielaard
good, but depends on 8, some questions, specificly about handling split type units. 13 looks good, but depends on 8 and 10. > Patches 11 and 12 enable testing macro information in dwp files. Both applied. > Patch 14 adds support and tests for an LLVM extension to the dwp > format. I have to think a bit more on this. Cheers, Mark

Re: [PATCH] libelf/elf_newscn.c: fix build failure against gcc-14 (-Walloc-size)

2023-11-02 Thread Mark Wielaard
newp = calloc (sizeof (Elf_ScnList) > |^ > > The change swaps arguments to pass larger value as a member size. Very nice. Patch applied. Thanks, Mark

<    1   2   3   4   5   6   7   8   9   10   >