[PATCH] libdwfl: Make sure dyn_filesz has a sane size

2021-12-19 Thread Mark Wielaard
In dwfl_segment_report_module dyn_filesz should be able to hold at least one Elf_Dyn element, and not be larger than possible. Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog| 6 ++ libdwfl/dwfl_segment_report_module.c | 3 +++ 2 files changed, 9 insertions(+) diff

[PATCH] libdwfl: Rewrite GElf_Nhdr reading in dwfl_segment_report_module

2021-12-19 Thread Mark Wielaard
Make sure that the notes filesz is not too big. Rewrite reading of the notes to check for overflow at every step. Also limit the size of the buildid bytes. Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog| 5 ++ libdwfl/dwfl_segment_report_module.c | 79

[PATCH] libdwfl: Handle unaligned Ehdr in dwfl_segment_report_module

2021-12-19 Thread Mark Wielaard
The xlate functions only handle correctly aligned buffers. But they do handle src == dest. So if the source buffer isn't aligned correctly just copy it first into the destination (which is already correctly aligned). Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog

[PATCH] libdwfl: Handle unaligned Phdr in dwfl_segment_report_module

2021-12-19 Thread Mark Wielaard
The xlate functions only handle correctly aligned buffers. But they do handle src == dest. So if the source buffer isn't aligned correctly just copy it first into the destination (which is already correctly aligned). Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog

[PATCH] libdwfl: Handle unaligned Phdr in dwfl_segment_report_module

2021-12-19 Thread Mark Wielaard
The xlate functions only handle correctly aligned buffers. But they do handle src == dest. So if the source buffer isn't aligned correctly just copy it first into the destination (which is already correctly aligned). Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog

[PATCH] dwfl: Always clean up build_id.memory

2021-12-20 Thread Mark Wielaard
/show_bug.cgi?id=28685 Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog| 6 ++ libdwfl/dwfl_segment_report_module.c | 26 -- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 6015f6b7

Re: Issue 42877 in oss-fuzz: elfutils:fuzz-dwfl-core: Crash in dwfl_segment_report_module

2021-12-23 Thread Mark Wielaard
> > Detailed Report: https://oss-fuzz.com/testcase?key=4756614962348032 Thanks for the report, but this is not enough information to reproduce and fix the issue. Please make the detailed reports public so we can act on this report. Cheers, Mark

[PATCH] libdwfl: Make sure dwfl_elf_phdr_memory_callback returns at least minread

2021-12-23 Thread Mark Wielaard
The callers of dwfl_elf_phdr_memory_callback assume at least minread bytes are read and available. Make sure to check start is smaller than elf->maximum_size before reading more. Return false if end - start is smaller than minread. Found by afl-fuzz. Signed-off-by: Mark Wielaard --- libd

[PATCH] libdwfl: Call xlatetom on aligned buffers in dwfl_link_map_report

2021-12-23 Thread Mark Wielaard
Make sure that when calling xlatetom for Phdrs and Dyns in dwfl_link_map_report the input buffer is correctly aligned by calling memcpy and setting in.d_buf to out.d_buf. https://sourceware.org/bugzilla/show_bug.cgi?id=28720 Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog | 5

[PATCH] libdwfl: Calculate addr to read by hand in link_map.c read_addrs.

2021-12-23 Thread Mark Wielaard
The gcc undefined sanitizer doesn't like the trick we use to calculate the (possibly) unaligned addresses to read. So calculate them by hand as unsigned char pointers. https://sourceware.org/bugzilla/show_bug.cgi?id=28720 Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog | 4 li

Re: OSS-Fuzz issue 42877

2021-12-23 Thread Mark Wielaard
I think this issue has the same root cause as an issue found by afl-fuzz for which I posted a patch here: https://sourceware.org/pipermail/elfutils-devel/2021q4/004597.html Cheers, Mark

