Skip to content

Commit b3311ca

Browse files
committed
beef up backtrace script
1 parent 91faae0 commit b3311ca

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

.github/workflows/zhook.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ jobs:
6969
set -o pipefail
7070
set -o xtrace
7171
72-
# Create environment file for Docker
7372
cat > /tmp/docker.env << 'EOF'
7473
INPUT_ZITIID=${INPUT_ZITIID}
7574
INPUT_WEBHOOKURL=${INPUT_WEBHOOKURL}
@@ -116,10 +115,17 @@ jobs:
116115
echo "DEBUG: LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}"
117116
find $(python -c "import site; print(site.USER_SITE)") -path "*/openziti*" -name "*.so*" -type f -print0 | xargs -0r ldd
118117
cat /tmp/zook.py-valgrind-*.log
119-
for CORE in ${{ github.workspace }}/cores/core.*; do
120-
if [ -s "$CORE" ]; then
121-
echo "DEBUG: Core dump found: $CORE"
122-
EXECUTABLE=$(basename "$CORE" | cut -d. -f2)
123-
gdb -q $(realpath $(which "$EXECUTABLE")) -c "$CORE" --ex bt --ex exit
124-
fi
125-
done
118+
shopt -s nullglob
119+
typeset -a CORES=(${{ github.workspace }}/cores/core.*)
120+
shopt -u nullglob
121+
if [ ${#CORES[@]} -eq 0 ]; then
122+
echo "DEBUG: No core dumps found"
123+
else
124+
for CORE in "${CORES[@]}"; do
125+
if [ -s "$CORE" ]; then
126+
echo "DEBUG: Core dump found: $CORE"
127+
EXECUTABLE=$(basename "$CORE" | cut -d. -f2)
128+
gdb -q $(realpath $(which "$EXECUTABLE")) -c "$CORE" --ex bt --ex exit
129+
fi
130+
done
131+
fi

0 commit comments

Comments
 (0)