Re: patchworks and sourcehut for elfutils

2021-10-06 Thread Mark Wielaard
Hi, On Wed, Oct 06, 2021 at 06:25:04PM +0200, Mark Wielaard wrote: > To make patch tracking slighly easier there is now a patchwork instance > on sourceware that should show the status of all outstanding patches > sent to the mailinglist: > https://patchwork.sourceware.org/project/e

[PATCH] libdw: Use signedness of subrange type to determine array bounds

2021-10-06 Thread Mark Wielaard
-size4 expects (this is an hardwritten testcase, we could have chosen a different default). https://sourceware.org/bugzilla/show_bug.cgi?id=28294 Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 6 + libdw/dwarf_aggregate_size.c | 44 +++- 2 files

Re: [patch] PR27783: default debuginfod-urls profile rework

2021-10-06 Thread Mark Wielaard
or similar files may first set $DEBUGINFOD_URLS. > +# If $DEBUGINFOD_URLS is not set there, we set it from system *.url files. > +# $HOME/.*rc or similar files may then amend $DEBUGINFOD_URLS. > +# See also [man debuginfod-client-config] for other environment variables > +# such as $DEBUGINFOD_MAXSIZE, $DEBUGINFOD_MAXTIME, $DEBUGINFOD_PROGRESS. > + > +if [ -z "$DEBUGINFOD_URLS" ]; then > +prefix="@prefix@" > +debuginfod_urls=`find "@sysconfdir@/debuginfod/" -name '*.urls' | xargs > cat | tr '\n' ' '` Likewise. > +if [ -n "$debuginfod_urls" ]; then > +DEBUGINFOD_URLS="$debuginfod_urls" > +export DEBUGINFOD_URLS > +fi > +unset debuginfod_urls > +unset prefix > fi Thanks, Mark

Re: [PATCH] Tests: Fix warning in show-die-info.c

2021-10-06 Thread Mark Wielaard
t;d_size != shdr->sh_size); > for (size_t idx = 0; > - idx < databits->d_size && ! bad; > + ! bad && idx < databits->d_size; > idx++) >

Re: [PATCH] Tests: Fix warning in show-die-info.c

2021-10-06 Thread Mark Wielaard
; dwarf_lowpc (die, &addr) == 0) This can be fixed in a shorter way using dwarf_attr_string ?: "". Which is what I pushed (see attached). Thanks, Mark >From 47b0ebe9033daa7ac9c732b25c85520b97f9635a Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Wed, 6 Oct 2021 23:53:34 +0200 S

Re: [patch] PR27783: default debuginfod-urls profile rework

2021-10-07 Thread Mark Wielaard
ays the default.url file in there (elfutils.url). Maybe we could even drop an empty.url file in there that is just, well, empty. That way the glob always globs? But if the above is to cumbersome, leave it at find and xargs. I assume they are normally always installed. And for those distros where they aren't, they might not want to install a default DEBUGINFOD_URLS set anyway. Cheers, Mark

[PATCH] debuginfod-client: Stick to http:// + https:// + file:// protocols

2021-10-15 Thread Mark Wielaard
Make sure we don't use any of the more experimental protocols libcurl might support. URLs can be redirected and we might want to follow http -> https, but not e.g. gopher or pop3. Suggested-by: Zbigniew Jędrzejewski-Szmek Signed-off-by: Mark Wielaard --- debuginfod/ChangeLog

Re: [PATCH] debuginfod-client: Stick to http:// + https:// + file:// protocols

2021-10-18 Thread Mark Wielaard
Hi, On Fri, 2021-10-15 at 15:25 +0200, Mark Wielaard wrote: > Make sure we don't use any of the more experimental protocols > libcurl might support. URLs can be redirected and we might want > to follow http -> https, but not e.g. gopher or pop3. On irc Frank said he didn't

[COMMITTED] libdw: Don't pass NULL to dwarf_peel_type

2021-10-18 Thread Mark Wielaard
izer would flag this as being undefined behaviour because the second argument of the function is marked as non-NULL. Fix this by checking we actually have a non-NULL type DIE. Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 5 + libdw/dwarf_aggregate_size.c | 2 +- 2 files change

Re: Buildbot failure in Wildebeest Builder on whole buildset

2021-10-18 Thread Mark Wielaard
gt; > Buildbot URL: https://builder.wildebeest.org/buildbot/ > > Worker for this Build: debian-amd64 > > Build Reason: > Blamelist: Mark Wielaard > > BUILD FAILED: failed test (failure) I already saw this earlier and it is resolved by: commit e3e70782a1d1a2468442159

Re: Adding elfutils to OSS-Fuzz

2021-10-28 Thread Mark Wielaard
bly mean the fuzzer will not reach libelf for more interesting input files. Take a peek at some of the simpler elf tests (under test) if you want to really fuzz libelf itself. Maybe using elfcpy and then elfcmp to make sure the copy is really identical would make a fun fuzzcase. Cheers, Mark

Doing a 0.186 release on Monday

