Skip to content

Commit e48f77b

Browse files
fix(ci): diagnose missing PHP language core dumps
1 parent f560ac2 commit e48f77b

1 file changed

Lines changed: 20 additions & 8 deletions

File tree

.gitlab/generate-profiler.php

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,24 +164,36 @@
164164
- cat "${XFAIL_LIST}" profiling/tests/php-language-xfail.list > /tmp/profiler-php-language-xfail.list
165165
- "if php -r 'exit(PHP_VERSION_ID < 80400 ? 0 : 1);'; then cat profiling/tests/php-language-xfail-pre84.list >> /tmp/profiler-php-language-xfail.list; fi"
166166
- export XFAIL_LIST=/tmp/profiler-php-language-xfail.list
167-
- ulimit -c unlimited
168-
- .gitlab/run_php_language_tests.sh
167+
- |
168+
ulimit -c unlimited
169+
output="${CI_PROJECT_DIR}/artifacts/php-language-tests"
170+
mkdir -p "${output}"
171+
{
172+
echo "core_limit=$(ulimit -c)"
173+
echo "core_pattern=$(cat /proc/sys/kernel/core_pattern)"
174+
echo "core_uses_pid=$(cat /proc/sys/kernel/core_uses_pid)"
175+
if [ -w /usr/local/src/php ]; then echo "core_directory_writable=yes"; else echo "core_directory_writable=no"; fi
176+
df -h /usr/local/src/php
177+
} | tee "${output}/core-dump-settings.txt"
178+
.gitlab/run_php_language_tests.sh
169179
after_script:
170180
- |
171-
core=/usr/local/src/php/core
172-
if [ -f "${core}" ]; then
173-
output="${CI_PROJECT_DIR}/artifacts/php-language-tests"
174-
mkdir -p "${output}"
181+
output="${CI_PROJECT_DIR}/artifacts/php-language-tests"
182+
mkdir -p "${output}"
183+
.gitlab/collect_artifacts.sh /usr/local/src/php
184+
core=$(find "${CI_PROJECT_DIR}/artifacts/core_dumps" -type f -name 'core*' -print -quit)
185+
if [ -n "${core}" ]; then
175186
gdb --batch \
176187
-ex "set pagination off" \
177188
-ex "info threads" \
178189
-ex "thread apply all bt full" \
179190
-ex "thread apply all info registers" \
180191
-ex "info sharedlibrary" \
181192
/usr/local/bin/php "${core}" > "${output}/gdb-backtrace.txt" 2>&1 || true
182-
mv "${core}" "${output}/core"
193+
else
194+
echo "No ELF core dump found under /usr/local/src/php" | tee -a "${output}/core-dump-settings.txt"
183195
fi
184196
artifacts:
185197
when: on_failure
186198
paths:
187-
- artifacts/php-language-tests/
199+
- artifacts/

0 commit comments

Comments
 (0)