Re: Cont.: Adding a new section to an ELF file aborts with Assertion `shdr != NULL'

2021-12-24 Thread Mark Wielaard
at least read the existing section headers before adding new sections. Could you try first reading some section header before adding a new one? e.g. just add something like: scn = elf_nextscn(e, NULL); shdr = elf64_getshdr(scn); Hope that helps to workaround the bug for now. Cheers, Mark

Re: [PATCH] libdwfl: Make sure dwfl_elf_phdr_memory_callback returns at least minread

2022-01-03 Thread Mark Wielaard
On Thu, Dec 23, 2021 at 11:19:31PM +0100, Mark Wielaard wrote: > The callers of dwfl_elf_phdr_memory_callback assume at least minread > bytes are read and available. Make sure to check start is smaller than > elf->maximum_size before reading more. Return false if end - start is &g

Re: [PATCH] libdwfl: Call xlatetom on aligned buffers in dwfl_link_map_report

2022-01-03 Thread Mark Wielaard
On Fri, Dec 24, 2021 at 01:49:54AM +0100, Mark Wielaard wrote: > Make sure that when calling xlatetom for Phdrs and Dyns in > dwfl_link_map_report the input buffer is correctly aligned by calling > memcpy and setting in.d_buf to out.d_buf. > > https://sourceware.org/bugzilla/show_b

Re: [PATCH] libdwfl: Calculate addr to read by hand in link_map.c read_addrs.

2022-01-03 Thread Mark Wielaard
On Fri, Dec 24, 2021 at 02:06:08AM +0100, Mark Wielaard wrote: > The gcc undefined sanitizer doesn't like the trick we use to calculate > the (possibly) unaligned addresses to read. So calculate them by hand > as unsigned char pointers. > > https://sourceware.org/bugzilla/s

[PATCH] libdwfl: Fix overflow check in link_map.c read_addrs

2022-01-06 Thread Mark Wielaard
The buffer_available overflow check wasn't complete. Also check nb isn't too big. https://sourceware.org/bugzilla/show_bug.cgi?id=28720 Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog | 4 libdwfl/link_map.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) di

[PATCH] libdwfl: Handle unaligned Dyns in dwfl_segment_report_module

2022-01-06 Thread Mark Wielaard
The xlate functions only handle correctly aligned buffers. But they do handle src == dest. So if the source buffer isn't aligned correctly just copy it first into the destination (which is already correctly aligned). https://sourceware.org/bugzilla/show_bug.cgi?id=28720 Signed-off-by:

[PATCH] libdwfl: Declare possible zero sized arrays only when non-zero

2022-01-06 Thread Mark Wielaard
The gcc undefined sanitizer complains when seeing a zero sized array declaration. Move the declaration to the point in the code where we know they aren't zero sized. https://sourceware.org/bugzilla/show_bug.cgi?id=28720 Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog | 5 + li

Re: Buildbot failure in Wildebeest Builder on whole buildset

2022-02-07 Thread Mark Wielaard
ed when using -fsanitize=undefined and/or running under valgrind (both are enabled by distcheck, but aren't used during the previous make check). If someone can replicate this that would be useful. Cheers, Mark

Re: Buildbot failure in Wildebeest Builder on whole buildset

2022-02-07 Thread Mark Wielaard
Hi all, On Mon, Feb 07, 2022 at 09:46:26PM +0100, Mark Wielaard wrote: > This is an odd one. It happens during make distcheck, after make check passed. > > FAIL: run-readelf-compressed-zstd.sh > > /srv/buildbot/worker/elfutils-fedora-x86_64

Re: Buildbot failure in Wildebeest Builder on whole buildset

2022-02-08 Thread Mark Wielaard
Hi, On Mon, Feb 07, 2022 at 11:29:34PM +0100, Mark Wielaard wrote: > On Mon, Feb 07, 2022 at 09:46:26PM +0100, Mark Wielaard wrote: > > This is an odd one. It happens during make distcheck, after make check > > passed. > > > > FAIL: run

[PATCH] backends: Use PTRACE_GETREGSET for ppc_set_initial_registers_tid

2022-02-16 Thread Mark Wielaard
ed (it was hard enough finding ppc32 setups to test this on). Tested against ppc and ppc64 on linux 2.6.32 and glibc 2.12 and ppc and ppc64 on linux 3.10.0 with glibc 2.17. Signed-off-by: Mark Wielaard --- backends/ChangeLog | 5 backends/ppc_init

Re: [PATCH] backends: Use PTRACE_GETREGSET for ppc_set_initial_registers_tid

2022-02-21 Thread Mark Wielaard
Hi, On Wed, 2022-02-16 at 15:07 +0100, Mark Wielaard wrote: > The code in ppc_initreg.c used PTRACE_PEEKUSER to fetch all registers > one by one. Which is slightly inefficient. It did this because it > wanted > things to work on linux 2.6.18 which didn't support

Re: Signing keys for releases?

2022-02-25 Thread Mark Wielaard
git: https://sourceware.org/git/?p=elfutils.git;a=blob_plain;f=GPG-KEY;hb=HEAD Cheers, Mark

[PATCH] configure: Test for _FORTIFY_SOURCE=3 support.

2022-03-10 Thread Mark Wielaard
the newer dynamic fortification checks. This patch also makes sure that AC_PROG_CXX is used earlier so that CXXFLAGS is always setup correctly (even if we then don't use it). And it outputs both the CFLAGS and CXXFLAGS as used at the end. Signed-off-by: Mark Wielaard ---

[PATCH] addr2line: Make --absolute the default, add --relative option.

2022-03-11 Thread Mark Wielaard
Make --absolute (including the compilation directory in file names) the default and add a new option --relative to get the previous default behavior. https://www.sourceware.org/bugzilla/show_bug.cgi?id=28951 Signed-off-by: Mark Wielaard --- ChangeLog | 4 NEWS| 3

Re: [PATCH] configure: Test for _FORTIFY_SOURCE=3 support.

2022-03-14 Thread Mark Wielaard
Hi, On Thu, 2022-03-10 at 18:06 +0100, Mark Wielaard wrote: > _FORTIFY_SOURCE=3 adds extra glibc (dynamic) fortification checks > when using GCC 12. > > This adds a configure check to see if -D_FORTIFY_SOURCE=3 can be > used. > If not, configure will fall back to -D_FORTIFY

Re: [PATCH] addr2line: Make --absolute the default, add --relative option.

2022-03-14 Thread Mark Wielaard
On Fri, 2022-03-11 at 15:49 +0100, Mark Wielaard wrote: > Make --absolute (including the compilation directory in file names) > the default and add a new option --relative to get the previous > default behavior. > > https://www.sourceware.org/bugzilla/show_bug.cgi?id=28951 Pushed, Mark

[COMMITTED] configure: Use AS_HELP_STRING instead of AC_HELP_STRING.

2022-03-14 Thread Mark Wielaard
In most places we already used AS_HELP_STRING. A few places used AC_HELP_STRING. Which has been deprecated for a long time. Use AS_HELP_STRING instead of AC_HELP_STRING everywhere. Signed-off-by: Mark Wielaard --- ChangeLog| 4 configure.ac | 4 ++-- m4/ChangeLog | 5 + m4

Re: Issue 45619 in oss-fuzz: elfutils:fuzz-elf-get-sections: Misaligned-address in elf_cvt_Verdef

2022-03-16 Thread Mark Wielaard
t; https://oss-fuzz.com/revisions?job=libfuzzer_ubsan_elfutils&range=202203160607:202203161200 > > Reproducer Testcase: > https://oss-fuzz.com/download?testcase_id=5857986591981568 This testcase seems to have no section headers, so it is unclear how to get to the above crash state. Cheers, Mark

Re: Issue 45620 in oss-fuzz: elfutils:fuzz-elf-get-sections: Timeout in fuzz-elf-get-sections

2022-03-16 Thread Mark Wielaard
testcase_id=5416220013232128 This again looks like the previous reported case. The reproducer is clearly an invalid file without section headers. Does anybody know what this "fuzz-elf-get-sections" thing is. It would be good to know the source code if this to understand how to reproduce this report. Thanks, Mark

Re: Issue 43449 in oss-fuzz: elfutils:fuzz-dwfl-core: Timeout in fuzz-dwfl-core

2022-03-16 Thread Mark Wielaard
use it on 32bit targets if possible. However it isn't clear to me what this "fuzz-dwfl-core" is, where the source is and how to replicate this. Cheers, Mark

Re: Issue 43505 in oss-fuzz: elfutils:fuzz-dwfl-core: Use-of-uninitialized-value in handle_file_note

2022-03-16 Thread Mark Wielaard
aren't initialized explicitly". But the backtrace given in the report doesn't seem to match the current elfutils code. So maybe this is against some old elfutils version? Cheers, Mark

Some fuzzer workarounds

2022-03-17 Thread Mark Wielaard
figuring with --enable-analyze-undefined ALLOW_UNALIGNED is not defined, otherwise it is for some arches, including x86_64). I don't mind getting rid of ALLOW_UNALIGNED, but it is some work. Cheers, Mark

[PATCH 1/2] libelf: Take map offset into account for Shdr alignment check in elf_begin

2022-03-17 Thread Mark Wielaard
The sh_num function tries to get at the zero section Shdr directly. When the file is mmapped it has to make sure the offset into the file to the start of the Elf structure is taken into account when trying to cast the address to make sure the alignment is correct. Signed-off-by: Mark Wielaard

[PATCH 2/2] libelf: Make sure ar_size starts with a digit before calling atol.

2022-03-17 Thread Mark Wielaard
The ar_size field is a 10 character string, not zero terminated, of decimal digits right padded with spaces. Make sure it actually starts with a digit before calling atol on it. We already make sure it is zero terminated. Otherwise atol might produce unexpected results. Signed-off-by: Mark

[PATCH] libelf: Check alignment of Verdef, Verdaux, Verneed and Vernaux offsets

2022-03-18 Thread Mark Wielaard
The Verdef, Verdaux, Verneed and Vernaux structures contain fields which point to the next structures. Make sure these offsets are correctly aligned for the structures they point to. Signed-off-by: Mark Wielaard --- libelf/ChangeLog | 6 ++ libelf/version_xlate.h | 17

Re: [PATCH 2/2] libelf: Make sure ar_size starts with a digit before calling atol.

2022-03-18 Thread Mark Wielaard
t-string check is not really correct. Also since the ar_size is defined as a character array that only contains digits and (right padded) spaces (but no zero terminator), we would have to copy the chars always if we would add a zero terminator. Which is very unlikely (except when the size is larger than 9 bytes, 953 MB. Cheers, Mark

[PATCH] libdwfl: Close ar members when they cannot be processed.

2022-03-18 Thread Mark Wielaard
When reporting ar members they should be closed when they cannot be processed. A comment in offline.c said that process_file called elf_end if it returned NULL. But this is incorrect. And other places that call process_file do call elf_end explicitly when it returns NULL. Signed-off-by: Mark

[PATCH] libdwfl: Use memcpy to assign image header field values

2022-03-18 Thread Mark Wielaard
The values in the kernel image header aren't properly aligned. Use memcpy and the LE16, LE32 macros to assign and check the values. Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog | 5 + libdwfl/image-header.c | 24 ++-- 2 files changed, 23 insertions(

[PATCH] libelf: Don't overflow offsets in elf_cvt_Verneed and elf_cvt_Verdef

2022-03-20 Thread Mark Wielaard
The conversion functions for Verdef and Verneed keep offsets to the next structure. Make sure that following vd_aux, vda_next, vd_next, vn_aux, vna_next and vn_next don't overflow (and wrap around) the offsets. Signed-off-by: Mark Wielaard --- libelf/ChangeLog | 7 ++ l

[PATCH] tests: Check addsections test binary is 64bit for run-large-elf-file.sh

2022-03-20 Thread Mark Wielaard
The test binary should be 64bit to be able to create 4GB, or larger, ELF files. https://sourceware.org/bugzilla/show_bug.cgi?id=28975 Signed-off-by: Mark Wielaard --- tests/ChangeLog | 4 tests/run-large-elf-file.sh | 11 +++ 2 files changed, 15 insertions(+) diff

[PATCH] configure: Don't check whether -m64 works for 32bit host biarch check

2022-03-20 Thread Mark Wielaard
Running a 32bit backtrace test against a 64bit binary doesn't work. Only a 64bit binary can backtrace a 32bit binary. So disable the biarch check that inserts -m64 for a 32bit host. https://sourceware.org/bugzilla/show_bug.cgi?id=24158 Signed-off-by: Mark Wielaard --- ChangeLog

Re: Some fuzzer workarounds

2022-03-21 Thread Mark Wielaard
0). Yes, you are right, all the unaligned type access issues were "real" (they occur with or without ALLOW_UNALIGNED on). It is not really a big issue, but could potentially cause the compiler to do some surprising optimisations. So I did fix them all. Cheers, Mark

Re: Some fuzzer workarounds

2022-03-21 Thread Mark Wielaard
Hi, On Thu, Mar 17, 2022 at 02:30:49PM +0100, Mark Wielaard wrote: > The following fixes should fix reading of some broken ar archives and > misaligned access of the section zero Shdr for mmaped ELF files where > the start of the Elf image is at some offset from the start of

Re: Some fuzzer workarounds

2022-03-21 Thread Mark Wielaard
d there. On Fedora 35 the tests pass. Ah, oops. Yeah that is: https://systemd.io/COREDUMP_PACKAGE_METADATA/ https://fedoraproject.org/wiki/Changes/Package_information_on_ELF_objects There are actually patches to properly recognize those. https://sourceware.org/pipermail/elfutils-devel/2021q4/thread.html#4375 I'll integrate those asap. Cheers, Mark

[PATCH] libelf: Correct alignment of ELF_T_GNUHASH data for ELFCLASS64

2022-03-22 Thread Mark Wielaard
64bit word. Signed-off-by: Mark Wielaard --- libelf/ChangeLog | 5 + libelf/elf_getdata.c | 16 ++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/libelf/ChangeLog b/libelf/ChangeLog index ea204e2b..5ea1e41e 100644 --- a/libelf/ChangeLog +++ b/libelf

Re: Some fuzzer workarounds

2022-03-22 Thread Mark Wielaard
004782.html https://code.wildebeest.org/git/user/mjw/elfutils/commit/?h=fuzz Cheers, Mark

Re: Some fuzzer workarounds

2022-03-23 Thread Mark Wielaard
lyzers, > the unit tests > on various architectures and so on confirmed that the issue is gone. Thanks! Thanks for testing. Pushed. Cheers, Mark

Re: [PATCH] tests: Check addsections test binary is 64bit for run-large-elf-file.sh

2022-03-24 Thread Mark Wielaard
On Mon, Mar 21, 2022 at 12:17:14AM +0100, Mark Wielaard wrote: > The test binary should be 64bit to be able to create 4GB, or larger, > ELF files. Pushed. Mark

Re: [PATCH] configure: Don't check whether -m64 works for 32bit host biarch check

2022-03-24 Thread Mark Wielaard
On Mon, Mar 21, 2022 at 12:47:51AM +0100, Mark Wielaard wrote: > Running a 32bit backtrace test against a 64bit binary doesn't work. > Only a 64bit binary can backtrace a 32bit binary. So disable the > biarch check that inserts -m64 for a 32bit host. Pushed. Mark

Re: [PATCH v2] libebl: recognize FDO Packaging Metadata ELF note

2022-03-24 Thread Mark Wielaard
ze FDO Packaging Metadata ELF note [PATCH 3/3] elflint: Recognize NT_FDO_PACKAGING_METADATA I saw Fedora 36 now has these new package notes. Sadly they omit the debugInfoUrl field. Which makes them less useful imho. Do you happen to know why that wasn't included? Cheers, Mark

[PATCH 1/3] libelf: Sync elf.h from glibc.

2022-03-24 Thread Mark Wielaard
. dwelf_elf_e_machine_string was updated to handle EM_INTELGT. Signed-off-by: Mark Wielaard --- libdwelf/ChangeLog| 5 ++ libdwelf/dwelf_elf_e_machine_string.c | 2 + libelf/ChangeLog | 4 + libelf/elf.h | 107

[PATCH 2/3] libebl: recognize FDO Packaging Metadata ELF note

2022-03-24 Thread Mark Wielaard
From: Luca Boccassi As defined on: https://systemd.io/COREDUMP_PACKAGE_METADATA/ this note will be used starting from Fedora 36. Allow readelf --notes to pretty print it: Note section [ 3] '.note.package' of 76 bytes at offset 0x2e8: Owner Data size Type FDO 57 F

[PATCH 3/3] elflint: Recognize NT_FDO_PACKAGING_METADATA

2022-03-24 Thread Mark Wielaard
Signed-off-by: Mark Wielaard --- src/ChangeLog | 4 src/elflint.c | 7 +++ 2 files changed, 11 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 0e705b7d..1e3c31a8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2022-03-24 Mark Wielaard

Re: [PATCH v2] libebl: recognize FDO Packaging Metadata ELF note

2022-03-25 Thread Mark Wielaard
Hi Luca, On Fri, 2022-03-25 at 11:17 +, Luca Boccassi wrote: > On Fri, 2022-03-25 at 00:14 +0100, Mark Wielaard wrote: > > I took the elf.h update separately. Tweaked your patch a little and > > added a patch of my own to make elflint recognize the new note > > type.

Re: [PATCH v2] libebl: recognize FDO Packaging Metadata ELF note

2022-03-25 Thread Mark Wielaard
Hi Luca, On Fri, 2022-03-25 at 13:52 +, Luca Boccassi wrote: > On Fri, 2022-03-25 at 14:39 +0100, Mark Wielaard wrote: > > But I noticed an issue on s390x fedora 36. > > This isn't just elfutils though, binutils also has trouble: > > > > Displaying notes fou

Re: [PATCH v2] libebl: recognize FDO Packaging Metadata ELF note

2022-03-26 Thread Mark Wielaard
Hi Luca, On Fri, Mar 25, 2022 at 02:55:14PM +, Luca Boccassi wrote: > On Fri, 2022-03-25 at 15:47 +0100, Mark Wielaard wrote: > > > We have completely overlooked that, the note is created by a linker > > > script, which is generated at build time by this: > >

[PATCH] Introduce error_exit as a noreturn variant of error (EXIT_FAILURE, ...)

2022-03-27 Thread Mark Wielaard
https://bugzilla.redhat.com/show_bug.cgi?id=2068692 Signed-off-by: Mark Wielaard --- lib/ChangeLog | 4 ++ lib/system.h | 10 +++ src/ChangeLog | 14 src/addr2line.c | 3 +- src/ar.c | 41 ++- src/arlib.c | 8 +-- src/elfcompress.c | 5 +- src

Re: [PATCH v2] libebl: recognize FDO Packaging Metadata ELF note

2022-03-28 Thread Mark Wielaard
g to add native support to linkers for package notes, just like they support build-ids by default. That also makes it easier for the linker to simply merge the notes. Trying to do this with inserting a linker script really feels very fragile. Cheers, Mark

Re: [PATCH] Avoid dlopen on debuginfod-client when not configured

2022-03-29 Thread Mark Wielaard
nt. Thoughts? Cheers, Mark > Signed-off-by: Dirk Müller > --- > libdwfl/ChangeLog | 5 + > libdwfl/debuginfod-client.c | 12 +++- > 2 files changed, 16 insertions(+), 1 deletion(-) > > diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog > index 9c5c8

[PATCH] libelf: Also copy/convert partial datastructures in xlate functions

2022-03-29 Thread Mark Wielaard
e.org/bugzilla/show_bug.cgi?id=29000 Signed-off-by: Mark Wielaard --- libelf/ChangeLog| 5 + libelf/gelf_xlate.c | 10 -- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/libelf/ChangeLog b/libelf/ChangeLog index 7fd6202b..299179cb 100644 --- a/libelf/ChangeLog +++ b/l

Re: [PATCH] Introduce error_exit as a noreturn variant of error (EXIT_FAILURE, ...)

2022-03-30 Thread Mark Wielaard
Hi, On Sun, 2022-03-27 at 23:32 +0200, Mark Wielaard wrote: > error (EXIT_FAILURE, ...) should be noreturn but on some systems it > isn't. This may cause warnings about code that should not be > reachable. So have an explicit error_exit wrapper that is noreturn > (beca

Re: Issue 46192 in oss-fuzz: elfutils:fuzz-libdwfl: Out-of-memory in fuzz-libdwfl

2022-03-31 Thread Mark Wielaard
I don't know of a good interface to dispose of raw data chunks. But we could mitigate this a bit by rejecting zero sized rawchunks and searching the rawchunks to see if we already have created a chunk for the requested offset, size and type. We currently don't keep track of the original offset, so that would need to be tracked then. Cheers, Mark

Using libcurl in another library, when/if to call curl_global_init?

2022-03-31 Thread Mark Wielaard
that use libcurl are doing this. Or whether there is a thread-safe way to call curl_global_init at a later time (to get rid of the library constructor init function). Thanks, Mark

Re: [PATCH] Avoid dlopen on debuginfod-client when not configured

2022-03-31 Thread Mark Wielaard
Hi Dirk, On Tue, 2022-03-29 at 13:06 +0200, Dirk Müller wrote: > Am Di., 29. März 2022 um 09:42 Uhr schrieb Mark Wielaard < > m...@klomp.org>: > > The patch itself looks right. But I am slightly afraid this > > (theoretically?) will break some programs which set DEBUGINFOD

Re: Using libcurl in another library, when/if to call curl_global_init?

2022-03-31 Thread Mark Wielaard
Hi, On Thu, Mar 31, 2022 at 04:00:16PM +0300, Catalin Raceanu via curl-library wrote: > On 31-Mar-22 15:04, Mark Wielaard wrote: > > whether there is a thread-safe way to call > > curl_global_init at a later time (to get rid of the library constructor > > init function). >

Re: [PATCH] [PATCH] debuginfod: Use the debuginfod-size response header

2022-03-31 Thread Mark Wielaard
s "X-DEBUGINFOD- SIZE" which is also what is checked for in the run-debuginfod-response- headers.sh test. So shouldn't the above also be all uppercase or should you use strcasestr? When using sscanf why are you using a double and %lf? Isn't it simpler to use a long and %ld? Is there a way to test this easily? When would Content-Length not be available? Cheers, Mark

[PATCH] libelf: Return already gotten Elf_Data from elf_getdata_rawchunk

2022-04-01 Thread Mark Wielaard
it is requested multiple times. Note that the current cache is a simple linked list but the chain is normally not that long. It is normally used to get chunks from the phdrs, and there are normally less than 10. Signed-off-by: Mark Wielaard --- libelf/ChangeLog | 7 +++ 1 file changed, 7 inser

[PATCHv2] libelf: Return already gotten Elf_Data from elf_getdata_rawchunk

2022-04-01 Thread Mark Wielaard
it is requested multiple times. Note that the current cache is a simple linked list but the chain is normally not that long. It is normally used to get chunks from the phdrs, and there are normally less than 10. Signed-off-by: Mark Wielaard --- libelf/ChangeLog | 7 +++ l

Re: [PATCH] PR28708 debuginfod testsuite

2022-04-03 Thread Mark Wielaard
because that can only support up to 1024 connections simultaniously. Cheers, Mark

Re: patch: debuginfod ipv4-ipv6 dual-stack

2022-04-04 Thread Mark Wielaard
NULL, NULL, /* default accept policy */ Nice cleanup. > @@ -3911,7 +3919,7 @@ main (int argc, char *argv[]) > (connection_pool ? (int)connection_pool > : MHD_OPTION_END), > MHD_OPTION_END); > > - if (d4 == NULL && d6 == NULL) // neither ipv4 nor ipv6? boo > + if (d46 == NULL) > { >sqlite3 *database = db; >sqlite3 *databaseq = dbq; > @@ -3922,8 +3930,8 @@ main (int argc, char *argv[]) > } > >obatched(clog) << "started http server on " > - << (d4 != NULL ? "IPv4 " : "") > - << (d6 != NULL ? "IPv6 " : "") > + << "IPv4 " > + << "IPv6 " > << "port=" << http_port << endl; This keeps the log output the same, but I wouldn't mind just removing the IPv4 and IPv6 strings. Cheers, Mark

Re: [PATCHv2] libelf: Return already gotten Elf_Data from elf_getdata_rawchunk

2022-04-05 Thread Mark Wielaard
Hi, On Fri, 2022-04-01 at 16:15 +0200, Mark Wielaard wrote: > elf_getdata_rawchunk keeps a list of Elf_Data_Chunk to track which > Elf_Data structures have already been requested. This allows elf_end > to clean up all internal data structures and the Elf_Data d_buf if > it was malloc

Re: Using libcurl in another library, when/if to call curl_global_init?

2022-04-05 Thread Mark Wielaard
On Tue, 2022-04-05 at 17:36 +0200, Daniel Stenberg wrote: > On Thu, 31 Mar 2022, Mark Wielaard via curl-library wrote: > > > But we are struggling a bit with how to safely/correctly initialize > > libcurl. > > Are you struggling to meet the requirement as per the do

[PATCH] config: Add a versioned requires on libs for elfutils-debuginfod-client

2022-04-07 Thread Mark Wielaard
elfutils-debuginfod-client contains the debuginfod-client binary which is uses libelf and libdw. Add an explicit versioned requires on elfutils-libs so they will always be in sync like done with all other inter sub package dependencies. Signed-off-by: Mark Wielaard --- config/ChangeLog

Re: caching failed lookups of debuginfo?

2022-04-08 Thread Mark Wielaard
cache is filled. Could you run with DEBUGINFOD_VERBOSE=1 to see what is being fetched and why? Thanks, Mark

Re: caching failed lookups of debuginfo?

2022-04-08 Thread Mark Wielaard
_mtime seems to be in the past. So time(NULL) - st.st_mtime <= cache_miss is always false. I am not sure why yet. Cheers, Mark

Re: caching failed lookups of debuginfo?

2022-04-08 Thread Mark Wielaard
ache to test stuff. But that means we recreate the cache_miss file every time, so that gets a new mtime. And if you are just testing for 10 minutes everything looks fine... Cheers, Mark

Re: [PATCH] config: Add a versioned requires on libs for elfutils-debuginfod-client

2022-04-12 Thread Mark Wielaard
On Thu, 2022-04-07 at 15:29 +0200, Mark Wielaard wrote: > elfutils-debuginfod-client contains the debuginfod-client binary > which is uses libelf and libdw. Add an explicit versioned requires > on elfutils-libs so they will always be in sync like done with all > other inter

Re: [PATCH] PR29022: 000-permissions files cause problems for backups

2022-04-13 Thread Mark Wielaard
ATH/01234567/debuginfo` != > "--" ]; then > - echo "The cache $DEBUGINFOD_CACHE_PATH/01234567/debuginfo is readable" > +if [ `stat -c "%s" $DEBUGINFOD_CACHE_PATH/01234567/debuginfo` != 0 ]; then > + echo "The cache $DEBUGINFOD_CACHE_PATH/01234567/debuginfo is not empty" >err > fi Changes look good, please commit with the changes suggested above and add Tested-by: Milian Wolff Thanks, Mark

