Skip to content

Commit

Permalink
Update build workflow for enhanced error detection
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
koriym committed Jun 28, 2024
1 parent 381ce46 commit 87209dc
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
Expand All @@ -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()

Expand Down

0 comments on commit 87209dc

Please sign in to comment.