2021-11-04 Thread Mark Wielaard
check should always be green. If there are some last minute fixes you believe really should go in before 0.186 is released, then please sent them to the list asap. But we'll try to do the next release in less than 5 months, so there is always next time. Cheers, Mark

Re: [PATCH v2] Improve building with LTO

2021-11-04 Thread Mark Wielaard
ou tried this against (with/without -flto?) I admit I am still a bit nervous about the switch away from @@@ to just @ and @@. I was secretly hoping gcc would add @@@ support to the symver attribute. But that doesn't seem to be happening, and even if it did, it would be gcc 12+ only. So maybe we can include it for this release and just tell people they may keep the pieces if they use -flto. But it does also impact symbol versioning for non-lto builds, so I am still a little hesitant. I'll try to do some tests to make sure things look ok with different gcc versions. Cheers, Mark

Re: PR28514: [PATCH] debuginfod groom time-limit

2021-11-05 Thread Mark Wielaard
n & action phases, with associated > progress-tracking metrics. > > Testing the timeout facility requires hand-testing beyond the > testsuite (since it requires LARGE databases to show measurable query > times). So confirmed this part by hand. Makes sense and looks good. Please push. Thanks, Mark

Re: Buildbot failure in Wildebeest Builder on whole buildset

2021-11-05 Thread Mark Wielaard
umber go "out of scope". Frank fixed it by adding the version number at the top of the NEWS file again. Cheers, Mark

Re: [PATCH] (v2) read inlining info in an NVIDIA extended line map

2021-11-05 Thread Mark Wielaard
U > binaries for CUDA 11.2+. It looks like the attachment is missing. Or the mailinglist removed it for some reason, but I also didn't see it here: https://sourceware.org/pipermail/elfutils-devel/2021q4/004307.html Could you resent it? Thanks, Mark > This is an updated version of a p

[PATCH] libdw: dwarf_elf_begin should use either plain, dwo or lto DWARF sections.

2021-11-08 Thread Mark Wielaard
. https://sourceware.org/bugzilla/show_bug.cgi?id=27367 Signed-off-by: Mark Wielaard --- libdw/ChangeLog | 9 +++ libdw/dwarf_begin_elf.c | 83 ++-- libdw/libdwP.h | 12 tests/ChangeLog | 8

Re: [PATCH v2] Improve building with LTO

2021-11-08 Thread Mark Wielaard
rsioning > should remain the same, shouldn't it? I meant I am paranoid :) We are using slightly different asm or an attribute to mark the symbol version than we did before. But I double checked the exported versioned symbols with and without this patch on different gcc versions and they look fine. So I did just now push this patch. Cheers, Mark

Re: Doing a 0.186 release on ... Wednesday

2021-11-08 Thread Mark Wielaard
Hi, On Thu, Nov 04, 2021 at 10:47:31AM +0100, Mark Wielaard wrote: > It has been 5 months since 0.185, there have been ~70 commits by ~15 > people, with ~15 bugzilla entries closed. There is always more to do, > but I believe current trunk is in pretty good shape. A lot of work was >

Re: [PATCH v2] Improve building with LTO

2021-11-09 Thread Mark Wielaard
(we should probably still fix them though). What do the test results look like? Do they all PASS with -ffat-lto- objects? Could you try the proposed patch for https://sourceware.org/bugzilla/show_bug.cgi?id=27367 https://sourceware.org/pipermail/elfutils-devel/2021q4/004314.html Thanks, Mark

Re: [PATCH v2] Improve building with LTO

2021-11-09 Thread Mark Wielaard
gt; https://sourceware.org/pipermail/elfutils-devel/2021q4/004314.html > > With the suggested patch (and BFD) all is green and shiny: Thanks for the testing, I pushed that patch now. Cheers, Mark

Re: [PATCH] (v2) read inlining info in an NVIDIA extended line map

2021-11-10 Thread Mark Wielaard
e is no special configuration switch needed. > (2) all changes are bracketed by comments that mark them NVIDIA > extensions > (3) the DWARF extended opcodes have been renamed with names that > include NVIDIA in them > (4) the two new API functions to surface the new information have &

Re: PATCH: PR28430: debuginfod --passive mode