[COMMITTED] libdw: Add DWARF5 package file section identifiers, DW_SECT_*

2022-04-13 Thread Mark Wielaard
This only adds the constants. There is no handling of DWARF package file (dwp) files for now. https://sourceware.org/bugzilla/show_bug.cgi?id=29048 Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 5 + libdw/dwarf.h | 13 + 2 files changed, 18 insertions(+) diff --git a

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

2022-04-13 Thread Mark Wielaard
/932 > > Build state: failed test (failure) > Revision: 399b55a75830f1854c8da9f29282810e82f270b6 > Worker: centos-x86_64 > Build Reason: (unknown) > Blamelist: Mark Wielaard > > Steps: > [...] > - 8: make check ( failure ) > Logs: > - stdio: &g

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

2022-04-14 Thread Mark Wielaard
the database file that the process has open and > has random parts in cache.) I'm thinking this is not worth testing. Does the attached look OK? Thanks, Mark From 46e4d78de4a51b6e7ea2a2dba150ac9599c29c2f Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Thu, 14 Apr 2022 13:26:57 +0200 Su

Proposing elfutils-0.187 for Monday 25 April

2022-04-15 Thread Mark Wielaard
/ I'll try to go over them all before the release. If there are any other issues left, please let me know. Lets try to do the next release in 3 months, so there isn't such a big gap between releases. Cheers, Mark

