Skip to content

Commit 20a8b1b

Browse files
committed
debug: add gdb backtrace on segfault for embed tests
1 parent cf07741 commit 20a8b1b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,15 @@ jobs:
225225
echo "LLVM_CONFIG_PATH=${{ runner.temp }}/llvm-${{ env.clang }}/bin/llvm-config" >> $GITHUB_ENV
226226
227227
- name: Test with embed feature
228-
run: cargo test --workspace --release --features closure,embed,anyhow --no-fail-fast
228+
run: |
229+
sudo apt-get update && sudo apt-get install -y gdb
230+
sudo sysctl -w kernel.core_pattern='core.%e.%p'
231+
ulimit -c unlimited
232+
echo "Core pattern: $(cat /proc/sys/kernel/core_pattern)"
233+
echo "Ulimit -c: $(ulimit -c)"
234+
cargo test --workspace --release --features closure,embed,anyhow --no-fail-fast || \
235+
(echo "Test failed, looking for core dumps..."; ls -la core.* 2>/dev/null || echo "No core files found"; \
236+
for core in core.*; do [ -f "$core" ] && echo "Found core: $core" && [ -x "target/release/deps/${core#*.}" ] && gdb -batch -ex "thread apply all bt" "target/release/deps/${core#*.}" "$core"; done; exit 1)
229237
230238
build-musl:
231239
name: musl / ${{ matrix.php }} / ${{ matrix.phpts[1] }}
@@ -239,7 +247,7 @@ jobs:
239247
steps:
240248
- name: Checkout code
241249
uses: actions/checkout@v5
242-
- name: Setup DockerX
250+
- name: Setup DockerX
243251
uses: docker/setup-buildx-action@v3
244252
- name: Build
245253
uses: docker/build-push-action@v6
@@ -267,4 +275,4 @@ jobs:
267275
-v $(pwd):/workspace \
268276
-w /workspace \
269277
extphprs/ext-php-rs:musl-${{ matrix.php }}-${{ matrix.phpts[1] }} \
270-
test --workspace --release --features closure,anyhow,runtime --no-fail-fast
278+
test --workspace --release --features closure,anyhow,runtime --no-fail-fast

0 commit comments

Comments
 (0)