Re: [PATCH] debuginfod: add --listen-address option

2025-03-28 Thread Mark Wielaard
Hi Michael, On Thu, 2025-03-27 at 17:06 +0100, Michael Trapp wrote: > Use MHD_OPTION_SOCK_ADDR to bind the http listen socket to a single address. > The address should be an IPv4 or IPv6 address configured on the system: > --listen-address=127.0.0.1 > --listen-address=::1 > --listen-ad

[PATCH] debuginfod: add --listen-address option

2025-03-27 Thread Michael Trapp
Use MHD_OPTION_SOCK_ADDR to bind the http listen socket to a single address. The address should be an IPv4 or IPv6 address configured on the system: --listen-address=127.0.0.1 --listen-address=::1 --listen-address='LOCAL_IPv4|IPv6_ADDRESS' As debuginfod does not include any security fea

Re: [PATCH] debuginfod: add --listen-address option

2025-03-27 Thread Mark Wielaard
Hi Michael, On Thu, Mar 27, 2025 at 04:43:49PM +0100, Michael Trapp wrote: > Use MHD_OPTION_SOCK_ADDR to bind the http listen socket to a single address. > The address should be an IPv4 or IPv6 address configured on the system: > --listen-address=127.0.0.1 > --listen-address=::1 > --li

[PATCH] debuginfod: add --listen-address option

2025-03-27 Thread Michael Trapp
Use MHD_OPTION_SOCK_ADDR to bind the http listen socket to a single address. The address should be an IPv4 or IPv6 address configured on the system: --listen-address=127.0.0.1 --listen-address=::1 --listen-address='LOCAL_IPv4|IPv6_ADDRESS' As debuginfod does not include any security fea

Re: [obv] [patch] debuginfod-client memory hygiene

2025-02-23 Thread Mark Wielaard
Hi Frank, On Thu, Feb 20, 2025 at 02:18:04PM -0500, Frank Ch. Eigler wrote: > > [...] > > This does sounds like a bug in glibc sscanf. I cannot find a > > description of what exactly happens with 'm' modifier allocated > > buffers on error. So I can imagine a double free if sscanf frees the > > bu

Re: [obv] [patch] debuginfod-client memory hygiene

2025-02-20 Thread Frank Ch. Eigler
Hi - > [...] > This does sounds like a bug in glibc sscanf. I cannot find a > description of what exactly happens with 'm' modifier allocated > buffers on error. So I can imagine a double free if sscanf frees the > buffer on error. But returning a bogus pointer? That seems a bug. If > we aren't gu

Re: [obv] [patch] debuginfod-client memory hygiene

2025-02-19 Thread Mark Wielaard
Hi Frank, On Tue, Feb 18, 2025 at 10:30:44PM -0500, Frank Ch. Eigler wrote: > Planning to commit this shortly: > > commit a71bac67f4705b84368b71f5ece54deedaa1abf1 (HEAD -> master1) > Author: Frank Ch. Eigler > Date: Tue Feb 18 22:09:12 2025 -0500 > > debuginfod-client: correct invalid fre

[obv] [patch] debuginfod-client memory hygiene

2025-02-18 Thread Frank Ch. Eigler
Planning to commit this shortly: commit a71bac67f4705b84368b71f5ece54deedaa1abf1 (HEAD -> master1) Author: Frank Ch. Eigler Date: Tue Feb 18 22:09:12 2025 -0500 debuginfod-client: correct invalid free() in failed ima path debuginfod-find with a failed signature configuration was f

Re: [PATCH] debuginfod-client.c: Avoid freeing uninitialized value

2025-01-25 Thread Mark Wielaard
Hi Aaron, On Fri, Jan 24, 2025 at 08:32:48PM -0500, Aaron Merey wrote: > debuginfod_validate_imasig might call free on an uninitialized sig_buf > due to a goto that can occur before sig_buf is set to NULL. > > Fix this by setting sig_buf to NULL before the goto. The first thing after exit_valida

[PATCH] debuginfod-client.c: Avoid freeing uninitialized value

2025-01-24 Thread Aaron Merey
debuginfod_validate_imasig might call free on an uninitialized sig_buf due to a goto that can occur before sig_buf is set to NULL. Fix this by setting sig_buf to NULL before the goto. Signed-off-by: Aaron Merey --- debuginfod/debuginfod-client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

Re: [PATCH] debuginfod: add CORS support

2024-12-08 Thread Frank Ch. Eigler
"Frank Ch. Eigler" Date: Sat, 7 Dec 2024 15:01:54 -0500 Subject: [PATCH] debuginfod: in --cors mode, add CORS response headers and OPTIONS method From: Henning Meyer CORS is the Cross-Origin-Resource-Sharing mechanism explained at https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

Re: [PATCH] debuginfod: add CORS support