Re: PATCH: testsuite debuginfod

2022-04-15 Thread Mark Wielaard
Hi Frank, On Sun, 2021-12-05 at 18:30 +0100, Mark Wielaard wrote: > On Tue, Oct 05, 2021 at 06:55:34PM +0200, Mark Wielaard wrote: > > On Thu, 2021-09-30 at 10:50 -0400, Frank Ch. Eigler via Elfutils-devel > > wrote: > > > commit 85602ff68179053f19a2005df4fc653a

Re: [PATCH v2] config: simplify profile.*sh.in

2022-04-15 Thread Mark Wielaard
the positional parameters, starting with $0. I have added a ChangeLog entry: 2022-01-19 Ahelenia Ziemiańska * profile.csh.in: Set DEBUGINFOD_URLS directly. Use "$0" and : in sh -c. * profile.sh.in: Set DEBUGINFOD_URLS directly. Don't use sh -c. Use $() instead of ``. Full commit at: https://code.wildebeest.org/git/user/mjw/elfutils/commit/?h=simplify-profile Frank, do you have any more concerns with this patch? Ahelenia, under which shells have you tested this? Thanks, Mark

Re: parallel downloads of multiple debuginfo files

2022-04-15 Thread Mark Wielaard
ng parallel downloads is often not that efficient. It is better to reuse the same debuginfo_client handle to download things serially, that way you can reuse the existing connection instead of having to set it up for each download separately. Cheers, Mark

