aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@redhat.com>2020-01-18 15:32:40 -0500
committerFrank Ch. Eigler <fche@redhat.com>2020-01-18 15:32:40 -0500
commitc02dfd95e3db08460dfc61794564fbe4c05dc396 (patch)
tree74602daac42e0ffdd0bb8fc619e24775dd2c3fa8 /tests
parent62e3c37afd5828466f9192bd19217de835a3620f (diff)
downloadplatform_external_elfutils-c02dfd95e3db08460dfc61794564fbe4c05dc396.tar.gz
platform_external_elfutils-c02dfd95e3db08460dfc61794564fbe4c05dc396.tar.bz2
platform_external_elfutils-c02dfd95e3db08460dfc61794564fbe4c05dc396.zip
PR25415: fix debuginfod SEGV for empty search path list
Prevent triggering undefined behaviour of fts(3), which causes a SEGV on fedora glibc 2.29.
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog4
-rwxr-xr-xtests/run-debuginfod-find.sh12
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 3e1c367d..8936e410 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+2020-01-18 Frank Ch. Eigler <fche@redhat.com>
+
+ * run-debuginfod-find.sh: Test empty source_paths[].
+
2020-01-08 Mark Wielaard <mark@klomp.org>
* asm-test?.c: include libebl.h.
diff --git a/tests/run-debuginfod-find.sh b/tests/run-debuginfod-find.sh
index 6862db72..2a3d591b 100755
--- a/tests/run-debuginfod-find.sh
+++ b/tests/run-debuginfod-find.sh
@@ -28,11 +28,13 @@ export DEBUGINFOD_CACHE_PATH=${PWD}/.client_cache
PID1=0
PID2=0
+PID3=0
cleanup()
{
if [ $PID1 -ne 0 ]; then kill $PID1; wait $PID1; fi
if [ $PID2 -ne 0 ]; then kill $PID2; wait $PID2; fi
+ if [ $PID3 -ne 0 ]; then kill $PID3; wait $PID3; fi
rm -rf F R D L ${PWD}/.client_cache*
exit_cleanup
@@ -360,4 +362,14 @@ testrun ${abs_builddir}/debuginfod_build_id_find -e F/prog 1
testrun ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo $BUILDID2 && false || true
+# Test debuginfod without a path list; reuse $PORT1
+env LD_LIBRARY_PATH=$ldpath ${abs_builddir}/../debuginfod/debuginfod $VERBOSE -F -U -d :memory: -p $PORT1 -L -F &
+PID3=$!
+wait_ready $PORT1 'thread_work_total{role="traverse"}' 1
+wait_ready $PORT1 'thread_work_pending{role="scan"}' 0
+wait_ready $PORT1 'thread_busy{role="scan"}' 0
+kill -int $PID3
+wait $PID3
+PID3=0
+
exit 0