summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* lsb_release -sir on debian produces separate linesupstream/fche/coprFrank Ch. Eigler2020-01-071-1/+1
|
* spec: correct debuginfod-client dependencyFrank Ch. Eigler2020-01-061-1/+1
|
* elfutils.spec: buildrequire lsb_releaseFrank Ch. Eigler2020-01-061-0/+1
|
* elfutils.spec: make without -sFrank Ch. Eigler2020-01-061-2/+2
|
* debuginfod useragent: header generation tweak 2Frank Ch. Eigler2020-01-061-1/+2
|
* debuginfod useragent: header generation tweakFrank Ch. Eigler2020-01-061-1/+1
|
* snapFrank Ch. Eigler2020-01-061-1/+1
|
* debuginfod: pass a distro-summary User-Agent request headerFrank Ch. Eigler2020-01-065-5/+32
| | | | | | | | | It may be useful for a debuginfod server operator to know what kinds of clients make webapi requests. This is mainly as a telemetry/diagnostic (though the data cannot be really trusted). It may also be useful to automate downloading of distro packages to a debuginfod server in the case of an unknown hex buildid. doc/testing not affected as these are diagnostics.
* snapFrank Ch. Eigler2020-01-011-1/+0
|
* datesnapFrank Ch. Eigler2020-01-011-1/+1
|
* debuginfod: extracted-from-archive file cacheFrank Ch. Eigler2020-01-018-11/+267
| | | | | | | | | Add a facility to service webapi and dwz/altdebug requests that resolve to archives via a $TMPDIR file cache. This permits instantaneous dwz resolution during -debuginfo rpm scanning, and also instantanous duplicate webapi requests. The cache is limited both in number of entries and in storage space. Heuristics provide serviceable defaults.
* debuginfod: rework threading model for file/archive scanningFrank Ch. Eigler2020-01-016-559/+548
| | | | | | | | | | We switch from a thread per supplied PATH, with a semaphore based concurrency control, to a fixed number of worker threads collecting the result of a plain directory traversal being put into a work queue. This allows maximal continuous concurrency, even if the PATH directories are dramatically differently sized. There is no more need to use concurrency-motivated subdirectory wildcards for PATH entries: just a single top level directory will work fast. doc & tests incl.
* copr suse compatibilityFrank Ch. Eigler2020-01-011-1/+2
|
* elfutils.spec: make with V=1 / check with VERBOSE=1Frank Ch. Eigler2020-01-011-2/+2
| | | | also, don't insist on %check success
* debuginfod server: support .deb/.ddeb archivesFrank Ch. Eigler2019-12-2214-132/+257
| | | | | | | | | Add support for scanning .deb / .ddeb files, enabled with a new command line option "-U". Using a synthetic .deb/.ddeb from a Ubuntu 18 machine, extend the debuginfod testsuite with some .deb processing, if the dpkg-deb binary is installed. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* debuginfod: usability tweaks, incl. $DEBUGINFOD_PROGRESS client supportFrank Ch. Eigler2019-12-198-40/+117
| | | | | | | | | | This facility allows a default progress-printing function to be installed if the given environment variable is set. Some larger usage experience (systemtap fetching kernels) indicates the default timeout is too short, so forked it into a connection timeout (default short) and a transfer timeout (default unlimited). Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* libdwfl: remove broken coalescing logic in dwfl_report_segmentOmar Sandoval2019-12-188-45/+118
| | | | | | | | | | | | dwfl_report_segment has some logic that detects when a segment is contiguous with the previously reported segment, in which case it's supposed to coalesce them. However, in this case, it actually returns without updating the segment array at all. As far as I can tell, this has always been broken. It appears that no one uses the coalescing logic anyways, as they pass IDENT as NULL. Let's just get rid of the logic and add a test case. Signed-off-by: Omar Sandoval <osandov@fb.com>
* libcpu: Compile i386_lex.c with -Wno-implicit-fallthroughOmar Sandoval2019-12-122-1/+6
| | | | | | | | elfutils is compiled with -Wimplicit-fallthrough=5, so the fallthrough comment in i386_lex.c (generated by flex) doesn't prevent the implicit fallthrough warning. Add -Wno-implicit-fallthrough to i386_lex_CFLAGS. Signed-off-by: Omar Sandoval <osandov@fb.com>
* configure: Fix -D_FORTIFY_SOURCE=2 check when CFLAGS contains -Wno-errorOmar Sandoval2019-12-122-1/+6
| | | | | | | | | | | | | | If CFLAGS contains -Wno-error, then the check for -D_FORTIFY_SOURCE=2 won't fail when appropriate. E.g., compiling with: ./configure CFLAGS='-Wno-error -O0' && Results in a flood of "_FORTIFY_SOURCE requires compiling with optimization (-O)" warnings. Make sure we add -Werror after the user-defined CFLAGS. Signed-off-by: Omar Sandoval <osandov@fb.com>
* debuginfod: Check the DEBUGINFOD_URLS environment variable early in client.Mark Wielaard2019-12-112-9/+16
| | | | | | | | | | | | | | | | | | If the debuginfod-client isn't configured we should do as little as possible. Simply return early with ENOSYS if no servers are configured. This means we won't check This does change the behavior of the debuginfod_find calls slightly. Previously we would setup and check the cache if the given build-id was valid. Which might have provided a result if an earlier client had run with the same cache and valid server URLs which knew about that particular build-id. Now we don't return any cached results unless at least one server is configured. This prevents selinux errors when the library is used in a confined setup. Signed-off-by: Mark Wielaard <mark@klomp.org>
* Make sure to always build with build-ids.Mark Wielaard2019-12-114-2/+19
| | | | | | | | We really need build-ids for various things. If the system compiler doesn't generate build-ids warn and generate them anyway for both the binaries and the tests. Signed-off-by: Mark Wielaard <mark@klomp.org>
* tests: Run strip under testrun in run-debuginfod-find.shMark Wielaard2019-12-112-1/+5
| | | | | | | Otherwise strip might run against the system libelf which might be too old or missing. Signed-off-by: Mark Wielaard <mark@klomp.org>
* tests: Add break to avoid implicit-fallthrough warningMark Wielaard2019-12-112-0/+5
| | | | | | | | For some reason gcc might fail to recognize the assert (0) will never return and emit an implicit-fallthrough warning. Just add a break to silence it. Signed-off-by: Mark Wielaard <mark@klomp.org>
* config: Update elfutils.spec with explicit sub-package requires.Mark Wielaard2019-12-112-9/+15
| | | | | | | | | | | | Consistently require version-release subpackages so that everything is updated together. Technically this isn't always required (it is for elfutils-libelf and elfutils-libs). But this makes things more consistent and prevents multilib version mismatches. Also update a Summary and description to match the current Fedora text. Signed-off-by: Mark Wielaard <mark@klomp.org>
* tests: Run elfcompress under testrun in run-elfclassify.shMark Wielaard2019-12-112-2/+6
| | | | | | | Otherwise elfcompress might run against the system libelf which might be too old or missing. Signed-off-by: Mark Wielaard <mark@klomp.org>
* debuginfod: Fix implicit conversion from 'CURLcode' to 'CURLMcode'Mark Wielaard2019-12-092-5/+9
| | | | | | | | | | | | | | GCC10 warns when converting the value of one enum type into another: debuginfod-client.c:530:24: error: implicit conversion from ‘CURLcode’ to ‘CURLMcode’ [-Werror=enum-conversion] 530 | curl_res = curl_easy_getinfo(target_handle, | ^ libcurl has different error code enums. The "easy" interfaces return a CURLcode error. The "multi" interface functions return a CURLMcode. Signed-off-by: Mark Wielaard <mark@klomp.org>
* libdwfl: Find and handle compressed vmlinuz image.Mark Wielaard2019-12-092-0/+28
| | | | | | | | | | | | | | | | | Both the dwfl_linux_kernel_find_elf callback and the dwfl_linux_kernel_report_offline reporting function only handled vmlinix images possibly compressed with .gz, .bz2 or .xz extension. They did not find or handle the much more common vmlinuz compressed images. It is not completely clear why we didn't up to now. Support for compressed ELF files was added in 2009 and the code was updated to to try to find the .gz, .bz2 or .xz extension variants in 2011. But not the vmlinuz named variant. Reported-by: Aaron Merey <amerey@redhat.com> Tested-by: Frank Ch. Eigler <fche@redhat.com> Signed-off-by: Mark Wielaard <mark@klomp.org>
* config: Add an explicit Requires elfutils-debuginfod-client for debuginfod.Mark Wielaard2019-11-282-0/+6
| | | | | | | | elfutils-debuginfod depends indirectly already on the client library. Make that explicit so they are always updated in sync. Which isn't technically required, but makes things clearer and simpler on updates. Signed-off-by: Mark Wielaard <mark@klomp.org>
* config: versioned libdebuginfod libraries should not be in -devel package.Mark Wielaard2019-11-272-1/+7
| | | | | | | | | The versioned library (links) should be in the runtime package. The debuginfod-client-devel package should just contain the .so (symlink). This isn't fatal, just sloppy. ldconfig will correct the missing symlinks when it was missing. Signed-off-by: Mark Wielaard <mark@klomp.org>
* elfutils.spec.in: Sync with fedora spec, remove rhel/fedora specifics.elfutils-0.178Mark Wielaard2019-11-262-70/+84
| | | | | | | | | | | | | | This makes the sample elfutils.spec file more like the fedora elfutils.spec but with all fedora and rhel specifics removed. In particular it introduces a new elfutils-libs subpackage and updates the requires accordingly. Other cleanups are removal of Group tags, remove dot at end of Summary tags, add post/postun ldconfig for elfutils-libs and elfutils debuginfod-client subpackages, remove default defattr(-,root,root) for file lists and order binaries by name. Signed-off-by: Mark Wielaard <mark@klomp.org>
* Prepare for 0.178Mark Wielaard2019-11-2610-2436/+2582
| | | | | | | | Set version to 0.178. Update NEWS and elfutils.spec.in. Regenerate po/*.po files. Signed-off-by: Mark Wielaard <mark@klomp.org>
* Fix BUILD_STATIC build and enable gcov for debuginfod.Mark Wielaard2019-11-269-6/+26
| | | | | | | | libdw now always needs -lpthread and -ld even when BUILD_STATIC. BUILD_STATIC is only used when doing a gcov enabled build. Enable gcov coverage also for debuginfod. Signed-off-by: Mark Wielaard <mark@klomp.org>
* elfutils.spec: Add BuildRequires: curlMark Wielaard2019-11-252-0/+5
| | | | | | The run-debuginfod-find.sh now relies on curl to fetch the metrics. Signed-off-by: Mark Wielaard <mark@klomp.org>
* debuginfod: Tweak groom cycle for memory freeingFrank Ch. Eigler2019-11-252-0/+7
| | | | | | | Use the sqlite3_db_release_memory() call periodically. It should have no effect except hopefully smaller server memory usage. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* tests: Don't sleep in run-debuginfod-find.sh, but wait till ready.Mark Wielaard2019-11-254-26/+94
| | | | | | | | Wait for the debuginfod server to finish and use the metrics to see when a server is ready for the next test instead of sleeping. Also remove DEBUGINFOD_TEST_WEBAPI_SLEEP. Signed-off-by: Mark Wielaard <mark@klomp.org>
* debuginfod: Add found_{executable,debuginfo,sourcerefs}_total metrics.Mark Wielaard2019-11-242-0/+32
| | | | | | | Keeps metrics of how many executables, debuginfo and sourcerefs were found in total for file and rpm scanners. Signed-off-by: Mark Wielaard <mark@klomp.org>
* tests: Use 127.0.0.1 in run-debuginfod-find.sh instead of localhost.Mark Wielaard2019-11-232-10/+14
| | | | | | | | The way curl does hostname lookups in multi_curl mode takes a very long time under valgrind. Replace all localhosti hostnames with 127.0.0.1 so no lookups are necessary. Signed-off-by: Mark Wielaard <mark@klomp.org>
* debuginfod: add client contextMark Wielaard2019-11-2314-110/+317
| | | | | | | | | | Add a mandatory debuginfod_begin()/_end() call pair to manage a client object that represents persistent but non-global state. From libdwfl, dlopen the debuginfod.so client library early on. This hopefully makes sure that the code (and the libcurl.so dependency) is loaded before the program goes into multi-threaded mode. Signed-off-by: Mark Wielaard <mark@klomp.org>
* debuginfod 5: add /metrics endpointFrank Ch. Eigler2019-11-235-58/+214
| | | | | | | | This webapi extensions allows admins to hook up debuginfod to a prometheus-compatible monitoring system for general situational statistics. The metrics are simple enough that local curl requests can give a user a sense of what's going on. The metrics are documented as unstable with respect to future versions.
* debuginfod 4: symbolic link traversal modeFrank Ch. Eigler2019-11-225-12/+50
| | | | | | In order to support file/rpm archives that are organized via symlink trees, add an "-L" option to debuginfod, meaning about the same as for find(1) or ls(1): to traverse rather than ignore symlinks.
* debuginfod 3/3: client interruptabilityFrank Ch. Eigler2019-11-2212-148/+326
| | | | | | | | For interactive clients such as gdb, interruptibility is important for usability during longer downloads. This patchset adds a download-progress callback function to the debuginfod client library, with which a caller app can interrupt a download as well as be notified of its quantitative progress.
* debuginfod 2/2: server sideFrank Ch. Eigler2019-11-2231-27/+3446
| | | | | | | | | | Add the server to the debuginfod/ subdirectory. This is a highly multithreaded c++11 program (still buildable on rhel7's gcc 4.8, which is only partly c++11 compliant). Includes an initial suite of tests, man pages, and a sample systemd service. Signed-off-by: Frank Ch. Eigler <fche@redhat.com> Signed-off-by: Aaron Merey <amerey@redhat.com>
* debuginfod 1/2: client sideAaron Merey2019-11-2226-11/+2048
| | | | | | | | | | | | Introduce the debuginfod/ subdirectory, containing the client for a new debuginfo-over-http service, in shared-library and command-line forms. Two functions in libdwfl make calls into the client library to fetch elf/dwarf files by buildid, as a fallback. Instead of normal dynamic linking (thus pulling in a variety of curl dependencies), the libdwfl hooks use dlopen/dlsym. Server & tests coming in patch 2. Signed-off-by: Aaron Merey <amerey@redhat.com> Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* run-large-elf-file.sh: skip if free memory information is not availableAndreas Schwab2019-11-142-2/+7
|
* dwelf_elf_e_machine_string: Clear errno before calling strtolAndreas Schwab2019-11-142-0/+6
| | | | | | | Avoid spurious failure if errno is modified by any other library call in the test. Signed-off-by: Andreas Schwab <schwab@suse.de>
* libdw: Introduce libdw_unalloc to stop Dwarf_Abbrev leaks.Mark Wielaard2019-11-124-1/+43
| | | | | | | | | In the case of reading an invalid abbrev or when reading an abbrev concurrently the Dwarf_Abbrev just created might leak because it isn't needed after all. Introduce libdw_unalloc and libdw_typed_unalloc to unallocate such Dwarf_Abbrevs so they don't leak. Signed-off-by: Mark Wielaard <mark@klomp.org>
* libdw: Rewrite the memory handler to be more robust.Jonathon Anderson2019-11-085-53/+122
| | | | | | | | Pthread's thread-local variables are highly limited, which makes it difficult to use many Dwarfs. This replaces that with a less efficient (or elegant) but more robust method. Signed-off-by: Jonathon Anderson <jma14@rice.edu>
* Add configure options for Valgrind annotations.Jonathon Anderson2019-11-082-0/+35
| | | | Signed-off-by: Jonathon Anderson <jma14@rice.edu>
* libdw: Add and use a concurrent version of the dynamic-size hash table.Srđan Milaković2019-11-0812-11/+632
| | | | | Signed-off-by: Srđan Milaković <sm108@rice.edu> Signed-off-by: Mark Wielaard <mark@klomp.org>
* libdw: Don't free uninitialized Dwarf_Abbrev_Hash's of "fake" CUs.Jonathon Anderson2019-11-023-12/+35
| | | | | | | | | | | fake_{loc,loclists,addr}_cu are Dwarf_CUs that are created separate from all the others, so their contents are minimal and mostly initialized by a calloc. On dwarf_end however, they are freed through the same code path as all the others, so they call DAH_free like all the others. This changes that so that these three are exempt from DAH and split-DWARF matters, and swaps the calloc for a malloc so Memcheck will catch any others. Signed-off-by: Jonathon Anderson <jma14@rice.edu>