[COMMITTED] libdw: Remove unused atomics.h include from libdwP.h

2022-04-16 Thread Mark Wielaard
Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 4 libdw/libdwP.h | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libdw/ChangeLog b/libdw/ChangeLog index 38f3a7e2..631f2f2a 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,7 @@ +2022-04-16 Mark Wielaard

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

2022-04-19 Thread Mark Wielaard
Technically it means at that point dyn_mem could have been purged from the stack. Although unlikely moving the dyn_mem definition outside the loop should fix it. I'll push the attached fix. Cheers, Mark >From 21fa92319657ca479ae108967fd41ac523a2f876 Mon Sep 17 00:00:00 2001 From: Mark Wielaard

[PATCH] debuginfod, libdwfl: Initialize libcurl and dlopen debuginfod-client lazily

2022-04-22 Thread Mark Wielaard
hread-safe we can use pthread_once to make sure we don't race against ourselves. This still means we might race against any application code that might use libcurl. But we can assume they will have called curl_global_init before calling dwfl_begin or debuginfod_begin. Signed-off-by: Mar

Re: Using libcurl in another library, when/if to call curl_global_init?

2022-04-22 Thread Mark Wielaard
Hi, On Thu, Mar 31, 2022 at 03:19:51PM +0200, Mark Wielaard via curl-library wrote: > On Thu, Mar 31, 2022 at 04:00:16PM +0300, Catalin Raceanu via curl-library > wrote: > > On 31-Mar-22 15:04, Mark Wielaard wrote: > > > whether there is a thread-safe way to call > &

