From d11fbffdf32be7c8ebf7808f77e90b8992601971 Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Tue, 17 Dec 2024 15:25:02 -0500 Subject: [PATCH] jjb: Collect binaries from lttng-tools coredumps Change-Id: Icec573a14f1153099fcae688f7dc6d878eebb300 Signed-off-by: Kienan Stewart --- .../lttng-tools/postbuild_clean_processes_coredumps.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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) -- 2.39.5