2024-12-08 Thread Henning Meyer
g On 08.12.24 12:06, Florian Weimer wrote: * Frank Ch. Eigler: Hi - I'm planning to commit this shortly: From 4ebefc8f3b4b8fb68a55c960e70122fda50a0fb9 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Sat, 7 Dec 2024 15:01:54 -0500 Subject: [PATCH] debuginfod: add CORS respon

Re: [PATCH] debuginfod: add CORS support

2024-12-08 Thread Frank Ch. Eigler
Hi - > [...] > I think it will allow public web clients to exfiltrate debuginfo data > from debuginfod servers on private intranets. Previously, the > cross-origin restrictions on web content would have prevented that. Yes, this is the flip side of the CORS default coin. ISTM the convenience is

Re: [PATCH] debuginfod: add CORS support

2024-12-08 Thread Florian Weimer
* Frank Ch. Eigler: > Hi - > > I'm planning to commit this shortly: > > From 4ebefc8f3b4b8fb68a55c960e70122fda50a0fb9 Mon Sep 17 00:00:00 2001 > From: "Frank Ch. Eigler" > Date: Sat, 7 Dec 2024 15:01:54 -0500 > Subject: [PATCH] debuginfod: add CORS respon

Re: [PATCH] debuginfod: add CORS support

2024-12-07 Thread Mark Wielaard
Hi Henning, On Fri, Dec 06, 2024 at 01:01:34AM +0100, Henning Meyer wrote: > it is the Cross-Origin-Resource-Sharing mechanism explained at > https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS Thanks, this might be a good URL to include in a comment so others know what the extra headers are t

Re: [PATCH] debuginfod: add CORS support

2024-12-07 Thread Frank Ch. Eigler
Hi - I'm planning to commit this shortly: >From 4ebefc8f3b4b8fb68a55c960e70122fda50a0fb9 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Sat, 7 Dec 2024 15:01:54 -0500 Subject: [PATCH] debuginfod: add CORS response headers and OPTIONS method From: Henning Meyer

Re: [PATCH] debuginfod: add CORS support

2024-12-05 Thread Henning Meyer
Hi Mark, it is the Cross-Origin-Resource-Sharing mechanism explained at https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS 1. by default JavaScript code from Website A cannot request arbitrary resources from website B,    these are called cross-origin-requests 2. The browser performs what

Re: [PATCH] debuginfod: add CORS support

2024-12-05 Thread Mark Wielaard
Hi Frank, Hi Henning, On Wed, 2024-12-04 at 19:40 -0500, Frank Ch. Eigler wrote: > > This is my first attempt at implementing CORS support in debuginfod. > > Looks good to me really; will wait for a glance from others. So the code looks correct if you want to handle the OPTION command and add a

Re: [PATCH] debuginfod: add CORS support

2024-12-04 Thread Frank Ch. Eigler
Hi - > This is my first attempt at implementing CORS support in debuginfod. Looks good to me really; will wait for a glance from others. > I should probably add or change tests. [...] I wouldn't overthink it - just add a "-i" to any random curl command and look for ACAO:*. I reconfigured the d

[PATCH] debuginfod: add CORS support

2024-12-04 Thread Henning Meyer
This is my first attempt at implementing CORS support in debuginfod. I should probably add or change tests. Since debuginfod-find does not need this functionality, it would be another test done with curl. I had a look at the existing tests, run-debuginfod-webapi-concurrency.sh looks like it wou

Re: [PATCH] debuginfod-client.c: add dlclose call to prevent resource leak

2024-11-01 Thread Frank Ch. Eigler
Hi - On Fri, Nov 01, 2024 at 07:37:03PM +0300, Anton Moryakov wrote: > Previously, the handle debuginfod_so created by dlopen was not closed > in all cases, leading to a potential resource leak. This commit adds an > additional dlclose call to ensure that the handle is always properly > release

[PATCH] debuginfod-client.c: add dlclose call to prevent resource leak

2024-11-01 Thread Anton Moryakov
Previously, the handle debuginfod_so created by dlopen was not closed in all cases, leading to a potential resource leak. This commit adds an additional dlclose call to ensure that the handle is always properly released, whether the symbols are successfully loaded or not. Found by RASU JSC. Si

[patch] debuginfod metadata query timeout enforcement

2024-09-03 Thread Frank Ch. Eigler
Hi - Proposed patch for a problem we spotted recently in unreleased code: commit b853004e723d058f97362dbfdc40d1c49ea2ef51 (HEAD -> main) Author: Frank Ch. Eigler Date: Tue Sep 3 11:27:36 2024 -0400 debuginfod: service metadata queries in separate, timed-out connections The --meta

Re: [PATCH] debuginfod: Make sure crypto and jsonc are also included in static link