2021-11-10 Thread Mark Wielaard
quot;); > +#endif > + all_threads.push_back(pt); > +} > } > } This looks OK when viewed with diff -u -w. > @@ -3936,14 +3984,17 @@ main (int argc, char *argv[]) >if (d4) MHD_stop_daemon (d4); >if (d6) MHD_stop_daemon (d6); > > - /* With all threads known dead, we can clean up the global resources. */ > - rc = sqlite3_exec (db, DEBUGINFOD_SQLITE_CLEANUP_DDL, NULL, NULL, NULL); > - if (rc != SQLITE_OK) > + if (! passive_p) > { > - error (0, 0, > - "warning: cannot run database cleanup ddl: %s", > sqlite3_errmsg(db)); > + /* With all threads known dead, we can clean up the global resources. > */ > + rc = sqlite3_exec (db, DEBUGINFOD_SQLITE_CLEANUP_DDL, NULL, NULL, > NULL); > + if (rc != SQLITE_OK) > +{ > + error (0, 0, > + "warning: cannot run database cleanup ddl: %s", > sqlite3_errmsg(db)); > +} > } > - > + Adding spurious whitespace... >// NB: no problem with unconditional free here - an earlier failed regcomp > would exit program >(void) regfree (& file_include_regex); >(void) regfree (& file_exclude_regex); > @@ -3952,7 +4003,8 @@ main (int argc, char *argv[]) >sqlite3 *databaseq = dbq; >db = dbq = 0; // for signal_handler not to freak >(void) sqlite3_close (databaseq); > - (void) sqlite3_close (database); > + if (! passive_p) > +(void) sqlite3_close (database); > >return 0; > } OK. > diff --git a/doc/ChangeLog b/doc/ChangeLog > index db3a35844ce9..7a73fa107bf3 100644 > --- a/doc/ChangeLog > +++ b/doc/ChangeLog > @@ -1,3 +1,8 @@ > +2021-11-05 Frank Ch. Eigler > + > + PR28430 > + * debuginfod.8 (--passive): Document new flag & operation mode. Thanks for adding documentation. Looks good. > diff --git a/tests/ChangeLog b/tests/ChangeLog > index b791cd7f0d95..394241c7e179 100644 > --- a/tests/ChangeLog > +++ b/tests/ChangeLog > @@ -1,3 +1,9 @@ > +2021-11-05 Frank Ch. Eigler > + > + PR28430 > + * run-debuginfod-extraction-passive.sh: New test. > + * Makefile.am (TESTS, EXTRA_DIST): Add it. Looks correct. > +++ b/tests/run-debuginfod-extraction-passive.sh > > +# for test case debugging, uncomment: > +set -x > +unset VALGRIND_CMD You aren't using testrun so this isn't really relevant. But you might use VALGRIND_CMD itself in some the tests to make them run under valgrind when configure to do so. Most tests should be fine, as long as they don't mind that valgrind itself might query the debuginfod server. Cheers, Mark

Re: dwarf_aggregate_size doesn't work with arrays in partial CUs

2021-11-10 Thread Mark Wielaard
very expensive (and cached, so it only needs to be done once). > Sound like a reasonable approach? Sorry for forgetting about this discussion. I do think the above makes sense. I opened a bug to track this: https://sourceware.org/bugzilla/show_bug.cgi?id=28578 Cheers, Mark

Re: unwind non-PC registers using elfutils

2021-11-10 Thread Mark Wielaard
;t have a public API for it. We really should. I filed: https://sourceware.org/bugzilla/show_bug.cgi?id=28579 Could you add some requirements there? The hard part is making sure the interface is actually useful. What information do you have and what information do you want to get out? Thanks, Mark

[COMMITTED] Prepare for 0.186