Re: [PATCH v2] config: simplify profile.*sh.in

2022-04-22 Thread Mark Wielaard
Hi наб, On Fri, Apr 15, 2022 at 02:12:31PM +0200, наб via Elfutils-devel wrote: > On Fri, Apr 15, 2022 at 01:48:23PM +0200, Mark Wielaard wrote: > > I have added a ChangeLog entry: > > > > 2022-01-19 Ahelenia Ziemiańska > > > >* profile.csh.in: Set

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

2022-04-22 Thread Mark Wielaard
erver reached connection limit. Closing inbound connection.\n"} 9 I guess 100 parallel lookups really is too much. I am going to lower it to 64. Cheers, Mark>From 318807e7f968fd70b80408e3df029c04365c47d8 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sat, 23 Apr 2022 03:20:17 +0200

run-debuginfod-webapi-concurrency.sh (Was: ☠ Buildbot (GNU Toolchain): elfutils - failed test (failure)) (master)

2022-04-23 Thread Mark Wielaard
Hi, On Sat, Apr 23, 2022 at 03:31:04AM +0200, Mark Wielaard wrote: > On Sat, Apr 23, 2022 at 01:19:53AM +, builder--- via Elfutils-devel wrote: > > A new failure has been detected on builder elfutils-debian-ppc64 while > > building elfutils. > > > > Fu

