From feede7c26cbdcb38c92ae9b3727a067a8f5942d1 Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Mon, 9 Dec 2024 16:12:00 -0600 Subject: [PATCH] Adjusted cf-support to not fail if core dumps are available and gdb is missing Previously cf-support would fail if core dumps were present and gdb was missing. We only want a warning and a log of which files are available for anlysis in this case. Ticket: ENT-9786 Changelog: title --- misc/cf-support | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/misc/cf-support b/misc/cf-support index 88ba2fb3b8..bde06f1a18 100755 --- a/misc/cf-support +++ b/misc/cf-support @@ -194,17 +194,21 @@ else if [ "$OS" != "solaris" ]; then if ! command -v gdb >/dev/null; then echo "Please install gdb. This is required in order to analyze core dumps." - exit 1 + echo "Core dumps needing to be analyzed will be listed below:" fi fi for core_file in $cf_core_files; do file "$core_file" >> "$_core_log" if [ "$OS" = "solaris" ]; then pstack "$core_file" >> "$_core_log" 2>&1 - else + elif command -v gdb >/dev/null; then execfn=`file "$core_file" | sed 's/,/\n/g' | grep execfn | cut -d: -f2 | sed "s/[' ]//g"` exe="`realpath "$execfn"`" gdb "$exe" --core="$core_file" -batch -ex "thread apply all bt full" >> "$_core_log" 2>&1 + else + echo "gdb not found so logging found core dump files to $_core_log" + # shellcheck disable=SC2012 + ls -l "$core_file" | tee "$_core_log" fi done fi