| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
The new rpms were used in the new test. Make sure they are in the dist
tar ball.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Programs are sometimes compiled with source path names containing
noise like /./ or // or /foo/../, and these survive into DWARF. This
code allows either raw or canonicalized pathnames in the webapi, by
letting the client pass things verbatim, and letting the server
store/accept both raw and canonicalized path names for source files.
Tests included & docs updated.
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
Reported-by: Eli Schwartz <eschwartz@archlinux.org>
Tested-by: Eli Schwartz <eschwartz@archlinux.org>
|
|
|
|
|
|
|
| |
Improve debuginfod logging to show webapi query results including
http status, sizes, and processing times.
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Signed-off-by: Mark Wielaard <mark@klomp.org>
Signed-off-by: Omar Sandoval <osandov@fb.com>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Tested analogously to how RPMs are.
Signed-Off-By: Frank Ch. Eigler <fche@redhat.com>
|
|
|
|
| |
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
|
|
|
|
| |
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Prevent triggering undefined behaviour of fts(3), which causes
a SEGV on fedora glibc 2.29.
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Otherwise strip might run against the system libelf which might be too
old or missing.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Otherwise elfcompress might run against the system libelf which might
be too old or missing.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
| |
Avoid spurious failure if errno is modified by any other library call in
the test.
Signed-off-by: Andreas Schwab <schwab@suse.de>
|
|
|
|
|
|
|
|
|
|
|
| |
It is already possible to select the symbol table to print by name,
using --symbols=SECTION. This allows printing the dynamic symbol table
with --symbols=.dynsym. binutils readelf allows printing just the
dynamic symbol table by type using --dyn-sym. Add the same option
and document it. Also add a testcase to show --symbols=.dynsym and
--dyn-sym produce the same output.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
| |
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
| |
|
|
|
|
|
|
|
|
| |
The readelf code did parse section numbers, but then failed to actually
dump the section found. Fixed by actually calling the dump function
(either the hex or string variant). Add testcase for readelf -x num.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
| |
Don't use the largest executables/libraries to reduce the make check time.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, architecture-specific code for libebl exists in separate
libebl_$ARCH.so libraries which libebl loads with dlopen() at runtime.
This makes it impossible to have standalone, statically-linked binaries
which use libdwfl if they depend on any architecture-specific
functionality. Additionally, when these libraries cannot be found, the
failure modes are non-obvious. So, let's get rid of libebl_$arch.so and
move it all into libdw.so/libdw.a, which simplifies things considerably.
Signed-off-by: Omar Sandoval <osandov@fb.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Usage: elfclassify [OPTION...] FILE...
Determine the type of an ELF file.
All of the classification options must apply at the same time to a
particular file. Classification options can be negated using a
"--not-" prefix.
Since modern ELF does not clearly distinguish between programs and
dynamic shared objects, you should normally use either --executable or
--shared to identify the primary purpose of a file. Only one of the
--shared and --executable checks can pass for a file.
If you want to know whether an ELF object might a program or a shared
library (but could be both), then use --program or --library. Some ELF
files will classify as both a program and a library.
If you just want to know whether an ELF file is loadable (as program
or library) use --loadable. Note that files that only contain
(separate) debug information (--debug-only) are never --loadable (even
though they might contain program headers). Linux kernel modules are
also not --loadable (in the normal sense).
Without any of the --print options, the program exits with status 0 if
the requested checks pass for all input files, with 1 if a check fails
for any file, and 2 if there is an environmental issue (such as a file
read error or a memory allocation error).
When printing file names, the program exits with status 0 even if no
file names are printed, and exits with status 2 if there is an
environmental issue.
On usage error (e.g. a bad option was given), the program exits with a
status code larger than 2.
The --quiet or -q oose_filestion suppresses some error warning output,
but doesn't change the exit status.
Classification options
--core File is an ELF core dump file
--debug-only File is a debug only ELF file (separate .debug,
.dwo or dwz multi-file)
--elf File looks like an ELF object or archive/static
library (default)
--elf-archive File is an ELF archive or static library
--elf-file File is an regular ELF object (not an
archive/static library)
--executable File is (primarily) an ELF program executable (not
primarily a DSO)
--library File is an ELF shared object (DSO) (might also be
an executable)
--linux-kernel-module File is a linux kernel module
--loadable File is a loadable ELF object (program or shared
object)
--program File is an ELF program executable (might also be a
DSO)
--shared File is (primarily) an ELF shared object (DSO)
(not primarily an executable)
--unstripped File is an ELF file with symbol table or .debug_*
sections and can be stripped further
Input flags
-f, --file Only classify regular (not symlink nor special
device) files
--no-stdin Do not read files from standard input (default)
--stdin Also read file names to process from standard
input, separated by newlines
--stdin0 Also read file names to process from standard
input, separated by ASCII NUL bytes
-z, --compressed Try to open compressed files or embedded (kernel)
ELF images
Output flags
--matching If printing file names, print matching files
(default)
--no-print Do not output file names
--not-matching If printing file names, print files that do not
match
--print Output names of files, separated by newline
--print0 Output names of files, separated by ASCII NUL
Additional flags
-q, --quiet Suppress some error output (counterpart to
--verbose)
-v, --verbose Output additional information (can be specified
multiple times)
-?, --help Give this help list
--usage Give a short usage message
-V, --version Print program version
Report bugs to https://sourceware.org/bugzilla.
Signed-off-by: Florian Weimer <fweimer@redhat.com>
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
| |
C-SKY V2 ABI manual:
https://github.com/c-sky/csky-doc/blob/master/C-SKY_V2_CPU_Applications_Binary_Interface_Standards_Manual.pdf
C-SKY architecture user guide:
https://github.com/c-sky/csky-doc/blob/master/CSKY%20Architecture%20user_guide.pdf
Signed-off-by: Mao Han <han_mao@c-sky.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To print eh human readable description of the ELF e_machine header field
we used the ebl name. But this is not set for most EM constants. Introduce
a new function dwelf_elf_e_machine_string that does work for all known
EM values. Use that in eu-readelf to print a string representation of the
e_machine value.
Since this was the only usage of ebl->name, remove that from struct ebl.
Also add a testcase that makes sure dwelf_elf_e_machine_string works for
all EM values in the libelf/elf.h header so we will immediately notice
when a new value appears.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
| |
Running under valgrind just requires even more free memory.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|