2021-11-10 Thread Mark Wielaard
Set version to 0.186 Update NEWS and elfutils.spec.in Regenerate po/*.po files Signed-off-by: Mark Wielaard --- ChangeLog | 5 + NEWS| 4 +- config/ChangeLog| 6 +- config/elfutils.spec.in | 23 + configure.ac| 2 +- po/ChangeLog

elfutils 0.186 released

2021-11-10 Thread Mark Wielaard
readelf: Read inlining info in NVIDIA extended line map Mark Wielaard (31): run-debuginfod-find.sh: Disable valgrind for debuginfod client cache tests debuginfod-client: Fix client dereference when calloc fails. strip: Always check gelf_update results. unstrip: Always check gelf_getrel[a]

Re: [PATCH] debuginfod: fix compilation on platforms without

2021-11-11 Thread Mark Wielaard
for "system.h" header, since it's a local > header, not a system one. Thanks, applied. Cheers, Mark

[PATCH] tests: Don't set DEBUGINFOD_TIMEOUT

2021-11-11 Thread Mark Wielaard
Various tests set DEBUGINFOD_TIMEOUT to 10. Which is less than the default of 90. None of the tests relied on a lower timeout. So just don't set it. Signed-off-by: Mark Wielaard --- tests/ChangeLog| 16 tests/run-debuginfod-000-permission.sh

Re: [PATCH] tests: Don't set DEBUGINFOD_TIMEOUT

2021-11-15 Thread Mark Wielaard
Hi, On Thu, 2021-11-11 at 15:46 +0100, Mark Wielaard wrote: > Various tests set DEBUGINFOD_TIMEOUT to 10. Which is less than the default > of 90. None of the tests relied on a lower timeout. So just don't set it. Pushed. Cheers, Mark

Re: Buildbot failure in Wildebeest Builder on whole buildset

2021-11-15 Thread Mark Wielaard
On Mon, 2021-11-15 at 10:56 +, build...@builder.wildebeest.org wrote: > The Buildbot has detected a new failure on builder elfutils-centos- > x86_64 while building elfutils. > Full details are available at: > https://builder.wildebeest.org/buildbot/#builders/1/builds/860 > > Buildbot URL:

[PATCH] tests: Add -ldl to dwfl_proc_attach_LDFLAGS

2021-11-18 Thread Mark Wielaard
ce to symbol 'dlopen@@GLIBC_2.2.5' /usr/bin/ld: /usr/lib64/libdl.so.2: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status So simply explicitly add -ldl to the LDFLAGS. Signed-off-by: Mark Wielaard --- tests/ChangeLog | 4 tests/Makefi

Re: [PATCH] tests: Add -ldl to dwfl_proc_attach_LDFLAGS

2021-11-19 Thread Mark Wielaard
Hi Dmitry, On Fri, Nov 19, 2021 at 01:20:26AM +0300, Dmitry V. Levin wrote: > On Thu, Nov 18, 2021 at 10:23:41PM +0100, Mark Wielaard wrote: > > dwfl-proc-attach uses (overrides) dlopen (so it does nothing). This > > seems to cause a versioned dlopen symbol to be pulled in when bu

Re: eu-strip supported cpu architecture?

2021-11-19 Thread Mark Wielaard
t. Debian apparently has a mips64 backend but it isn't upstreamed. See also: https://sourceware.org/bugzilla/show_bug.cgi?id=23902 And: https://sourceware.org/bugzilla/show_bug.cgi?id=24795 Cheers, Mark

Re: [PATCH] dwfl: fix potential overflow when reporting on kernel modules

2021-11-19 Thread Mark Wielaard
t; > - char modname[128]; > > + char modname[128+1]; > >char *line = NULL; > >size_t linesz = 0; > >/* We can't just use fscanf here because it's not easy to distinguish \n > > LGTM, thanks. Agreed. Added a ChangeLog entry and pushed. Thanks, Mark

Re: [PATCH] tests: Add -ldl to dwfl_proc_attach_LDFLAGS

2021-11-20 Thread Mark Wielaard
ks. But I don't really understand why. Does the attached patch look OK to you? Thanks, Mark>From 311b42279d42187540e776648fd19c1e897fbacd Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Thu, 18 Nov 2021 21:34:57 +0100 Subject: [PATCH] tests: Add -rdynamic to dwfl_proc_attach_LDFLAGS

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

2021-11-21 Thread Mark Wielaard
ary. Since the payload of the FDO_PACKAGING_METADATA note are not simply key/values, but encoded in json, so we will need to add or depend on a json parser. Any recommendations? It seems a simple enough format to just write our own (especially if we can simply skip everything except top-level key/value strings to find the debuginfod-url). Thanks, Mark

Re: [PATCH] tests: Add -ldl to dwfl_proc_attach_LDFLAGS

2021-11-25 Thread Mark Wielaard
Hi, On Sat, 2021-11-20 at 15:18 +0100, Mark Wielaard wrote: > On Sat, Nov 20, 2021 at 01:12:17AM +0300, Dmitry V. Levin wrote: > > On Fri, Nov 19, 2021 at 05:58:19PM +0100, Florian Weimer wrote: > > > It may have to do with --as-needed that some builds use. If there ar

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

2021-11-30 Thread Mark Wielaard
od to simply say that Strings should not contain any control characters or use \u escaping]. See section 7 and section 8 in rfc8259. That should get rid of various corner cases that different parsers are known to get wrong. Especially \u escaping is really confusing when using the UTF-8 encoding (and it is totally necessary since UTF-8 can express any valid UTF character already). Cheers, Mark

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

2021-11-30 Thread Mark Wielaard
Hi, On Tue, Nov 30, 2021 at 05:49:58PM +0100, Florian Weimer wrote: > * Frank Ch. Eigler via Elfutils-devel: > > On Tue, Nov 30, 2021 at 12:25:41PM +0100, Mark Wielaard wrote: > >> [...] > >> The spec does explain the requirements for JSON numbers, but doesn't >

[PATCH] debuginfod: Check result of calling MHD_add_response_header.

2021-12-01 Thread Mark Wielaard
Although unlikely the MHD_add_response_header can fail for various reasons. If it fails something odd is going on. So check we can actually add a response header before using the response. Signed-off-by: Mark Wielaard --- debuginfod/ChangeLog | 10 +++ debuginfod/debuginfod.cxx | 127

Re: [PATCH] debuginfod: Check result of calling MHD_add_response_header.

2021-12-01 Thread Mark Wielaard
really fail often (or at all). But if it does, it would be good to be able to catch it. Thanks, Mark

[PATCH] debuginfod: Fix some memory leaks on debuginfod-client error paths.

2021-12-01 Thread Mark Wielaard
urces on exit (also updated a wrong comment about that). Signed-off-by: Mark Wielaard --- debuginfod/ChangeLog | 7 +++ debuginfod/debuginfod-client.c | 16 +++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog

[PATCH] debuginfod: Use gmtime_r instead of gmtime to avoid data race

2021-12-01 Thread Mark Wielaard
Since we are multi-threaded using gmtime might cause a data race because gmtime reuses a global struct to write data into. Make sure that each thread uses their own struct tm and use gmtime_r instead. Signed-off-by: Mark Wielaard --- debuginfod/ChangeLog | 5 + debuginfod

[PATCHv2] debuginfod: Check result of calling MHD_add_response_header.

2021-12-01 Thread Mark Wielaard
Although unlikely the MHD_add_response_header can fail for various reasons. If it fails something odd is going on. So check we can actually add a response header and log an error if we cannot. Signed-off-by: Mark Wielaard --- This version only check and logs the error, but still uses the

Re: [PATCH] debuginfod: Use gmtime_r instead of gmtime to avoid data race

2021-12-03 Thread Mark Wielaard
d. > > (thanks, lgtm) Thanks, pushed. Cheers, Mark

Re: [PATCH v2] build: allow turning off --no-undefined and -z,defs

2021-12-04 Thread Mark Wielaard
dalone option. In the past we made the mistake of adding configure options to disable some necessary flags, like --disable-symbol-versioning, which was a mistake. There are now distros shipping elfutils libraries with broken abis while using the same SONAMEs. Cheers, Mark

[PATCH] readelf: Workaround stringop-truncation error

2021-12-04 Thread Mark Wielaard
ing a zero terminator at buf[sizeof (buf) - 1]. Normally gcc does see this, but with -fsanitize=address there is too much (checking) code in between. But it is actually better to not let strncpy do too much work, so substract one from the size. Signed-off-by: Mark Wielaard --- src/ChangeLo

[PATCH] tests: varlocs workaround format-overflow errors

2021-12-04 Thread Mark Wielaard
nd this by simply changing the dwarf string functions to return an "" string. The test is for the correct names, either "(null)" or "" would make it fail (also remove a now unnecessary assert, the switch statement will check for unknown opcodes anyway). Signed-off-by:

[PATCH] debuginfod: Fix debuginfod_pool leak

2021-12-04 Thread Mark Wielaard
gcc address sanitizer detected a dangling debuginfod_client handler when debuginfod exits. Make sure to groom the debuginfod client pool before exit after all threads are done. Signed-off-by: Mark Wielaard --- debuginfod/ChangeLog | 4 debuginfod/debuginfod.cxx | 2 ++ 2 files changed

[PATCH] debuginfod: sqlite3_sharedprefix_fn should not compare past end of string

2021-12-04 Thread Mark Wielaard
gcc address sanitizer detected a read after the end of string in sqlite3_sharedprefix_fn. Make sure to stop comparing the strings when seeing the zero terminator. Signed-off-by: Mark Wielaard --- debuginfod/debuginfod.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH] debuginfod: Clear and reset debuginfod_client winning_headers on reuse

2021-12-04 Thread Mark Wielaard
gcc address sanitizer detected a leak of the debuginfod_client winning_headers when the handle was reused. Make sure to free and reset the winning_headers field before reuse. Signed-off-by: Mark Wielaard --- debuginfod/ChangeLog | 5 + debuginfod/debuginfod-client.c | 7 ++- 2

[PATCH] configure: Add --enable-sanitize-address

2021-12-04 Thread Mark Wielaard
detection for that program. One testcase, test_nlist, needs special linker flags, make sure it also uses -fsanitizer=address when using the address sanitizer. Signed-off-by: Mark Wielaard --- ChangeLog | 4 configure.ac | 25 + libcpu/ChangeLog | 5

Re: [PATCH v3] build: allow turning off --no-undefined and -z,defs

2021-12-05 Thread Mark Wielaard
st case the calculated addresses aren't actually used as (dereferenced) pointers, in the second the array bound being zero also means the array content isn't used. Do you know why these issues are flagged? Are there any extra ASAN_OPTIONS set in these cases? Cheers, Mark

Re: [PATCH] debuginfod: sqlite3_sharedprefix_fn should not compare past end of string

2021-12-05 Thread Mark Wielaard
On Sat, Dec 04, 2021 at 05:54:07PM -0500, Frank Ch. Eigler wrote: > > gcc address sanitizer detected a read after the end of string in > > sqlite3_sharedprefix_fn. Make sure to stop comparing the strings when > > seeing the zero terminator. > > Yup, OK. Thanks, pushed. Mark

Re: PATCH: testsuite debuginfod

2021-12-05 Thread Mark Wielaard
Hi Frank, 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 85602ff68179053f19a2005df4fc653a69757584 (HEAD -> master) > > Author: Frank Ch. Eigler > > Date: Thu

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

2021-12-05 Thread Mark Wielaard
Hi Luca, On Tue, Nov 30, 2021 at 12:25:41PM +0100, Mark Wielaard wrote: > On Thu, 2021-11-25 at 17:02 +, Luca Boccassi via Elfutils-devel > wrote: > > +/* Packaging metadata as defined on > > > https://systemd.io/COREDUMP_PACKAGE_METADATA/ */ > > > +#define FDO

