[PATCH] add debuginfod_get_headers if DUMMY_LIBDEBUGINFOD is used
Pushed as obvious as I can't build elfutils: [ 70s] gcc -std=gnu99 -Wall -Wshadow -Wformat=2 -Wold-style-definition -Wstrict-prototypes -Wtrampolines -Wlogical-op -Wduplicated-cond -Wnull-dereference -Wimplicit-fallthrough=5 -Werror -Wunused -Wextra -Wstack-usage=262144 -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -ffat-lto-objects -g -Wl,-rpath-link,../libelf:../libdw:. -flto=auto -ffat-lto-objects -o debuginfod-find debuginfod-find.o ../libdw/libdw.so ../libelf/libelf.so ../lib/libeu.a ./libdebuginfod.so [ 70s] /usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: /tmp/ccedHXIy.ltrans0.ltrans.o: in function `main': [ 70s] /home/abuild/rpmbuild/BUILD/elfutils-0.187/debuginfod/debuginfod-find.c:219: undefined reference to `debuginfod_get_headers' Martin --- debuginfod/ChangeLog | 4 debuginfod/debuginfod-client.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog index bc6c11c9..77136698 100644 --- a/debuginfod/ChangeLog +++ b/debuginfod/ChangeLog @@ -1,3 +1,7 @@ +2022-09-08 Martin Liska + + * debuginfod-client.c (debuginfod_get_headers): Add to DUMMY_LIBDEBUGINFOD. + 2022-09-06 Frank Ch. Eigler * debuginfod-client.c (header_callback): Don't copy \r in x-d headers. diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c index 54dc3f2f..272a6a7a 100644 --- a/debuginfod/debuginfod-client.c +++ b/debuginfod/debuginfod-client.c @@ -63,6 +63,8 @@ void* debuginfod_get_user_data (debuginfod_client *c) { return NULL; } const char* debuginfod_get_url (debuginfod_client *c) { return NULL; } int debuginfod_add_http_header (debuginfod_client *c, const char *h) { return -ENOSYS; } +const char* debuginfod_get_headers (debuginfod_client *c) { return NULL; } + void debuginfod_end (debuginfod_client *c) { } #else /* DUMMY_LIBDEBUGINFOD */ -- 2.37.3
Re: [patch git] PR28284 - debuginfod x-debuginfod* header processing
Hi Frank, On Tue, 2022-09-06 at 12:05 -0400, Frank Ch. Eigler via Elfutils-devel wrote: > > This looks good, but I think c->winning_headers needs to be > > freed/cleared at the start of debuginfod_query_server. Otherwise if you > > reuse the debuginfod_client and you hit the cache, the user gets the > > headers from the last use of debuginfod_client that did fetch something > > from a server. Which imho is confusing (the headers won't match the > > cached result returned). > > Good point, we don't want an aborted new transfer to retain records > from a previous run, will fix that. Not just a new transfer, but also when we hit the cache before doing a new transfer. Currently when we hit the cache and don't do any transfer the winning_headers will point to the last http transfer which will have nothing to do with the returned (cached) result. Just like we clear client->url early. Thanks, Mark
Re: [patch git] PR28284 - debuginfod x-debuginfod* header processing
Hi - > > Good point, we don't want an aborted new transfer to retain records > > from a previous run, will fix that. > > Not just a new transfer, but also when we hit the cache before doing a > new transfer. Currently when we hit the cache and don't do any transfer > the winning_headers will point to the last http transfer which will > have nothing to do with the returned (cached) result. Just like we > clear client->url early. Got it, pushing this: diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c index 272a6a7a007f..5e5c140ab205 100644 --- a/debuginfod/debuginfod-client.c +++ b/debuginfod/debuginfod-client.c @@ -588,9 +588,11 @@ debuginfod_query_server (debuginfod_client *c, goto out; } - /* Clear the obsolete URL from a previous _find operation. */ + /* Clear the obsolete data from a previous _find operation. */ free (c->url); c->url = NULL; + free (c->winning_headers); + c->winning_headers = NULL; /* PR 27982: Add max size if DEBUGINFOD_MAXSIZE is set. */ long maxsize = 0; - FChE
-Werror=array-bounds
Hi! I've noticed that in 81st line of image-header.c file is suspicious: header = header_buffer - H_START; As it's written in ISO/IEC 9899:1999: - Addition or subtraction of a pointer into, or just beyond, an array object and an integer type produces a result that does not point into, or just beyond, the same array object So it's kinda like ub. It doesn't look really dangerous, but maybe on some architectures it can be crashed. Thanks, Frolov Daniil
Sourceware accepted as SFC member project
Hi, We are very grateful for the public replies and suggestions received to our proposal, which were all very positive. And we are happy to report that the SFC's Evaluations Committee has voted to accept Sourceware as a Conservancy member project. If people are interested in, or want to help out with, the next steps they are invited to join the sourceware overseers list. https://sourceware.org/pipermail/overseers/2022q3/018834.html Thanks, Chris Faylor Frank Eigler Mark Wielaard