Re: run-debuginfod-webapi-concurrency.sh

2022-04-24 Thread Mark Wielaard
for older libmicrohttpd, like rhel7 methinks.) > > On debian-ppc64, with and without the MHD_USE_ITC patch, I ran the test > 20 times in a shell loop. With MHD_USE_ITC, I got 20 passes, without > it, 9 passes and 11 failures. > > With the patch applied, a full &qu

Re: [PATCH] debuginfod: Use the debuginfod-size response header

2022-04-24 Thread Mark Wielaard
Hi Aaron, On Fri, Apr 22, 2022 at 06:56:41PM -0400, Aaron Merey via Elfutils-devel wrote: > I've updated the patch below with the changes Mark recommended. > > A couple X-DEBUGINFOD-SIZE tests were added in another patch I recently > posted [1] that also fixes a bug when comput

[COMMITTED] libelf: Check for mremap, elf_update needs it for ELF_C_RDWR_MMAP

2022-04-24 Thread Mark Wielaard
zilla/show_bug.cgi?id=27337 Signed-off-by: Mark Wielaard --- ChangeLog | 4 configure.ac| 5 - libelf/ChangeLog| 4 libelf/elf_update.c | 2 ++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3357f69b..f0cd28a8 100644

Re: RFC patch: generated AUTHORS

2022-04-25 Thread Mark Wielaard
large list of contributors over > time. Nice! So when preparing a release we just run ./AUTHORS.sh > AUTHORS to get it up to date. Thanks for adding this. Cheers, Mark

Re: [PATCH] debuginfod, libdwfl: Initialize libcurl and dlopen debuginfod-client lazily

2022-04-25 Thread Mark Wielaard
On Fri, Apr 22, 2022 at 11:53:43PM +0200, Mark Wielaard wrote: > We used to go out of our way to initialize libcurl early before any other > thread/code was running. But this meant that we might pay startup cost, > which under FIPS is significant, even for code that never uses libdebugi

[COMMITTED] Prepare for 0.187

2022-04-25 Thread Mark Wielaard
Set version to 0.187 Update NEWS and elfutils.spec.in Set copyright year in configure.ac and printversion. Regenerate po/*.po files. Signed-off-by: Mark Wielaard --- ChangeLog |5 + NEWS| 13 +- config/ChangeLog|4 + config/elfutils.spec.in

<    19   20   21   22   23   24   25   26   27   28   >