Skip to content

Commit 4c1e3da

Browse files
committed
Run createFunction diagnostic under gdb
1 parent 310d9b9 commit 4c1e3da

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

.github/workflows/phpunit-tests-turso.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,21 @@ jobs:
123123
ignore-cache: "yes"
124124
composer-options: "--optimize-autoloader"
125125

126+
- name: Install gdb
127+
run: sudo apt-get install -y --no-install-recommends gdb
128+
126129
- name: Diagnose createFunction behavior
127130
continue-on-error: true
128131
env:
129-
LD_PRELOAD: ${{ steps.turso-lib.outputs.path }}
132+
# Intentionally NOT setting LD_PRELOAD at step level — we enable it
133+
# only inside the script so gdb itself doesn't link against Turso.
134+
TURSO_LIB: ${{ steps.turso-lib.outputs.path }}
130135
working-directory: packages/mysql-on-sqlite
131136
run: |
132-
# Use STDERR for progress logging so it is always flushed immediately.
133-
php <<'PHP'
137+
# Progress logging goes to STDERR so it's line-buffered and flushed
138+
# before any crash. The PHP script is run under gdb so we get a
139+
# backtrace if it segfaults.
140+
cat > /tmp/diag.php <<'PHP'
134141
<?php
135142
$log = fn(string $s) => fwrite(STDERR, $s . "\n");
136143
@@ -187,6 +194,14 @@ jobs:
187194
$log('[done] script finished cleanly');
188195
PHP
189196
197+
gdb -batch \
198+
-ex "set confirm off" \
199+
-ex "set pagination off" \
200+
-ex "set environment LD_PRELOAD=$TURSO_LIB" \
201+
-ex "run /tmp/diag.php" \
202+
-ex "bt" \
203+
--args "$(command -v php)"
204+
190205
- name: Run PHPUnit tests against Turso DB
191206
continue-on-error: true
192207
env:

0 commit comments

Comments
 (0)