Re: [PATCH] debuginfod/debuginfod-client.c: correct string format on 32bit arches with 64bit time_t

2021-12-05 Thread Mark Wielaard
writing use the same data type? We seem to not expect these intervals to be much bigger than a week, so an int should always be big enough (even when stretched up to a whole year). Thanks, Mark

Re: [PATCH] debuginfod: Fix some memory leaks on debuginfod-client error paths.

2021-12-05 Thread Mark Wielaard
On Wed, Dec 01, 2021 at 01:27:23PM +0100, Mark Wielaard wrote: > In a couple of places we might leak some memory when we encounter > an error. tmp_url might leak if realloc failed. escaped_string might > leak when setting up the data handle fails and we don't use it. > And one

Re: [PATCH] debuginfod: Clear and reset debuginfod_client winning_headers on reuse

2021-12-07 Thread Mark Wielaard
anks, pushed. Cheers, Mark

[PATCH] libdwfl: Don't try to convert too many bytes in dwfl_link_map_report

2021-12-08 Thread Mark Wielaard
When trying to read (corrupt) phdrs from a core file we only want to read and convert the bytes we could read. Also make sure we don't try to allocate too big buffers. https://sourceware.org/bugzilla/show_bug.cgi?id=28666 Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog | 6 ++ li

Re: [PATCHv2] debuginfod: Check result of calling MHD_add_response_header.

