summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* PR25367: improve debuginfod webapi loggingfche/pr25367Frank Ch. Eigler2020-03-244-11/+72
| | | | | | | Improve debuginfod logging to show webapi query results including http status, sizes, and processing times. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* debuginfod-client thinko: non-default progressfn extra outputFrank Ch. Eigler2020-03-242-34/+42
| | | | | | | | A previous commit changed the default_progressfn output format to \rFOOBAR, to be terminated by an \n when the download finished. The \n terminator was conditional on the wrong thing (env var setting, rather than actual progressfn setting), so the \n could be printed even if an app overrode the default.
* debuginfod-find: Correct error check for -v source comboFrank Ch. Eigler2020-03-242-2/+7
| | | | | | | Hardcoding argv[2] is wrong in presence of -v option. Code immediately following did the correct argv[] indexing already. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* tests: Fix getphdrnum and run-lfs-symbols.sh testcase.Mark Wielaard2020-03-233-12/+23
| | | | | | | | | | | getphdrnum.c didn't include config.h which is why run-lfs-symbols.sh flagged it for containing bad (non-lfs) symbols. run-lfs-symbols.sh was still checking the libebl modules, which we don't create anymore. But it didn't fail the test for non-existing tests. Add some extra logging and explicitly check files exist. Signed-off-by: Mark Wielaard <mark@klomp.org>
* tests: Add testcase for elf_getphdrnum with more than 65535 entries.Mark Wielaard2020-03-235-3/+201
| | | | | Signed-off-by: Mark Wielaard <mark@klomp.org> Signed-off-by: Omar Sandoval <osandov@fb.com>
* libelf: handle PN_XNUM in elf_getphdrnum before shdr 0 is cachedOmar Sandoval2020-03-232-6/+19
| | | | | | | | | | | __elf_getphdrnum_rdlock() handles PN_XNUM by getting sh_info from elf->state.elf{32,64}.scns.data[0].shdr.e{32,64}. However, that is only a cache that may or may not have been populated by elf_begin() or elf{32,64}_getshdr(); if it hasn't been cached yet, elf_getphdrnum() returns 65535 (the value of PN_XNUM) instead. We should explicitly get the shdr if it isn't cached. Signed-off-by: Omar Sandoval <osandov@fb.com>
* debuginfod client API: add get_url functionFrank Ch. Eigler2020-03-2211-11/+107
| | | | | | | This function lets a client know, during or after a progressfn callback, what the url of the winning outgoing download is/was. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* debuginfod client API: add get/set user_data functionsFrank Ch. Eigler2020-03-2210-9/+82
| | | | | | | | Add a pair of functions to associate a void* parameter with a client object. Requested by GDB team as a way to pass file names and such user-interface data through to a progressfn callback. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* libelf: {de,}compress: ensure zlib resource cleanupMatthias Maennich2020-03-202-6/+11
| | | | | | | | | | | | | | | __libelf_decompress would only cleanup zlib resources via inflateEnd() in case inflating was successful, but would leak memory if not. Fix this by calling inflateEnd() unconditionally. __libelf_decompress did this all the time already, but called deflateEnd() twice. That is not a (known) issue, but can be cleaned up by ensuring all error paths use 'return deflate_cleanup' and the success path calls deflateEnd() only once. Note, the deflate() needs to return Z_STREAM_END to indicate we are done. Hence change the condition. Fixes: 272018bba1f2 ("libelf: Add elf_compress and elf_compress_gnu.") Signed-off-by: Matthias Maennich <maennich@google.com>
* debuginfod-client: Update cache_path when the new default path existsAaron Merey2020-03-043-9/+19
| | | | | | | | | Update cache_path with the path of the new default directory when this directory already exists. Previously cache_path was updated only when creating the new default directory and would otherwise be set to the old default path. Signed-off-by: Aaron Merey <amerey@redhat.com>
* config: Remove rpm, add dpkg as Requires for debuginfod package in spec.Mark Wielaard2020-03-042-2/+8
| | | | | | | | | We no longer require rpm2cpio to unpack rpms. We do now require dpkg-deb to unpack debs. https://sourceware.org/bugzilla/show_bug.cgi?id=25583 Signed-off-by: Mark Wielaard <mark@klomp.org>
* debuginfod-client: default to XDG cache.Aaron Merey2020-02-286-32/+156
| | | | | | | | | | | | PR25502: debuginfod client should default to XDG cache Location of client cache now defaults to $XDG_CACHE_HOME/debuginfod_client. If XDG_CACHE_HOME is not set then fallback to $HOME/.cache/debuginfod_client. Also maintain backwards compatibility with the previous default path- if $HOME/.debuginfod_client_cache exists, use that instead of the new defaults. Signed-off-by: Aaron Merey <amerey@redhat.com>
* debuginfod: file:// URLs: handle curl resp. codeKonrad Kleine2020-02-264-13/+53
| | | | | | | | | | | | | | When file:// is used for DEBUGINFOD_URLS, then the response code for a successful server query is 0 and not 200. Using file:// can be helpful when you want to test your debuginfod-client integration against a mocked file tree that mimics the HTTP URLs from the debuginfod server. This way you don't have to run the debuginfod server at all. Fixes https://sourceware.org/bugzilla/show_bug.cgi?id=25600 Signed-off-by: Konrad Kleine <kkleine@redhat.com>
* debuginfod PR25583: map -R to -Z.rpmFrank Ch. Eigler2020-02-254-2/+11
| | | | | | | | | | It was reported that libarchive (bsdtar) at least as far back as rhel7 (3.1.2) can natively process RPM files, so there's no need to mediate those accesses through rpm2cpio. There's no noteworthy performance or testing impact. Signed-off-by: Frank Ch. Eigler <fche@redhat.com> Signed-off-by: Mark Wielaard <mark@klomp.org>
* PR25375: fdcache prefetching to reduce repeated archive decompressionFrank Ch. Eigler2020-02-254-30/+113
| | | | | | | Introduce new option --fdcache-prefetch to accelerate repeated queries from the same debuginfo archive. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* tests: Explicitly unset DEBUGINFOD_URLS.Mark Wielaard2020-02-212-0/+7
| | | | | | | | | | If DEBUGINFOD_URLS is set various tests will try to query the debuginfod server which can stall the tests a bit. If other evironment variables like DEBUGINFOD_PROGRESS are set it will make various tests fail because the expected output doesn't match. Tests should PASS without needing a debuginfod server, unless they test (and set) one themselves. Signed-off-by: Mark Wielaard <mark@klomp.org>
* PR25365: debuginfod-client: restrict cleanup to client-pattern filesAaron Merey2020-02-194-1/+34
| | | | | | | | Avoid deleting general files and directories in case a user mis-sets $DEBUGINFOD_CACHE_PATH or accidentally moves a file into the cache. Signed-off-by: Aaron Merey <amerey@redhat.com>
* readelf, elflint: Handle PT_GNU_PROPERTY.Mark Wielaard2020-02-189-3/+169
| | | | | | | | | binutils 2.32 ld emits a new PT_GNU_PROPERTY segment that overlaps with the PT_NOTE segment covering the .note.gnu.property section data. https://sourceware.org/bugzilla/show_bug.cgi?id=25511 Signed-off-by: Mark Wielaard <mark@klomp.org>
* elflint: Check sh_info for symtab isn't too big.Mark Wielaard2020-02-182-0/+8
| | | | | | | | The sh_info field of the symtab says how many symbols are in the section. Make sure at least that many symbols fit in the section. Reported-by: Ulrich Drepper <drepper@redhat.com> Signed-off-by: Mark Wielaard <mark@klomp.org>
* debuginfod/doc: Fix typo debuginfo_progressfn_t -> debuginfod_progressfn_tKonrad Kleine2020-02-121-3/+3
| | | | | | | I've copied the type name for the progress function from the manual and noticed that it didn't compile... Signed-off-by: Konrad Kleine <kkleine@redhat.com>
* debuginfod testing: SIGUSR2 vs "groom" metric synchFrank Ch. Eigler2020-02-101-1/+2
| | | | | | | | | Previous code did not account for a groom job that was already completed at startup, so the SIGUSR2-triggered one may not have completed in time for the test. The shell won the race condition on most buildbot VMs, but a debian builder showed the error of our ways. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* debuginfod: testsuite for general archive (arch-linux) supportFrank Ch. Eigler2020-02-103-6/+25
| | | | | | Tested analogously to how RPMs are. Signed-Off-By: Frank Ch. Eigler <fche@redhat.com>
* debuginfod arch-linux test binariesEli Schwartz2020-02-105-0/+44
| | | | Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
* debuginfod: archive processing: handle -Z EXT=cat with direct fopenMark Wielaard2020-02-101-10/+37
| | | | Signed-off-by: Mark Wielaard <mark@klomp.org>
* debuginfod: generalized archive supportFrank Ch. Eigler2020-02-104-25/+81
| | | | | | | | | Add a '-Z EXT[=CMD]' option to debuginfod, which lets it scan any given extension and run CMD on it to unwrap distro archives. For example, for arch-linux pacman files, -Z '.tar.zst=zstdcat' lets debuginfod grok debug and source content in split-debuginfo files. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* debuginfod.h: fix typo in comment: legnth -> lengthKonrad Kleine2020-02-101-1/+1
| | | | Signed-off-by: Konrad Kleine <kkleine@redhat.com>
* libdwfl: Fix some GCC10 -Wnull-dereference issues.Mark Wielaard2020-02-062-3/+16
| | | | | | | | | GCC10 on some arches will warn about possible NULL derefences. In the libdwfl linux-kernel-modules.c cases it might be caught already by earlier calls to get_release (). But it is hard to see that will really always happen. So do an explicit NULL check just in case. Signed-off-by: Mark Wielaard <mark@klomp.org>
* ChangeLog catchup for two recent commitsFrank Ch. Eigler2020-02-032-0/+8
| | | | Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* debuginfod test: assert curl & rpm2cpio during test prologueFrank Ch. Eigler2020-02-031-9/+10
| | | | | | | | On debian & ubuntu hosts, rpm2cpio is not available by default, and heck, curl might not be either. Check for both these programs during tests/run-debuginfod-find.sh startup, else exit-77 (skip). Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* PR24393: debuginfod configury: tolerate CXX= configure invocationsFrank Ch. Eigler2020-02-031-4/+4
| | | | | | | | | Previous code was fragile with respect to this case and needlessly tolerant with non-c++11 compilers. New configury makes more muscular assertion about this, to catch bad $CXX settings or poor language support. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* debuginfod: diagnostics verbosity tweakFrank Ch. Eigler2020-01-222-1/+7
| | | | | | | marxin reported "skipping hat= .... empty comp_dir" messages were too chatty for the journnal. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* empty commit for irker testFrank Ch. Eigler2020-01-220-0/+0
|
* PR25394 cont'd: debuginfod testsuite fix for -USR1 timingFrank Ch. Eigler2020-01-201-0/+1
| | | | | | If a SIGUSR1 is sent before the initial traversal, it no longer results in an extra traversal. That's a sensible effect. The test case just needs to wait before the kill -USR1.
* PR25394 cont'd: debuginfod timing fix for fts-traversal threadFrank Ch. Eigler2020-01-201-0/+1
| | | | | The new code neglected to set the last_rescan timestamp, leading to overly frequent rescanning.
* PR25394 followup#2: debuginfod casting fixesFrank Ch. Eigler2020-01-201-2/+2
| | | | | Buildbot still reports type warnings in time_t arithmetic. Explicit (long)er cast pushed as obvious ... or is it? :-)
* PR25394 followup: debuginfod casting fixesFrank Ch. Eigler2020-01-201-2/+2
| | | | | Buildbot reports type warnings in time_t arithmetic. Explicit (long) cast pushed as obvious.
* PR25394: debuginfod mutex between grooming and scanningfche/debuginfod-PR25394Frank Ch. Eigler2020-01-194-44/+100
| | | | | | | | | | | | | | | | | | | | Extended the work-queue concept with "idlers" - other threads that block on the work queue until it becomes empty (rather than normal consumers that block on it until it becomes non-empty). Use this facility for the groomer thread to avoid working at the same time as the scanner threads. Use this for the fts traversal thread for similar reasons. One user-visible effect: response to SIGUSR1 and SIGUSR2 will wait until the work queue runs empty, but the man page was unspecific so does not need changing. It's not obvious how to test this with a tests/ dataset so small that scanning takes negligible time, so the former races are very tight. P.S. We also evaluated using sqlite level transactions to isolate the scanner thread groups-of-operations from the groomer. These experiments failed to produce a nominally concurrent debuginfod, having triggered "database locked" type errors. So we remain single-threaded (fully serialized) at the sqlite API level.
* PR25415: fix debuginfod SEGV for empty search path listFrank Ch. Eigler2020-01-184-0/+25
| | | | | Prevent triggering undefined behaviour of fts(3), which causes a SEGV on fedora glibc 2.29.
* nm: Fix nm --external sysv format output.Mark Wielaard2020-01-162-1/+6
| | | | | | | | | | | Partial revert of commit 66f4c37d497bdde040a33f299b12163f044b1bf2. If index zero wasn't a real symbol it has already been filtered out in show_symbols so don't skip it in show_symbols_sysv. https://sourceware.org/bugzilla/show_bug.cgi?id=25227 Reported-by: Enzo Matsumiya <ematsumiya@suse.com> Signed-off-by: Mark Wielaard <mark@klomp.org>
* doc: Fix DEBUGINFOD_PROGRESS description to just mention output on stderr.Mark Wielaard2020-01-122-2/+7
| | | | | | | | An earlier variant of the default progress function could write to any file. Which is still in the documentation. But the actual implementation just uses stderr. Fix the documentation to match. Signed-off-by: Mark Wielaard <mark@klomp.org>
* libasm.h: Don't include libebl.h. Define an opaque Ebl handle.Mark Wielaard2020-01-1213-1/+20
| | | | | | | | | Using libasm isn't really usable without a way to create an Ebl handle. But we don't support libebl.h (and libebl itself). Just define the Ebl handle as an opaque struct. Code that uses it needs to figure out how to instantiate one itself (they cannot in any supportable way...) Signed-off-by: Mark Wielaard <mark@klomp.org>
* elfutils.spec: typo fixFrank Ch. Eigler2020-01-121-1/+0
| | | | | | Removed dangling %endif. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* elfutils.spec: dependency typo fixFrank Ch. Eigler2020-01-122-1/+5
| | | | | | | Commit da0959cafda4 introduced a dependency on "debuginfod-client", whereas it's really "elfutils-debuginfod-client". Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* debuginfod: extracted-from-archive file cacheFrank Ch. Eigler2020-01-118-15/+277
| | | | | | | | | | | 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. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* debuginfod: print U-A: and X-F-F: request headersFrank Ch. Eigler2020-01-112-3/+26
| | | | | | | | | For an incoming webapi request, print two headers that should assist in the administration of a debuginfod service. At fweimer's suggestion, added a bit of filtering so the text is more reliably parseable. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* debuginfod: rework threading model for file/archive scanningFrank Ch. Eigler2020-01-116-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.
* debuginfod: Use DEBUGINFOD_TIMEOUT as seconds to get at least 100K.Mark Wielaard2020-01-108-34/+45
| | | | | | | Use just one timeout using CURLOPT_LOW_SPEED_TIME (default 90 seconds) and CURLOPT_LOW_SPEED_LIMIT (100K). Signed-off-by: Mark Wielaard <mark@klomp.org>
* debuginfod: pass a distro-summary User-Agent request headerFrank Ch. Eigler2020-01-092-2/+90
| | | | | | | | | | | | 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. Signed-off-by: Frank Ch. Eigler <fche@redhat.com> Signed-off-by: Mark Wielaard <mjw@redhat.com>
* Do not install libdebuginfod.pc unless debuginfod is enabledDmitry V. Levin2020-01-082-1/+9
| | | | | Fixes: 288f6b199 ("debuginfod 1/2: client side") Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
* 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>