fix(ci): stop libexpat/fontconfig segfault crashing ext-host Remote tests#14931
Merged
Conversation
…t-host The ext-host "Remote" suite cold-starts Electron once per test workspace; each cold start's multithreaded fontconfig init intermittently GP-faults in libexpat during font config load (stack: libexpat <- libfontconfig <- libpangoft2), crashing the run with exit 139. It is the dominant ext-host CI flake on amd64 (~5 of 6 recent ext-host failures on main). - ubuntu24_04 image: pull the security-patched libexpat1/libfontconfig1, install a fuller font set, and rebuild the fontconfig cache as the last font-affecting step so FcInit is a fast cache-hit that never regenerates the cache at runtime, shrinking the cold-start race window. - test-remote-integration.sh: run the test Electron with --disable-gpu to remove the GPU process whose font init is where the crash occurs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
E2E Tests 🚀 Note No feature tags detected. If this PR needs feature coverage, add the tag above and retrigger the workflow. |
midleman
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
test / ext-hostjob intermittently fails with exit 139 (SIGSEGV) during the Run Extension Host Tests (Remote) step. The crash happens on Electron startup, before any test runs, and the stack is entirely in system font libraries:It is the dominant ext-host flake on amd64: ~5 of 6 recent ext-host failures on
mainwere this exact crash. The suite that dies moves around (markdown-language-features one run, vscode-api-tests the next), which rules out test code.Root cause
A fontconfig cold-start race. The Remote suite cold-starts a fresh Electron once per test workspace, and each cold start runs
FcInit(config XML parse via libexpat + font-dir scan) from multiple threads (note theInitializeSandbox() called with multiple threadsline right before the crash). A malformed config would fail every time; this is intermittent, so it's a data race in the shared fontconfig/parser state. The Remote run has by far the most independent Electron cold starts, which is why it - and only it - hits this.Fix
Two complementary changes, attacking the same race from both sides:
docker/images/ubuntu24_04/Dockerfile.ubuntu24_04- pull the security-patchedlibexpat1/libfontconfig1(noble's base2.6.1-2build1shipped with the CVE-2024-45490 memory-corruption bug, fixed in2.6.1-2ubuntu0.1), install a fuller font set, and rebuild the fontconfig cache as the last font-affecting step soFcInitis a fast cache-hit that never regenerates the cache at runtime. Shrinks the cold-start race window to near-zero.scripts/test-remote-integration.sh- run the test Electron with--disable-gpu, removing the GPU process whose multithreaded font init is where the crash actually occurs. Scoped to the Remote script (the only suite affected); these tests are headless and don't exercise GPU rendering.A race can't be provably eliminated at these layers, but this is the standard, effective remedy and addresses the known memory-corruption bug outright.
Image / tag note
The
ubuntu24_04image tag encodes the embedded Node version (24.15.0), so it is rebuilt in place at the same tag rather than bumped. No workflow tag references change.Testing
CI Images: Build OS test imagesworkflow (os=ubuntu24_04,tag=24.15.0) against this branch, both arches.libexpatcrash rate onmainagainst the ~5-in-6 baseline.🤖 Generated with Claude Code