2021-12-08 Thread Mark Wielaard
IZE", > > + to_string(s.st_size).c_str() > > ) == MHD_NO > > + || MHD_add_response_header (r, "X-DEBUGINFOD-FILE", > > + file.c_str()) == MHD_NO) > > e.g., this formulation makes it impossible to add some headers if a > previous one failed. It is likely that if one fails, then all others fail similarly, but I see your point. Any header is better than no headers at all. Thanks, Mark

[PATCHv3] debuginfod: Check result of calling MHD_add_response_header.

2021-12-08 Thread Mark Wielaard
Although unlikely the MHD_add_response_header can fail for various reasons. If it fails something odd is going on. So check we can actually add a response header and log an error if we cannot. Signed-off-by: Mark Wielaard --- debuginfod/ChangeLog | 12 debuginfod/debuginfod.cxx

Re: [PATCH v3] build: allow turning off --no-undefined and -z,defs

2021-12-08 Thread Mark Wielaard
"pointer-overflow" > and "vla-bound" (which as far as I know aren't available in gcc) But those seem to report bogus issues. At least in these cases, it seems the code is fine. Cheers, Mark

Re: [PATCH] debuginfod/debuginfod-client.c: correct string format on 32bit arches with 64bit time_t

2021-12-08 Thread Mark Wielaard
t compiling in some environments is because of the inconsistent use of types. So I rather fix the build errors by fixing the used types than to simply cast the errors away. Cheers, Mark

Re: [PATCHv3] debuginfod: Check result of calling MHD_add_response_header.

2021-12-08 Thread Mark Wielaard
r == NULL (aka the response couldn't even be created). Filling in size would also be lying to the caller (who has to check the returned response isn't NULL anyway - and does, I just checked :) But it is also harmless to do, so if you want I can move it outside the if statement. Cheers, Mark

[COMMITTED] libdwfl: Don't read beyond end of file in dwfl_segment_report_module

2021-12-08 Thread Mark Wielaard
The ELF might not be fully mapped into memory (which probably means the phdrs are bogus). Don't try to read beyond what we have in memory already. Reported-by: Evgeny Vereshchagin Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog| 5 + li

[PATCH] libdwfl: Add overflow check while iterating in dwfl_segment_report_module

2021-12-08 Thread Mark Wielaard
While iterating the notes we could overflow the len variable if the note name or description was too big. Fix this by adding an (unsigned) overflow check. https://sourceware.org/bugzilla/show_bug.cgi?id=28654 Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog| 5

[PATCH] libdwfl: Make sure we know the phdr entry size before searching phdrs.

2021-12-08 Thread Mark Wielaard
Without the program header entry size we cannot search through the phdrs. https://sourceware.org/bugzilla/show_bug.cgi?id=28657 Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog | 4 libdwfl/link_map.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libdwfl

[PATCH] libdwfl: Don't trust e_shentsize in dwfl_segment_report_module

2021-12-08 Thread Mark Wielaard
://sourceware.org/bugzilla/show_bug.cgi?id=28659 Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog| 5 + libdwfl/dwfl_segment_report_module.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 8dd595f8

Re: Buildbot failure in Wildebeest Builder on whole buildset

2021-12-08 Thread Mark Wielaard
On Wed, Dec 08, 2021 at 05:20:29PM +, build...@builder.wildebeest.org wrote: > The Buildbot has detected a new failure on builder elfutils-centos-x86_64 > while building elfutils. > Full details are available at: > https://builder.wildebeest.org/buildbot/#builders/1/builds/868 > > Buildbo

Re: [PATCHv3] debuginfod: Check result of calling MHD_add_response_header.

2021-12-08 Thread Mark Wielaard
t; > But it is also harmless to do, so if you want I can move it outside the > > if statement. > > OK, whichever, doesn't much matter then. Pushed v3 as is. Thanks, Mark

[PATCH] libdwfl: Don't install an Elf handle in a Dwfl_Module twice

2021-12-08 Thread Mark Wielaard
dwfl_segment_report_module can be called with the same module name, start and end address twice (probably because of a corrupt core file). In that case don't override the main.elf handle if it already exists. https://sourceware.org/bugzilla/show_bug.cgi?id=28655 Signed-off-by: Mark Wie

Re: [PATCH] readelf: Workaround stringop-truncation error

2021-12-08 Thread Mark Wielaard
On Sat, Dec 04, 2021 at 10:15:04PM +0100, Mark Wielaard wrote: > In function ‘strncpy’, > inlined from ‘print_ehdr’ at readelf.c:1175:4: > error: ‘__builtin_strncpy’ specified bound 512 equals destination size >[-Werror=stringop-truncation] > > strncpy doesn'

Re: [PATCH] tests: varlocs workaround format-overflow errors

2021-12-08 Thread Mark Wielaard
On Sat, Dec 04, 2021 at 10:27:29PM +0100, Mark Wielaard wrote: > In function ‘printf’, > inlined from ‘handle_attr’ at varlocs.c:932:3: > error: ‘%s’ directive argument is null [-Werror=format-overflow=] > > The warning is technically correct. A %s argument should not be >

Re: [PATCH] debuginfod: Fix debuginfod_pool leak

2021-12-08 Thread Mark Wielaard
On Sat, Dec 04, 2021 at 10:33:35PM +0100, Mark Wielaard wrote: > gcc address sanitizer detected a dangling debuginfod_client handler > when debuginfod exits. Make sure to groom the debuginfod client pool > before exit after all threads are done. Pushed, Mark

Re: [PATCH] configure: Add --enable-sanitize-address

2021-12-08 Thread Mark Wielaard
Hi, On Sun, Dec 05, 2021 at 02:39:25AM +0100, Mark Wielaard wrote: > --enable-sanitize-address makes sure that all code is compiled with > -fsanitizer=address and all tests run against libasan. > > It can be combined with --enable-sanitize-undefined, but not with > --enable-va

right, trying --enable-sanitizer-address on armv7l

2021-12-09 Thread Mark Wielaard
don't understand why. It might be a bug in gcc/libasan (this is gcc 8.3.0 Debian 10.11 - Buster). I can try upgrading the machine to Debian 11 - Bullseye this weekend to see if that helps. Also, do we really want to right align the log here? We don't seem to align the log text anywhere else. Cheers, Mark

Re: right, trying --enable-sanitizer-address on armv7l

2021-12-09 Thread Mark Wielaard
Hi, On Thu, 2021-12-09 at 15:23 +0100, Mark Wielaard wrote: > I was trying the new --enable-sanitizer-address on our armv7l > buildbot worker and it almost works as is, except for... I was confusing address sanitizer and the undefined sanitizer. It is the undefined sanitizer that produc

Re: patch rfc: PR28661: debuginfod thread-pool

2021-12-09 Thread Mark Wielaard
fod/ChangeLog > +++ b/debuginfod/ChangeLog > @@ -1,3 +1,11 @@ > +2021-12-08 Frank Ch. Eigler > + > + * debuginfod.cxx (connection_pool): New global. > + (parse_opt): Parse & check -C option to set it. > + (error_cb): New callback for libmicrohttpd error counting. > +

Re: right, trying --enable-sanitizer-address on armv7l

2021-12-09 Thread Mark Wielaard
> line up. But no great loss to drop; we export those as prometheus > metrics too. I am not proud of needing this workaround, but I did push the attached. Thanks, Mark From 7fc69582efcfb5f005f04c818a7aab76ff1090be Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Thu, 9 Dec 2021

New buildbot CI worker setups

2021-12-09 Thread Mark Wielaard
-undefined Hopefully that is a good mix of extra checking options. Cheers, Mark

[PATCH] libdwfl: Don't try to convert too many dyns in dwfl_link_map_report

2021-12-09 Thread Mark Wielaard
When trying to read (corrupt) dynamic entries from a core file we only want to read and convert the entries we could read. Also make sure we don't try to allocate too bug a buffer. Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog | 6 ++ libdwfl/link_map.c | 14 +- 2

Re: patch rfc: PR28661: debuginfod thread-pool

2021-12-10 Thread Mark Wielaard
done > +(sleep 5; curl -s http://localhost:$PORT1/metrics | egrep > 'error|transfers'; kill $PID1) & > +wait > +PID1=0 > +done Launching 400 processes at once seems a lot. But maybe machines these days are fine with that. I would say that 50 should also do the trick. But maybe I just have wimpy machines :) Is there a more elegant way to check all requests have been processed than a sleep 5 followed by a metric scrape for errors? Is there a metric that gives the number of successful queries that we could use instead with wait_ready? > +xfail "grep Server.reached.connection vlog$PORT1" # PR18661 > + > +exit 0 Cheers, Mark

Re: Buildbot failure in Wildebeest Builder on whole buildset

2021-12-11 Thread Mark Wielaard
all looked fine. The missing testcase in the both cases was run-debuginfod-federation-metrics.sh But I have been unable to make that testcase hang when running make check by hand. Cheers, Mark

[COMMITTED] libdwfl: Don't allocate more than SIZE_MAX in dwfl_segment_report_module.

2021-12-12 Thread Mark Wielaard
rted-by: Evgeny Vereshchagin Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog| 5 + libdwfl/dwfl_segment_report_module.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 856bd335..aaea164c 100644 --- a/libdwfl/ChangeLog +++ b/li

[PATCH] libelf: Use offsetof to get field of unaligned

2021-12-15 Thread Mark Wielaard
are taking the address of it. But we can do the same by adding the field offsetof to the base address. Which doesn't trigger a runtime error. Signed-off-by: Mark Wielaard --- libelf/ChangeLog | 5 + libelf/elf_begin.c | 15 +-- 2 files changed, 14 insertions(+), 6 deletions(-)

[PATCH] libdwfl: Make sure phent is sane and there is at least one phdr

2021-12-15 Thread Mark Wielaard
dwfl_link_map_report can only handle program headers that are the correct (32 or 64 bit) size. The buffer read in needs to contain room for at least one Phdr. https://sourceware.org/bugzilla/show_bug.cgi?id=28660 Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog | 6 ++ libdwfl

Re: [PATCH] debuginfod/debuginfod-client.c: use long for cache time configurations

2021-12-15 Thread Mark Wielaard
lain long everywhere as the intervals are small enough > > that it will not be problematic. > > lgtm! Added ChangeLog entry and pushed. Thanks, Mark

Re: Buildbot failure in Wildebeest Builder on whole buildset

2021-12-16 Thread Mark Wielaard
ause in the child the unwind info will be wrong. */ cfi_endproc syscall => test%RAX_LP, %RAX_LP jl SYSCALL_ERROR_LABEL jz L(thread_start) ret L(thread_start): cfi_startproc /* Clearing frame pointer is insufficient,

Re: [PATCH] libelf: Use offsetof to get field of unaligned

2021-12-16 Thread Mark Wielaard
Hi Florian, On Wed, 2021-12-15 at 23:40 +0100, Florian Weimer via Elfutils-devel wrote: > * Mark Wielaard: > > > This seems a wrong warning since we aren't accessing the field member > > of the struct, but are taking the address of it. But we can do the > > same by

Re: [PATCH] tests: integrate fuzz-dwfl-core into elfutils

2021-12-17 Thread Mark Wielaard
configure. The build-fuzzers.sh script seems very specific to a google setup which most people won't have locally and which seems somewhat tricky to replicate on other CI builders. Cheers, Mark

[PATCH] libdwfl: Make dwfl_segment_report_module aware of maximum Elf size

2021-12-17 Thread Mark Wielaard
pass the maximum size so we can limit the amount of memory we reserve. Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog| 8 libdwfl/core-file.c | 1 + libdwfl/dwfl_segment_report_module.c | 5 +++-- libdwfl/libdwflP.h | 1 + 4 files

[PATCH] libdwfl: Make sure the note len increases each iteration

2021-12-17 Thread Mark Wielaard
In dwfl_segment_report_module we have an overflow check when reading notes, but we could still not make any progress if the number of bytes read (len) didn't increase at all. Check len > last_len. Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog| 5 +

[COMMITTED] tests: Use /bin/sh instead of /bin/ls as always there binary

2021-12-17 Thread Mark Wielaard
run-debuginfod-query-retry.sh would fail when /bin/ls wasn't available. Use /bin/sh instead which really is always available. GNU Guix doesn't have any other standard binary in /bin except for sh. Signed-off-by: Mark Wielaard --- tests/ChangeLog | 4

[PATCH] libdwfl: Make sure there is at least one dynamic entry

2021-12-17 Thread Mark Wielaard
The buffer read in needs to contain room for at least one Elf32_Dyn or Elf64_Dyn entry. Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog | 5 + libdwfl/link_map.c | 5 + 2 files changed, 10 insertions(+) diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index f849b816..d4eee639

[PATCH] libdwfl: Make sure there is at least one phdr

2021-12-17 Thread Mark Wielaard
The buffer read in needs to contain room for at least one Phdr. Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog | 4 libdwfl/link_map.c | 5 + 2 files changed, 9 insertions(+) diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index d4eee639..8760b1ef 100644 --- a/libdwfl

[PATCH] libdwfl: Make sure note data is properly aligned.

2021-12-17 Thread Mark Wielaard
In dwfl_segment_report_module the note data might not be properly aligned. Check that it is before accessing the data directly. Otherwise convert data so it is properly aligned. Also fix NOTE_ALIGN4 and NOTE_ALIGN8 to work correctly with long types. Signed-off-by: Mark Wielaard --- libdwfl

[PATCH] libelf: Only set shdr state when there is at least one shdr

2021-12-19 Thread Mark Wielaard
The elf shdr state only needs to be set when scncnt is at least one. Otherwise e_shoff can be bogus. Also use unsigned arithmetic for checking e_shoff alignment. Signed-off-by: Mark Wielaard --- libelf/ChangeLog | 5 + libelf/elf_begin.c | 16 ++-- 2 files changed, 15

[PATCH] libdwfl: Make sure that ph_buffer_size has room for at least one phdr

2021-12-19 Thread Mark Wielaard
dwfl_segment_report_module might otherwise try to handle half a phdr taking the other half from after the buffer. Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog| 5 + libdwfl/dwfl_segment_report_module.c | 7 ++- 2 files changed, 11 insertions(+), 1 deletion

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