From: Kienan Stewart Date: Tue, 17 Dec 2024 20:25:02 +0000 (-0500) Subject: jjb: Collect binaries from lttng-tools coredumps X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d11fbffdf32be7c8ebf7808f77e90b8992601971;p=lttng-ci.git jjb: Collect binaries from lttng-tools coredumps Change-Id: Icec573a14f1153099fcae688f7dc6d878eebb300 Signed-off-by: Kienan Stewart --- diff --git a/scripts/lttng-tools/postbuild_clean_processes_coredumps.sh b/scripts/lttng-tools/postbuild_clean_processes_coredumps.sh index bc62b1a..17e5748 100755 --- a/scripts/lttng-tools/postbuild_clean_processes_coredumps.sh +++ b/scripts/lttng-tools/postbuild_clean_processes_coredumps.sh @@ -72,12 +72,16 @@ while read -r core_file; do # Collect everything in the core file that looks like a reference to a # shared lib - strings "$core_file" | grep '^/.*\.so.*' | while read -r str; do - collect_recursive "$str" + strings "$core_file" | while read -r str; do + if [[ "${str}" =~ ^/.*\.so.* ]]; then + collect_recursive "${str}" + fi + if [[ -f "${str}" ]] && [[ -x "${str}" ]]; then + collect_recursive "${str}" + fi done echo "$core_file" >> "$file_list" - # Exit with failure when core files are found ret=1 done < <(find "/tmp" -maxdepth 1 -name "core\.[0-9]*" -type f 2>/dev/null)