| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Updated man pages and beginning confirming tests.
Doc file update
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Additional tracing, and use of "% make check VERBOSE=1" in a .spec
file allowed tracking down of this intermittent problem. The race was
between a SIGUSR1 or two to a debuginfod server (triggering two
traverse/scan phases), followed shortly by a SIGUSR2 (triggering a
groom). If those signals were received too close together, the groom
phase could be stopped early, and the rm'd files not noticed.
New testsuite code adds metric polls after SIGUSR1 & SIGUSR2 to ensure
the respective processing phases are complete. It also turns on "set -x"
tracing, so as to avoid pulling out quite as much hair next time.
"make check VERBOSE=1" is also important for spec files.
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
|
|
|
|
|
|
|
|
| |
It appears possible for 000-permission files to sneak into the
test debuginfod-cache, which cp (or find|cpio) refuse to copy.
These files are OK not to copy, so ignore the error and proceed.
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
|
|
|
|
| |
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
When read_addrs() was moved into file scope, there was a mistake in
converting "buffer" from a closure variable to a parameter: we are
checking whether the pointer argument is NULL, not whether the buffer
itself is NULL. This causes a NULL pointer dereference when we try
to use the NULL buffer later.
Fixes: 3bf41d458fb6 ("link_map: Pull read_addrs() into file scope")
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sometimes, due to configuration error, mishap, or DoS misadventure, a
debuginfod server may receive near-concurrent requests for the exact
same data from multiple clients. In practically all cases, it is
beneficial to the clients, as well as the server, to serialize these
requests. This way, debuginfod does not waste CPU in repeatedly &
concurrently decompressing large archives or querying upstream
servers. Second and later requesters can benefit from the fdcache /
client-cache and get their results, probably earlier!
This patch adds an "after-you" queueing phase to servicing
http-buildid requests, whereby thereads serialize themselves on each
query URL being serviced at the moment. Prometheus metrics are added,
and the http GET trace line is modified to print the queue+service
times separately.
Hand-tested on large kernel-debuginfo's, and shows host CPU refusing
to multiply in the face of concurrent identical queries. The
automated test tries a hundred concurrent curls, at least some of
which are slow enough to trigger the "after-you" wait here.
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Link failure is reproducible on gcc-11.1.0 target:
```
$ autoreconf -i -f
$ ./configure --enable-maintainer-mode --disable-debuginfod \
--host=x86_64-pc-linux-gnu \
CFLAGS=-march=znver3 \
CXXFLAGS=-march=znver3 \
LDFLAGS=" "
$ make
CCLD elflint
ld: elflint.o: in function `check_attributes':
elflint.c:(.text+0xdcff): undefined reference to `buffer_left'
ld: elflint.c:(.text+0xe557): undefined reference to `buffer_left'
```
It happens due to possible external linkage of `buffer_left()`.
The change forces local linkage to always use local definition
(either inline or out-of-line).
Reported-by: Toralf Förster
Bug: https://bugs.gentoo.org/794601
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Fixes: e95d1fbb ("elflint: Pull left() in file scope")
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
|
|
|
|
|
|
|
|
| |
Set version to 0.185
Update NEWS and elfutils.spec.in
Regenerate po/*.po files
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR27701 implemented curl handle reuse in debuginfod_client objects,
but with an unexpected bug. Server responses returning an error
"latched" because the curl_easy handles for error cases weren't all
systematically removed from the curl multi handle. This prevented
their proper re-addition the next time.
This version of the code simplfies matters by making only the curl
curl_multi handle long-lived. This turns out to be enough, because it
can maintain a pool of long-lived http/https connections and related
data, and lend them out to short-lived curl_easy handles. This mode
handles errors or hung downloads even better, because the easy handles
don't undergo complex state transitions between reuse.
A new test case confirms this correction via the federating debuginfod
instance (cleaning caches between subtests to make sure http* is being
used and reused).
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
|
|
|
|
|
|
|
|
| |
Exit status of 255 in case of an error is probably not what elfcompress
users expect, change it to 1.
Reported-by: Vitaly Chikunov <vt@altlinux.org>
Fixes: 92acb57eb046 ("elfcompress: New utility.")
|
|
|
|
|
|
|
|
|
| |
At the point of "Nothing to do" fnew variable has not been assigned
after initialization, so it does not have to be reset to NULL.
Note that any reset of fnew to NULL has to preceded with free(fnew).
Fixes: ed62996defc6 ("elfcompress: Don't rewrite file if no section data needs to be updated.")
|
|
|
|
|
|
|
|
|
| |
When elfcompress decides that no section data needs to be updated and
therefore the file does not have to be rewritten, it still has to exit
with a zero status indicating success.
Resolves: https://sourceware.org/bugzilla/show_bug.cgi?id=27856
Fixes: c497478390de ("elfcompress: Replace cleanup() with label")
|
|
|
|
|
|
|
| |
New function in system.h that returns true if a string has a given
prefix, false otherwise. Use it in place of strncmp.
Signed-off-by: Martin Liška <mliska@suse.cz>
|
|
|
|
|
|
| |
On Fedora rawhide, we can no longer just assume ps(1) is there.
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
|
|
|
|
|
|
|
|
| |
Set version to 0.184
Update NEWS and elfutils.spec.in
Regenerate po/*.po files
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
| |
Update the documentation in __libdw_form_val_compute_len for handling
DW_FORM_indirect and make sure the indirect form isn't DW_FORM_indirect
itself or DW_FORM_implicit_const.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add debuginfod_config_cache for reading and writing to cache
configuration files, make use of the function within
debuginfod_clean_cache and debuginfod_query_server.
In debuginfod_query_server, create 000-permission file on failed
queries. Before querying each BUILDID, if corresponding 000 file
detected, compare its stat mtime with parameter from
.cache/cache_miss_s. If mtime is fresher, then return ENOENT and
exit; otherwise unlink the 000 file and proceed to a new query.
tests: add test in run-debuginfod-find.sh
test if the 000 file is created on failed query; if querying the
same failed BUILDID, whether the query should proceed without
going through server; set the cache_miss_s to 0 and query the same
buildid, and this time should go through the server.
Signed-off-by: Alice Zhang <alizhang@redhat.com>
|
|
|
|
|
|
| |
Files in the download cache should be read-only.
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
|
|
|
|
|
|
|
|
|
| |
With PR25365, we accidentally lost the ability to rmdir client-cache
directories corresponding to buildids. Bring this back, with some
attention to a possible race between a client doing cleanup and
another client doing lookups at the same time.
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Whenever we encounter an attribute with DW_FORM_indirect, we need to
read its true form from the DIE data. Then, we can continue normally.
This adds support to the most obvious places: __libdw_find_attr() and
dwarf_getattrs(). There may be more places that need to be updated.
I encountered this when inspecting a file that was processed by our BOLT
tool: https://github.com/facebookincubator/BOLT. This also adds a couple
of test cases using a file generated by that tool.
Signed-off-by: Omar Sandoval <osandov@fb.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Client objects now carry long-lived curl handles for outgoing
connections. This makes it more efficient for multiple sequential
queries, because the TCP connections and/or TLS state info are kept
around awhile, avoiding O(100ms) setup latencies. debuginfod is
adjusted to take advantage of this for federation. Other clients
should gradually do this too, perhaps including elfutils itself (in
the libdwfl->debuginfod_client hooks).
A large gdb session with 117 debuginfo downloads was observed to run
twice as fast (45s vs. 1m30s wall-clock time), just in nuking this
extra setup latency. This was tested via a debuginfod intermediary:
it should be even faster once gdb reuses its own debuginfod_client.
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Recognize sgettext as a macro which is used for translations.
Flag _, N_, and sgettext with pass-c-format. The effect of this
specification is that xgettext will propagate format string
requirements for _, N_, and sgettext calls to their first arguments,
and thus mark them as format strings.
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
|
|
|
|
|
|
|
|
|
| |
On very large servers, each database-stat counting pass can take tens
of minutes (!), and doing it twice per groom pass does not seriously
improve data quality. Just do it once, after stale data removal &
basic sqlite vacuum.
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
|
|
|
|
|
|
|
| |
Borrow logic from elfclassify for is_debug_only() for our own
debuginfo identification.
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
|
|
|
|
|
|
|
| |
If dwfl_begin fails we won't use the dwfl_fd descriptor we just dupped.
Make sure to close on dwfl_begin failure to avoid the leak.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
| |
eu-unstrip might leak a string for each module found when using the -d
option. Make sure to free the output_file name when we are done with the
module.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
| |
newfd is normally created by mkstemp given the original fd exists.
Otherwise it will created by open from arfname. In the second case
newfd might not get closed. Preventd this by always trying to close
it after errout.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
| |
One place in the description referred to the parameter for
.deb/.ddeb files as "-D" as opposed to the correct "-U".
Signed-off-by: Andreas Ziegler <andreas.ziegler@fau.de>
|
|
|
|
|
|
|
|
|
| |
In order to assist problem diagnosis / monitoring, use this
gnu-flavoured pthread function to set purpose names to the various
child threads debuginfod starts. libmicrohttpd already sets this for
its threads.
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Clang warns about this:
../../debuginfod/debuginfod-client.c:899:28: error: implicit conversion from 'long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Werror,-Wimplicit-int-float-conversion]
pa = (dl > LONG_MAX ? LONG_MAX : (long)dl);
~ ^~~~~~~~
/usr/lib64/clang/10.0.1/include/limits.h:47:19: note: expanded from macro 'LONG_MAX'
^~~~~~~~~~~~
<built-in>:38:22: note: expanded from here
^~~~~~~~~~~~~~~~~~~~
Modified for jakub's observation about LONG_MAX overflow.
Signed-off-by: Timm Bäder <tbaeder@redhat.com>
|
|
|
|
|
|
| |
https://sourceware.org/bugzilla/show_bug.cgi?id=27450
Signed-off-by: Piotr Drąg <piotrdrag@gmail.com>
|
|
|
|
|
|
| |
https://sourceware.org/bugzilla/show_bug.cgi?id=27450
Signed-off-by: Piotr Drąg <piotrdrag@gmail.com>
|
|
|
|
|
|
|
| |
Clang does not support this warning, so check for compiler support
before using it.
Signed-off-by: Timm Bäder <tbaeder@redhat.com>
|
|
|
|
|
|
|
| |
Clang does not support -Wtrampolines, so check if the compiler supports
it before using it.
Signed-off-by: Timm Bäder <tbaeder@redhat.com>
|
|
|
|
|
|
| |
CURLINFO_CURLINFO_CONTENT_LENGTH_DOWNLOAD_T is one CURLINFO_ too much.
Signed-off-by: Timm Bäder <tbaeder@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
We are going through vna_next, vn_next and vd_next in a while loop.
Make sure that all offsets are sane. We don't want things to wrap
around so we go in cycles.
https://sourceware.org/bugzilla/show_bug.cgi?id=27501
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
| |
This unifies the error handling with the rest of the code base and gets
rid of a nested function.
Signed-off-by: Timm Bäder <tbaeder@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
GCC accepts the =5, which means it doesn't try to parse any comments
and only accepts the fallthrough attribute in code. Clang does not ever
parse any comments and always wants the fallthrough attribute anyway.
Clang also doesn't accept the =n parameter for -Wimplicit-fallthrough.
Test for =5 separately and use it if supported and fall back to just
-Wimplicit-fallthrough otherwise.
Signed-off-by: Timm Bäder <tbaeder@redhat.com>
|
|
|
|
|
|
| |
Get rid of a nested function this way.
Signed-off-by: Timm Bäder <tbaeder@redhat.com>
|
|
|
|
|
|
| |
Get rid of a nested function this way.
Signed-off-by: Timm Bäder <tbaeder@redhat.com>
|
|
|
|
|
|
| |
Get rid of a nested function this way.
Signed-off-by: Timm Bäder <tbaeder@redhat.com>
|
|
|
|
|
|
| |
Get rid of a nested function this way.
Signed-off-by: Timm Bäder <tbaeder@redhat.com>
|
|
|
|
|
|
| |
Get rid of a nested function this way.
Signed-off-by: Timm Bäder <tbaeder@redhat.com>
|
|
|
|
|
|
|
| |
This is a simple one-liner, so inline this into the few callers.
Get rid of a nested function this way.
Signed-off-by: Timm Bäder <tbaeder@redhat.com>
|
|
|
|
|
|
| |
Get rid of a nested function this way.
Signed-off-by: Timm Bäder <tbaeder@redhat.com>
|
|
|
|
|
|
| |
Get rid of an unnecessary nested function this way.
Signed-off-by: Timm Bäder <tbaeder@redhat.com>
|
|
|
|
|
|
| |
Get rid of a nested function this way.
Signed-off-by: Timm Bäder <tbaeder@redhat.com>
|
|
|
|
|
|
| |
Get rid of a nested function this way.
Signed-off-by: Timm Bäder <tbaeder@redhat.com>
|
|
|
|
|
|
| |
And rename it to buffer_left() to be a bit more descriptive
Signed-off-by: Timm Bäder <tbaeder@redhat.com>
|
|
|
|
|
|
|
| |
Rename it to buffer_pos() to be a bit more descriptive and get rid of a
nested function this way.
Signed-off-by: Timm Bäder <tbaeder@redhat.com>
|