2024-08-21 Thread Mark Wielaard
Hi, On Wed, Aug 21, 2024 at 03:32:59PM +0200, Mark Wielaard wrote: > When doing a --enable-gcov build we link all binaries static. > libdebuginfod.so now depends on crypto an jsonc. So also add those > when linking against libdebuginfod.a > > debuginfod/Makefile.am (libdebuginfod): Add $(cr

[PATCH] debuginfod: Make sure crypto and jsonc are also included in static link

2024-08-21 Thread Mark Wielaard
When doing a --enable-gcov build we link all binaries static. libdebuginfod.so now depends on crypto an jsonc. So also add those when linking against libdebuginfod.a debuginfod/Makefile.am (libdebuginfod): Add $(crypto_LIBS) $(jsonc_LIBS) when BUILD_STATIC. Signed-off-by: Mark Wielaar

PATCH: debuginfod configury rework

2024-06-04 Thread Frank Ch. Eigler
Hi - A few buildbots are unhappy with the debuginfod configury from yesterday. It's right: it's rather convoluted. This patch reworks and harmonizes all of that stuff. Author: Frank Ch. Eigler Date: Mon Jun 3 18:14:52 2024 -0400 rework debuginfod configury Rework the top level

Re: [patch] debuginfod metadata extension

2024-06-03 Thread Aaron Merey
Hi Frank, LGTM, please go ahead and merge the patch with these changes. Aaron On Sat, Jun 1, 2024 at 11:26 AM Frank Ch. Eigler wrote: > > Hi - > > > Thanks for the patch, some suggestions below. > > Thanks, adding the following 'git diff -w' to the patch you reviewed: > > > [...] > > I was expe

Re: [patch] debuginfod metadata extension

2024-06-01 Thread Frank Ch. Eigler
Hi - > Thanks for the patch, some suggestions below. Thanks, adding the following 'git diff -w' to the patch you reviewed: > [...] > I was experimenting with metadata queries to a local server that indexed > a single rpm (binutils-2.41-8.fc40.x86_64.rpm). The following commands > produced JSON w

Re: [PATCH] debuginfod: Remove unused variable

2024-03-10 Thread Frank Ch. Eigler
Khem Raj writes: > Recent commit acd9525e9 has removed all references to max_fds > therefore remove it, moreover clang18 is happier Thanks, merged as obvious. - FChE

[PATCH] debuginfod: Remove unused variable

2024-03-09 Thread Khem Raj
Recent commit acd9525e9 has removed all references to max_fds therefore remove it, moreover clang18 is happier | ../../elfutils-0.191/debuginfod/debuginfod.cxx:1448:8: error: private field 'max_fds' is not used [-Werror,-Wunused-private-field] | 1448 | long max_fds; | |^ | 1 erro

[patch] debuginfod.8

2023-11-14 Thread Frank Ch. Eigler
commit 06e0aacb4b288403bd02a0820dd0f87c7f017a2b (HEAD -> master) Author: Frank Ch. Eigler Date: Tue Nov 14 14:09:40 2023 -0500 doc/debuginfod.8: clarify source file handling Added text about the archive common-prefix heuristic, mentioned the new eu-srcfiles tool, and gave som

[COMMITTED][PATCH] debuginfod-client.c: Don't print empty line in header_callback

2023-11-01 Thread Aaron Merey
libcurl passes an empty line to header_callback indicating the end of the response's HTTP headers. Currently this empty line is printed to the debuginfod_client's verbose_fd with a "header" prefix: $ echo $DEBUGINFOD_URLS https://debuginfod.fedoraproject.org/ $ debuginfod-find -vv deb

[PATCH] debuginfod PR29472: metadata queries

2023-10-18 Thread Frank Ch. Eigler
Hi - This patch, mostly the work of Ryan Goldberg, has undergone some decent testing alongside its systemtap consumer (which is already merged). If there's interest, I could install it speculatively on one of the fedora debuginfod servers, the one that's already running its prerequisite RPM-IMA p

[OB PATCH] debuginfod-client.c: Avoid sscanf on mixed-case component of string

2023-03-30 Thread Aaron Merey via Elfutils-devel
Committing as obvious. sscanf is used to get the value of x-debuginfod-size from the http headers. The format string used assumes that the header field name is entirely lower case. However mixed-case field names are possible, resulting in the value not being read. Fix this by removing "x-debugi

Re: [PATCH] debuginfod-client.c: Fix download size not correctly fallbacks to x-debuginfod-size header

2023-03-29 Thread lilydjwg via Elfutils-devel
On Wed, Mar 29, 2023 at 10:57:47PM +0800, lilydjwg wrote: > On Wed, Mar 29, 2023 at 08:28:35AM -0400, Frank Ch. Eigler wrote: > > Hi - > > > > > [...] > > > The reason is that when Content-Length is unavailable, cl is set to -1 > > > by curl > > > > Is that behaviour from new versions of curl? >

Re: [PATCH] debuginfod-client.c: Fix download size not correctly fallbacks to x-debuginfod-size header

2023-03-29 Thread lilydjwg via Elfutils-devel
On Wed, Mar 29, 2023 at 08:28:35AM -0400, Frank Ch. Eigler wrote: > Hi - > > > [...] > > The reason is that when Content-Length is unavailable, cl is set to -1 > > by curl > > Is that behaviour from new versions of curl? Yes. curl 8.0.1 to be exact. > > but dl_size remains as 0, but later dl_s

Re: [PATCH] debuginfod-client.c: Fix download size not correctly fallbacks to x-debuginfod-size header

2023-03-29 Thread Frank Ch. Eigler via Elfutils-devel
Hi - > [...] > The reason is that when Content-Length is unavailable, cl is set to -1 > by curl Is that behaviour from new versions of curl? > but dl_size remains as 0, but later dl_size == -1 is checked. Or perhaps dl_size needs to be initialized to -1 ("unknown") vs 0 ("known to be zero"), a

[PATCH] debuginfod-client.c: Fix download size not correctly fallbacks to x-debuginfod-size header

2023-03-28 Thread lilydjwg--- via Elfutils-devel
From: lilydjwg Currently when the debuginfod server doesn't set Content-Length but set x-debuginfod-size header, it's ignored and the progressfn doesn't know the total size. This happens for me with Arch Linux's debuginfod server and gdb. The reason is that when Content-Length is unavailable, c

[OB PATCH] debuginfod-client.c: Download section even if cached executable didn't contain it.

2023-02-07 Thread Aaron Merey via Elfutils-devel
Committing as obvious. Before attempting to download a section, cache_find_section tries to extract the section from existing files in the cache. If it's determined that the section must not exist, cache_find_section returns -ENOENT to indicate that the download should be skipped. This patch fixe

[PATCH] debuginfod-find.1: note on how to find a comp_dir

2023-01-10 Thread Serhei Makarov
doc/ChangeLog: * debuginfod-find.1: add a note to DESCRIPTION section for the 'source' subcommand, clarifying where to find the CU compilation-directory. I'm looking at how to improve and document the workflow for using debuginfod-find to study the behaviour of packaged software on a system, e.

Re: [PATCH] debuginfod: Initialize response_data early in debuginfod-client query

2022-11-21 Thread Mark Wielaard
Hi, On Tue, 2022-11-15 at 17:55 +0100, Mark Wielaard wrote: > On error going to out2, the response_data is freed. So initialize the > response_data to NULL immediately after allocation or when going back > to query_in_parallel. Frank on irc said this looked fine. Pushed, Mark

[PATCH] debuginfod: Initialize response_data early in debuginfod-client query

2022-11-15 Thread Mark Wielaard
On error going to out2, the response_data is freed. So initialize the response_data to NULL immediately after allocation or when going back to query_in_parallel. Signed-off-by: Mark Wielaard --- debuginfod/ChangeLog | 5 + debuginfod/debuginfod-client.c | 4 ++-- 2 files changed, 7

patch, debuginfod

2022-11-03 Thread Frank Ch. Eigler via Elfutils-devel
Hi - Showing diff -w to omit reindentation whitespace noise. Maybe worth backporting to 0.188 releases, could affect federation intermediate servers with burst workload. commit ec166cf3c8d825a2f02aca448a0823de12e78991 (HEAD -> master) Author: Frank Ch. Eigler Date: Thu Nov 3 10:07:31 2022 -0

Re: [PATCH] debuginfod-client: Add DEBUGINFOD_HEADERS_FILE.

2022-10-28 Thread Mark Wielaard
Hi Daniel, On Tue, 2022-10-18 at 14:21 -0700, Daniel Thornburgh via Elfutils-devel wrote: > This DEBUGINFOD_HEADERS_FILE environment variable names a file to supply > HTTP headers to outgoing requests. Notably, this allows for > Authorization headers to be added from a file under OS access control

Re: [PATCH] debuginfod: Support queries for ELF/DWARF sections

2022-10-26 Thread Aaron Merey via Elfutils-devel
Hi Mark, On Wed, Oct 26, 2022 at 11:06 AM Mark Wielaard wrote: > On Mon, 2022-10-24 at 14:38 -0400, Frank Ch. Eigler via Elfutils-devel > wrote: > > - not sure I understand why the code worries about dots in or not in > > section names. Why not just pass them verbatim throughout the code > >

Re: [PATCH] debuginfod: Support queries for ELF/DWARF sections

2022-10-26 Thread Aaron Merey via Elfutils-devel
Hi Frank, On Mon, Oct 24, 2022 at 2:38 PM Frank Ch. Eigler wrote: > - use of write(2) to put files onto disk is not quite right; write(2) can > be partial, so you need a loop (or a macro wrapping a loop) Fixed. > - not sure I understand why the code worries about dots in or not in > section

Re: [PATCH] debuginfod: Support queries for ELF/DWARF sections

2022-10-26 Thread Frank Ch. Eigler via Elfutils-devel
Hi - > Is/should the section name be URL-encoded? Yes! > I would drop the maybe_debuginfo_section heuristics. There are some > sections like .strtab/.symtab that are probably in the debug file, but > might be in the executable. I would assume that a named section can > normally be found in the d

Re: [PATCH] debuginfod: Support queries for ELF/DWARF sections

2022-10-26 Thread Mark Wielaard
Hi, On Mon, 2022-10-24 at 14:38 -0400, Frank Ch. Eigler via Elfutils-devel wrote: > - use of write(2) to put files onto disk is not quite right; write(2) > can > be partial, so you need a loop (or a macro wrapping a loop) Since debuginfod-client.c already includes system.h it can use: static i

Re: [PATCH] debuginfod: Support queries for ELF/DWARF sections

2022-10-26 Thread Mark Wielaard
Hi, On Mon, 2022-10-24 at 14:38 -0400, Frank Ch. Eigler via Elfutils-devel wrote: > - not sure I understand why the code worries about dots in or not in > section names. Why not just pass them verbatim throughout the code > base, and not worry about whether or not there's a dot? Does the >

Re: [PATCH] debuginfod: Support queries for ELF/DWARF sections

2022-10-24 Thread Frank Ch. Eigler via Elfutils-devel
Hi - Generally looks fine, thanks a lot. A few nits: - use of write(2) to put files onto disk is not quite right; write(2) can be partial, so you need a loop (or a macro wrapping a loop) - not sure I understand why the code worries about dots in or not in section names. Why not just pass th

[PATCH] debuginfod: Support queries for ELF/DWARF sections

2022-10-21 Thread Aaron Merey via Elfutils-devel
I'm resending this patch with a small modification. I added a new field "progressfn_cancel" to debuginfod_client that indicates whether the most recent query was cancelled due to progressfn returning 1. If a server doesn't support section queries and the client begins downloading a debuginfo or e

[PATCH] debuginfod-client: Add DEBUGINFOD_HEADERS_FILE.

2022-10-18 Thread Daniel Thornburgh via Elfutils-devel
This DEBUGINFOD_HEADERS_FILE environment variable names a file to supply HTTP headers to outgoing requests. Notably, this allows for Authorization headers to be added from a file under OS access control. Signed-off-by: Daniel Thornburgh --- NEWS| 3 +++ debuginfod/Ch

Re: [PATCH] debuginfod: Support queries for ELF/DWARF sections.

2022-09-28 Thread Aaron Merey via Elfutils-devel
Hi Frank, On Wed, Sep 28, 2022 at 10:28 AM Frank Ch. Eigler wrote: > On Tue, Sep 27, 2022 at 10:10:52PM -0400, Aaron Merey via Elfutils-devel > wrote: > > > [...] In order to distinguish between debuginfo and executable > > files with the same build-id, this function includes a bool > > paramet

Re: [PATCH] debuginfod: Support queries for ELF/DWARF sections.

2022-09-28 Thread Frank Ch. Eigler via Elfutils-devel
Hi, Aaron - On Tue, Sep 27, 2022 at 10:10:52PM -0400, Aaron Merey via Elfutils-devel wrote: > [...] In order to distinguish between debuginfo and executable > files with the same build-id, this function includes a bool > parameter use_debuginfo. If true, attempt to retrieve the section > from t

[OB PATCH] debuginfod-client: Ensure only negative error codes returned.

2022-09-28 Thread Aaron Merey via Elfutils-devel
Committing as obvious: Switch a couple error codes from positive to negative so they aren't interpreted as file descriptors by the caller. Signed-off-by: Aaron Merey --- debuginfod/ChangeLog | 5 + debuginfod/debuginfod-client.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deleti

[PATCH] debuginfod: Support queries for ELF/DWARF sections.

2022-09-27 Thread Aaron Merey via Elfutils-devel
This patch adds a new function debuginfod_find_section which queries debuginfod servers for the binary contents of the specified ELF/DWARF section in a file matching the given build-id. In order to distinguish between debuginfo and executable files with the same build-id, this function includes a

Re: [PATCH] debuginfod: Add Ubuntu's debuginfod service to the list.

2022-09-15 Thread Martin Liška
Pushed, thanks for the server! Martin On 9/15/22 03:26, Sergio Durigan Junior via Elfutils-devel wrote: > Signed-off-by: Sergio Durigan Junior > --- > Debuginfod.html | 8 > 1 file changed, 8 insertions(+) > > diff --git a/Debuginfod.html b/Debuginfod.html > index 64fef86c..71bc7c9b 1

[PATCH] debuginfod: Add Ubuntu's debuginfod service to the list.

2022-09-14 Thread Sergio Durigan Junior via Elfutils-devel
Signed-off-by: Sergio Durigan Junior --- Debuginfod.html | 8 1 file changed, 8 insertions(+) diff --git a/Debuginfod.html b/Debuginfod.html index 64fef86c..71bc7c9b 100644 --- a/Debuginfod.html +++ b/Debuginfod.html @@ -170,6 +170,14 @@ all +

Re: [PATCH] debuginfod: Use auto-sized connection pool when -C is not given with arg

2022-09-05 Thread Frank Ch. Eigler via Elfutils-devel
Hi - > [...] > Fix this by using an auto-sized thread pool when '-C' is not given, just > as we do when it's given with no argument. Update the doc's description > of '-C'. Thanks, pushed. - FChE

[PATCH] debuginfod: Use auto-sized connection pool when -C is not given with arg

2022-09-02 Thread Aaron Merey via Elfutils-devel
Since commit 4b42d9ad, libmicrohttpd's epoll event loop is used when available in which case we must disable its setting for spawning a thread per request. This contradicts the debuginfod doc's description of '-C', which indicates that if this command line option is not given then the thread pool

Re: [PATCH] debuginfod: fix http_requests_total{type="debuginfo"} when dwz is used

2022-08-17 Thread Frank Ch. Eigler via Elfutils-devel
Hi - > When dwarf_extract_source_paths is called, it can call handle_buildid > when a rpm file used dwz. Ignore such internal request in > http_requests_total statistics. Noble goal: > @@ -1906,7 +1906,7 @@ handle_buildid (MHD_Connection* conn, > const string& buildid /* unsafe

Re: [PATCH] debuginfod: print filename for "cannot open archive" error

2022-08-17 Thread Frank Ch. Eigler via Elfutils-devel
Hi - > Report the file that has such a problem so that one can inspect it. > Signed-off-by: Martin Liska The complication with this type of change is that the exception text objects also make it into the prometheus metrics. When file names and such variables show up, they will bifurcate all the

[PATCH] debuginfod: fix http_requests_total{type="debuginfo"} when dwz is used

2022-08-17 Thread Martin Liška
When dwarf_extract_source_paths is called, it can call handle_buildid when a rpm file used dwz. Ignore such internal request in http_requests_total statistics. Signed-off-by: Martin Liska --- debuginfod/debuginfod.cxx | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a

[PATCH] debuginfod: print filename for "cannot open archive" error

2022-08-17 Thread Martin Liška
Report the file that has such a problem so that one can inspect it. Signed-off-by: Martin Liska --- debuginfod/debuginfod.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx index 9245be53..67683354 100644 --- a/debugi

[PATCH] debuginfod: Fix concurrent request leading to a same .rpm file [PR29474]

2022-08-15 Thread Martin Liška
As explained in detail in the PR, the problem happens when multiple requests lead to a single RPM and one of the threads does prefetching. In that case, the requested file is added to fdcache and thus skip as interned. --- debuginfod/debuginfod.cxx | 69 --- 1 f

Re: [PATCH] debuginfod: optimize regular expressions in groom()

2022-08-03 Thread Frank Ch. Eigler via Elfutils-devel
Hi - > Subject: [PATCH] debuginfod: optimize regular expressions in groom() Thanks, pushed. - FChE

[PATCH] debuginfod: optimize regular expressions in groom()

2022-08-03 Thread Josef Čejka via Elfutils-devel
>From 2b377704f46081f2348dfc5650820ac9b5485758 Mon Sep 17 00:00:00 2001 From: Josef Cejka Date: Wed, 3 Aug 2022 13:33:21 +0200 Subject: [PATCH] debuginfod: optimize regular expressions in groom() Check if applying of -I and -X during grooming is enabled before the regular expressions are matc

Re: [PATCH] debuginfod: add --disable-source-scan option.

2022-06-03 Thread Frank Ch. Eigler via Elfutils-devel
Hi - > --disable-source-scan disables scanning of the dwarf source info > of debuginfo sections. The source info is not required in setups > without source code access. Thanks, merged (with a bit of ChangeLoggery added afterwards). - FChE

[PATCH] debuginfod: add --disable-source-scan option.

2022-06-03 Thread Michael Trapp via Elfutils-devel
--disable-source-scan disables scanning of the dwarf source info of debuginfo sections. The source info is not required in setups without source code access. Signed-off-by: Michael Trapp --- This option should save some scan cycles and DB space. If there is no access to source code, the source i

Re: [PATCH] debuginfod: Always request servname from getnameinfo for conninfo.

2022-05-14 Thread Mark Wielaard
Hi, On Mon, May 09, 2022 at 11:10:44PM +0200, Mark Wielaard wrote: > When getting the connection info getnameinfo is called getting the > hostname and servname except when the sockaddr is a pure ipv6 > address. In that last case only hostname is requested. Since servname > is stack allocated and n

Re: [PATCH] debuginfod: Check all curl_easy_setopt calls

2022-05-14 Thread Mark Wielaard
Hi, On Mon, May 09, 2022 at 06:22:29PM +0200, Mark Wielaard wrote: > curl_easy_setup can fail for various reasons. Add a curl_easy_setopt_ck > macro to check all curl_easy_setopt calls and provides a human readable > error message in verbose mode. Pushed. Cheers, Mark

Re: [PATCH] debuginfod: Use MHD_USE_EPOLL for libmicrohttpd version 0.9.51 or higher

2022-05-11 Thread Mark Wielaard
On Fri, May 06, 2022 at 12:38:40AM +0200, Mark Wielaard wrote: > Also disable MHD_USE_THREAD_PER_CONNECTION when using MHD_USE_EPOLL. Pushed after OK from Frank on irc and some testing in Fedora. Cheers, Mark

Re: [PATCH] debuginfod: Try without MHD_USE_DUAL_STACK if MHD_start_daemon fails

2022-05-11 Thread Mark Wielaard
Hi, On Fri, May 06, 2022 at 12:37:35AM +0200, Mark Wielaard wrote: > On a systems that have ipv6 disabled debuginfod doesn't start up > anymore because libhttpd MHD_USE_DUAL_STACK only works if it can > open an ipv6 socket. If MHD_start_daemon with MHD_USE_DUAL_STACK > fails try again without that

[PATCH] debuginfod: Always request servname from getnameinfo for conninfo.

2022-05-09 Thread Mark Wielaard
When getting the connection info getnameinfo is called getting the hostname and servname except when the sockaddr is a pure ipv6 address. In that last case only hostname is requested. Since servname is stack allocated and not initialized it might contain garbage which is then put in the log. Just a

[PATCH] debuginfod: Check all curl_easy_setopt calls

2022-05-09 Thread Mark Wielaard
curl_easy_setup can fail for various reasons. Add a curl_easy_setopt_ck macro to check all curl_easy_setopt calls and provides a human readable error message in verbose mode. Signed-off-by: Mark Wielaard --- debuginfod/ChangeLog | 5 +++ debuginfod/debuginfod-client.c | 61 +++

[PATCH] debuginfod: Check result of curl_easy_getinfo in debuginfod_write_callback

2022-05-09 Thread Mark Wielaard
This was the only place in debuginfod-client.c where we didn't check the result of curl_easy_getinfo. Just check it to make things consistent. Signed-off-by: Mark Wielaard --- debuginfod/ChangeLog | 5 + 1 file changed, 5 insertions(+) diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLo

[PATCH] debuginfod: Use MHD_USE_EPOLL for libmicrohttpd version 0.9.51 or higher

2022-05-05 Thread Mark Wielaard
Also disable MHD_USE_THREAD_PER_CONNECTION when using MHD_USE_EPOLL. https://sourceware.org/bugzilla/show_bug.cgi?id=29123 Signed-off-by: Mark Wielaard --- debuginfod/ChangeLog | 6 ++ debuginfod/debuginfod.cxx | 15 ++- 2 files changed, 16 insertions(+), 5 deletions(-) d

[PATCH] debuginfod: Try without MHD_USE_DUAL_STACK if MHD_start_daemon fails

2022-05-05 Thread Mark Wielaard
On a systems that have ipv6 disabled debuginfod doesn't start up anymore because libhttpd MHD_USE_DUAL_STACK only works if it can open an ipv6 socket. If MHD_start_daemon with MHD_USE_DUAL_STACK fails try again without that flag set. https://sourceware.org/bugzilla/show_bug.cgi?id=29122 Signed-of

[PATCH] debuginfod: ensure X-DEBUGINFOD-SIZE contains file size

2022-04-25 Thread Aaron Merey via Elfutils-devel
Hi Frank, On Fri, Apr 22, 2022 at 7:27 PM Frank Ch. Eigler wrote: > > - add_mhd_response_header (r, "X-DEBUGINFOD-SIZE", > > - to_string(fs.st_size).c_str()); > > > + rc = fstat (fd, &fs); > > + if (rc == 0) > > +add_mhd_res

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

2022-04-25 Thread Aaron Merey via Elfutils-devel
On Sun, Apr 24, 2022 at 11:05 AM Mark Wielaard wrote: > Looks good. Pleas commit. Thanks, pushed as: commit 55fee962676fbff60c6b0469305bcb077910d64f Author: Aaron Merey Date: Tue Jan 11 22:07:55 2022 -0500 debuginfod: Use the debuginfod-size response header In some cases the content

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 libdebuginfod > or TL

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 computing this header's v

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

2022-04-22 Thread Aaron Merey via Elfutils-devel
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 computing this header's value for an archived file. Aaron [1] https://sourceware.org/pipermail/elfutils-devel/2022q2/0049

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

2022-04-22 Thread Mark Wielaard
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 libdebuginfod or TLS libcurl connections. Although curl_global_init itself isn't thread-sa

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

2022-04-21 Thread Aaron Merey via Elfutils-devel
On Thu, Mar 31, 2022 at 1:44 PM Mark Wielaard wrote: > Just a question about this part: > > > + /* If Content-Length is -1, try to get the size from > > + X-Debuginfod-Size */ > > + if (dl_size == -1 && c->winning_headers != NULL) > > +{ > > +

Re: patch: debuginfod ipv4-ipv6 dual-stack

2022-04-04 Thread Frank Ch. Eigler via Elfutils-devel
Hi - > That IN6_IS_ADDR_V4MAPPED is funny. Is that actually used in practice? Yeah, actually all the time. On a dual-stack socket, an ipv4 connection gets an ipv6 peer-address that renders like :::1.2.3.4. > Too bad this cannot be merged with conninfo above. > But this calculates less inf

Re: patch: debuginfod ipv4-ipv6 dual-stack

2022-04-04 Thread Mark Wielaard
Hi Frank, On Sun, 2022-04-03 at 19:49 -0400, Frank Ch. Eigler via Elfutils-devel wrote: > commit 3a00f412b6554ba70f7b7e3d3aa6f67f278868af (HEAD -> master) > Author: Frank Ch. Eigler > Date: Sun Apr 3 19:42:48 2022 -0400 > > debuginfod: use single ipv4+ipv6 microhttpd daemon configuration >

patch: debuginfod ipv4-ipv6 dual-stack

2022-04-03 Thread Frank Ch. Eigler via Elfutils-devel
Hi - This little improvement reduces wasted memory from duplicated worker threads for ipv4 vs ipv6 stacks. commit 3a00f412b6554ba70f7b7e3d3aa6f67f278868af (HEAD -> master) Author: Frank Ch. Eigler Date: Sun Apr 3 19:42:48 2022 -0400 debuginfod: use single ipv4+ipv6 microhttpd daemon conf

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

2022-03-31 Thread Mark Wielaard
Hi Aaron, On Tue, 2022-01-11 at 22:07 -0500, Aaron Merey via Elfutils-devel wrote: > In some cases the content-length header may not be available in order > to pass to a progressfn. If content-length isn't available then attempt > to get the size of the download from the debuginfod-size header in

RFC PATCH: debuginfod client doc tweak

2022-01-31 Thread Frank Ch. Eigler via Elfutils-devel
commit c4726913b7766634cc5d8a97624e1b4708452d73 (HEAD -> master) Author: Frank Ch. Eigler Date: Mon Jan 31 18:13:40 2022 -0500 man debuginfod-client-config.7: Elaborate $DEBUGINFOD_URLS Add reference to /etc/profile.d and /etc/debuginfod/*.urls as possible source of default. (

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

2022-01-11 Thread Aaron Merey via Elfutils-devel
In some cases the content-length header may not be available in order to pass to a progressfn. If content-length isn't available then attempt to get the size of the download from the debuginfod-size header instead. It should be mentioned that if a compressed file (ex. gzip) is being transferred,

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

2021-12-15 Thread Mark Wielaard
Hi, On Thu, Dec 09, 2021 at 06:35:14AM -0500, Frank Ch. Eigler via Elfutils-devel wrote: > > x32, riscv32, arc use 64bit time_t even while they are 32bit > > architectures, therefore directly using integer printf formats will not > > work portably. > > > Use a plain long everywhere as the interv

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

2021-12-09 Thread Frank Ch. Eigler via Elfutils-devel
Hi - > x32, riscv32, arc use 64bit time_t even while they are 32bit > architectures, therefore directly using integer printf formats will not > work portably. > Use a plain long everywhere as the intervals are small enough > that it will not be problematic. lgtm! - FChE

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

2021-12-09 Thread Alexander Kanavin via Elfutils-devel
Alright, I just sent a patch that replaces time_t with long instead. I tested it on x86, x86-x32, x86-64. Alex On Wed, 8 Dec 2021 at 16:31, Mark Wielaard wrote: > Hi Alexander, > > On Sun, 2021-12-05 at 21:45 +0100, Alexander Kanavin wrote: > > I'm not sure; the point of this patch is simply to

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

2021-12-09 Thread Alexander Kanavin via Elfutils-devel
time_t is platform dependent and some of architectures e.g. x32, riscv32, arc use 64bit time_t even while they are 32bit architectures, therefore directly using integer printf formats will not work portably. Use a plain long everywhere as the intervals are small enough that it will not be problema

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

2021-12-08 Thread Frank Ch. Eigler via Elfutils-devel
Hi - > [...] > 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). Yes, ints are fine for these humane-number-of-seconds kinds of values in the cache configuration. There's no need for maximum le

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

obv patch: debuginfod concurrency fix

2021-12-08 Thread Frank Ch. Eigler via Elfutils-devel
Hi - Committing as obvious. Author: Frank Ch. Eigler Date: Wed Dec 8 10:20:58 2021 -0500 debuginfod: correct concurrency bug in fdcache metrics The intern() function called set_metrics() outside a necessary lock being held. helgrind identified this race condition. No QA imp

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

2021-12-08 Thread Mark Wielaard
Hi Alexander, On Sun, 2021-12-05 at 21:45 +0100, Alexander Kanavin wrote: > I'm not sure; the point of this patch is simply to ensure debuginfod builds > everywhere without errors. Making the types consistent is perhaps better > done as a followup? I think the issue of the code not compiling in s

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

2021-12-07 Thread Mark Wielaard
Hi Frank, On Mon, 2021-12-06 at 13:41 -0500, Frank Ch. Eigler wrote: > 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. > > This is good. Thanks, pushed. Cheers,

  1   2   3   >