Skip to content

Commit 2f8c533

Browse files
committed
Print gdb stack trace for hanging process
1 parent 6f7cac5 commit 2f8c533

File tree

1 file changed

+41
-4
lines changed

1 file changed

+41
-4
lines changed

.github/workflows/cmake.yml

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,19 +297,19 @@ jobs:
297297
steps:
298298
- name: Install Dependencies (dnf)
299299
if: ${{ matrix.pacman == 'dnf' }}
300-
run: dnf install -y git cmake alsa-lib-devel libXinerama-devel freetype-devel curl libcurl-devel wget bzip2 gcc-c++ libXi-devel libXcomposite-devel freeglut-devel libXrandr-devel libXcursor-devel xz ccache python python3-pip jack-audio-connection-kit-devel libatomic unzip ninja-build
300+
run: dnf install -y gdb git cmake alsa-lib-devel libXinerama-devel freetype-devel curl libcurl-devel wget bzip2 gcc-c++ libXi-devel libXcomposite-devel freeglut-devel libXrandr-devel libXcursor-devel xz ccache python python3-pip jack-audio-connection-kit-devel libatomic unzip ninja-build
301301

302302
- name: Install Dependencies (apt)
303303
if: ${{ matrix.pacman == 'apt' }}
304-
run: apt update && DEBIAN_FRONTEND=noninteractive TZ="Europe/Amsterdam" apt install -y cmake git wget bzip2 build-essential libasound2-dev libjack-jackd2-dev curl libcurl4-openssl-dev libfreetype6-dev libx11-dev libxi-dev libxcomposite-dev libxcursor-dev libxcursor-dev libxext-dev libxrandr-dev libxinerama-dev ccache python3 python3-pip freeglut3-dev unzip ninja-build
304+
run: apt update && DEBIAN_FRONTEND=noninteractive TZ="Europe/Amsterdam" apt install -y gdb cmake git wget bzip2 build-essential libasound2-dev libjack-jackd2-dev curl libcurl4-openssl-dev libfreetype6-dev libx11-dev libxi-dev libxcomposite-dev libxcursor-dev libxcursor-dev libxext-dev libxrandr-dev libxinerama-dev ccache python3 python3-pip freeglut3-dev unzip ninja-build
305305

306306
- name: Install Dependencies (zypper)
307307
if: ${{ matrix.pacman == 'zypper' }}
308-
run: zypper refresh && zypper install -y git rsync wget bzip2 xz tar cmake alsa-devel libXinerama-devel libXi-devel libcurl-devel libXcomposite-devel freeglut-devel libXrandr-devel libXcursor-devel freetype2-devel gcc gcc-c++ curl ccache python3 libjack-devel gawk unzip ninja
308+
run: zypper refresh && zypper install -y gdb git rsync wget bzip2 xz tar cmake alsa-devel libXinerama-devel libXi-devel libcurl-devel libXcomposite-devel freeglut-devel libXrandr-devel libXcursor-devel freetype2-devel gcc gcc-c++ curl ccache python3 libjack-devel gawk unzip ninja
309309

310310
- name: Install Dependencies (pacman)
311311
if: ${{ matrix.pacman == 'pacman' }}
312-
run: pacman -Sy && pacman -S --noconfirm cmake wget bzip2 git alsa-lib freetype2 libx11 libxcursor libxi libxext libxinerama libxrandr libxrender webkit2gtk cmake make gcc pkgconf python python-pip curl ccache freeglut mesa glfw-x11 glew jack2 openssl unzip ninja && pacman --noconfirm -Syu
312+
run: pacman -Sy && pacman -S --noconfirm gdb cmake wget bzip2 git alsa-lib freetype2 libx11 libxcursor libxi libxext libxinerama libxrandr libxrender webkit2gtk cmake make gcc pkgconf python python-pip curl ccache freeglut mesa glfw-x11 glew jack2 openssl unzip ninja && pacman --noconfirm -Syu
313313

314314
- uses: actions/checkout@v4
315315
with:
@@ -330,6 +330,43 @@ jobs:
330330
working-directory: ${{github.workspace}}
331331
run: CXX=g++ cmake -Bbuild -GNinja -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DENABLE_SFIZZ=0
332332

333+
- name: Build with hang detection
334+
timeout-minutes: 20
335+
run: |
336+
# Start build
337+
cmake --build . --config Debug &
338+
BUILD_PID=$!
339+
340+
sleep 600
341+
342+
# Check if still running
343+
if kill -0 $BUILD_PID 2>/dev/null; then
344+
echo "=== BUILD APPEARS HUNG - GETTING STACK TRACE ==="
345+
346+
# Find the actual hanging process
347+
echo "All related processes:"
348+
ps aux | grep -E "(plugdata|pd|cmake)" | grep -v grep
349+
350+
# Try to attach to any plugdata/pd processes first
351+
for pid in $(pgrep -f "plugdata|pd" 2>/dev/null || true); do
352+
echo "=== Stack trace for PID $pid ==="
353+
gdb -batch \
354+
-ex "set pagination off" \
355+
-ex "attach $pid" \
356+
-ex "bt" \
357+
-ex "info threads" \
358+
-ex "thread apply all bt" \
359+
-ex "detach" \
360+
-ex "quit" 2>/dev/null || echo "Failed to attach to $pid"
361+
done
362+
363+
# Let it continue running until timeout kills it
364+
wait $BUILD_PID || true
365+
else
366+
echo "Build completed normally"
367+
wait $BUILD_PID
368+
fi
369+
333370
- name: Build standalone
334371
working-directory: ${{github.workspace}}
335372
run: cmake --build build --target plugdata_standalone --config Release

0 commit comments

Comments
 (0)