From 87209dc692e27ab1af2f925851a8afb8d761d1dd Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Fri, 28 Jun 2024 09:55:01 +0900 Subject: [PATCH] Update build workflow for enhanced error detection The build workflow has been updated to include the 'gdb' tool in installation, and to check for segmentation faults both in php_stderr.log and kernel logs. Additionally, core dump processing now verifies the existence of the file before execution to avoid potential errors. --- .github/workflows/build.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2e42510..7b35db2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,7 @@ jobs: run: php -i - 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: Prepare build run: | @@ -67,8 +67,11 @@ jobs: - name: Check for segmentation fault run: | if grep -q "Segmentation fault" php_stderr.log; then - echo "Segmentation fault detected" + echo "Segmentation fault detected in php_stderr.log" cat php_stderr.log + elif dmesg | grep -q "segfault"; then + echo "Segmentation fault detected in kernel logs" + dmesg | tail -n 20 elif [ -r /tmp/php_errors.log ]; then echo "No segmentation fault detected, but php_errors.log is present" cat /tmp/php_errors.log @@ -90,8 +93,10 @@ jobs: - name: Display core dump run: | for corefile in /tmp/core-*; do - echo "Processing core dump: $corefile" - gdb -q -c "$corefile" php -ex "thread apply all bt full" -ex "quit" + if [ -f "$corefile" ]; then + echo "Processing core dump: $corefile" + gdb -q $(which php) "$corefile" -ex "thread apply all bt full" -ex "quit" + fi done if: always()