Skip to content

Commit 2bccd85

Browse files
committed
Test thin-only LTO rebuild as a crash mitigation in debug workflow
The replayed link under gdb pinned the fault: null deref (address 0x18) in LLVM's prevailing-symbol resolution (the function referencing "Interposable and available_externally/linkonce_odr/weak_odr symbol", LTO.cpp), reached from lld's BitcodeCompiler before any optimization pass runs — which is why --lto-O0/--threads=1 and opt-bisect all came back empty. The link feeds it mixed bitcode: buildroot libs are ThinLTO (-flto=thin, craft.yml.twig line 16) while PHP objects are full LTO (trailing -flto, line 110). Rebuild PHP thin-only on an affected VM to test that removing the mixing dodges the crash.
1 parent 99f098d commit 2bccd85

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

.github/workflows/debug-zig-crash.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,18 @@ jobs:
167167
else
168168
echo "MAKE MITIGATION FAIL: EXTRA_LDFLAGS_PROGRAM += -O0" | tee -a ../../diag/mitigations.txt
169169
fi
170+
# 5) the mixed-LTO hypothesis: buildroot libs are ThinLTO bitcode (-flto=thin) but
171+
# the trailing -flto makes PHP objects full-LTO bitcode; the crash sits in LLVM's
172+
# prevailing-symbol resolution that reconciles the two. Rebuild PHP thin-only.
173+
MAKE_THIN=$(printf '%s' "$MAKE_CMD" | sed "s/ -flto\([ ']\)/\1/g")
174+
echo "$MAKE_THIN" > ../../diag/make-thin-cmd.txt
175+
find . \( -name '*.o' -o -name '*.lo' \) -delete
176+
rm -f sapi/cli/php
177+
if eval "$MAKE_THIN" > /dev/null 2> ../../diag/make-thin.err && [ -f sapi/cli/php ]; then
178+
echo "MAKE MITIGATION OK: thin-only rebuild (standalone -flto removed)" | tee -a ../../diag/mitigations.txt
179+
else
180+
echo "MAKE MITIGATION FAIL: thin-only rebuild (standalone -flto removed)" | tee -a ../../diag/mitigations.txt
181+
fi
170182
171183
- name: Upload diagnostics
172184
if: ${{ always() }}

0 commit comments

Comments
 (0)