From 3c6dc819fff9a88f8766303de288163b869d0bed Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Fri, 5 Jul 2024 08:38:12 +0900 Subject: [PATCH] Add core dump debugging for build workflow The build workflow has been updated with the ability to generate and handle core dumps for debugging purposes. 'gdb' was added to the build tools, the system was configured to enable core dumps, and a step was added to check for and report on any core dumps that occur during the build process. These updates will provide valuable debugging information in the event of a build failure. --- .github/workflows/build.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index acfe8c2..4fc4a4a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,12 @@ jobs: extensions: mbstring, intl - name: Install build tools - run: sudo apt-get update && sudo apt-get install -y autoconf automake libtool bison re2c + run: sudo apt-get update && sudo apt-get install -y autoconf automake libtool bison re2c gdb + + - name: Enable core dumps + run: | + ulimit -c unlimited + echo '/tmp/core.%e.%p' | sudo tee /proc/sys/kernel/core_pattern - name: Prepare build run: | @@ -39,3 +44,15 @@ jobs: run: | php -dextension=./modules/rayaop.so -i | grep rayaop timeout 60s php -dextension=./modules/rayaop.so -dmemory_limit=128M -dreport_memleaks=1 -dzend.assertions=1 -dassert.exception=1 smoke.php + + - name: Check for core dump + if: failure() + run: | + if ls /tmp/core.* 1> /dev/null 2>&1; then + for corefile in /tmp/core.*; do + echo "Core dump found: $corefile" + gdb -batch -ex "bt full" -ex "quit" -c $corefile $(which php) + done + else + echo "No core dump found" + fi