Repository navigation
ci: install CVE-fixed libexpat to fix fontconfig SIGSEGV in Electron smoke tests - #323001
Alexandru Dima (alexdima) wants to merge 2 commits into
Conversation
…NULL-deref crash (#322909)" This reverts commit 70c0a5d. The change made the Linux Electron-Smoke crash *worse*, not better. Measured against the PR workflow, the Linux / Electron-Smoke job failure rate rose from ~8% (1/13) before the merge to ~19% (8/43) after it — roughly double. The original hypothesis (that fontconfig feeds the external DTD to expat as an external parameter entity and triggers the not-yet-backported NULL-deref CVEs) was not supported by the evidence. A proper frame-pointer backtrace of an after-merge crash dump shows the same intermittent libpangoft2 -> libfontconfig -> libexpat -> libc NULL-deref as before, just more frequently. The minimal config without the DOCTYPE actually parses *less* XML than the system config yet crashes more often, which points at a flaky race/heap issue in the expat 2.6.1 + fontconfig stack that this change perturbed rather than a deterministic content problem. Revert to restore the previous, lower crash rate. The durable fix remains shipping libexpat >= 2.7.5 on the runner (the workaround step already auto-disables itself when that version is detected); that is being tracked separately. Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR updates the Linux CI workflow to mitigate intermittent Electron smoke-test startup crashes on Ubuntu 24.04 by ensuring a CVE-fixed libexpat1 is installed (via a pinned, prebuilt Ubuntu .deb) and by restoring the previous minimal fontconfig config behavior.
Changes:
- Restore the
<!DOCTYPE ...>line in the minimal fontconfig config used by the existing expat/fontconfig workaround. - Add a workflow step that conditionally downloads (sha256-pinned) and installs
libexpat12.8.1 viadpkgwhen the runner’s version is< 2.7.5. - Extend diagnostics output to include the active
libexpat1version.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/pr-linux-test.yml | Restores minimal fontconfig DOCTYPE, installs newer pinned libexpat1 on noble runners, and prints expat version in diagnostics to stabilize Electron smoke startup. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 2
…smoke tests
Ubuntu 24.04 runners ship libexpat1 2.6.1, which intermittently NULL-derefs
while fontconfig parses font-config XML during Electron/Chromium startup. A
frame-pointer backtrace of a CI crash dump shows the fault on a glib worker
thread:
libpangoft2 -> libfontconfig (FcInit/parse) -> libexpat (XML_ParseBuffer)
-> libc (NULL deref, signal 11)
before any window appears. The earlier fontconfig-config tweaks (minimal config,
removing <include>/<!DOCTYPE>) only changed timing and did not remove the
runtime XML parse, so the crash persisted; removing the DOCTYPE actually made it
more frequent (reverted in the previous commit).
The fix only exists in expat >= 2.7.5, which noble does not package yet. Install
the official prebuilt libexpat1 2.8.1 .deb, fetched from the Azure Ubuntu mirror
the runner already uses (falling back to the canonical archive and Launchpad,
all byte-identical and sha256-pinned). It Pre-Depends only on libc6 (>= 2.38),
satisfied by noble's 2.39, so `dpkg -i` installs it cleanly and replaces the
system libexpat.so.1 (ABI-stable SONAME) for every process, including Electron.
The step auto-skips once the runner ships libexpat1 >= 2.7.5.
The minimal fontconfig config (with its DOCTYPE restored) is kept as secondary
stabilization. Diagnostics print the active libexpat1 version for verification.
Co-authored-by: Copilot <[email protected]>
13c24bb to
9396f74
Compare
|
Closing: verified ineffective. CI run 28192795744 installed libexpat 2.8.1 correctly ( |
Supersedes the from-source build idea — installs a prebuilt official Ubuntu
.deb, fetched from the Azure Ubuntu mirror the runner already uses. Also includes the revert of #322909 (so it works whether or not the standalone revert #322994 lands first).Root cause (confirmed)
Intermittent Linux
Electron-Smokefailures are a SIGSEGV inlibexpatduring fontconfig parsing at Electron startup, before any window appears. Frame-pointer (RBP) backtrace from a CI crash dump (run 28188049700):Ubuntu 24.04 (noble) ships libexpat1 2.6.1; the relevant parser NULL-deref fixes are only in expat ≥ 2.7.5, which noble hasn't packaged. Earlier fontconfig-config tweaks only perturbed timing (removing the
<!DOCTYPE>in #322909 actually doubled the crash rate, ~8% → ~19% — reverted here).Fix
Install the official prebuilt
libexpat12.8.1.debonto the noble runner:azure.archive.ubuntu.com, in-datacenter), falling back to the canonical Ubuntu archive and then Launchpad's permanent store. All three serve the byte-identical official build; we pin the sha256.Pre-Depends: libc6 (>= 2.38)only, and noble has libc6 2.39, sodpkg -iinstalls it cleanly with no dependency conflict.libexpat.so.1(ABI-stable SONAME) for every process, including the Electron browser process where the crash happens — noLD_PRELOADneeded.libexpat1 >= 2.7.5(so it self-removes when noble backports the fix).The minimal fontconfig config (DOCTYPE restored via the revert) is kept as secondary stabilization.
Why not plain
apt install libexpat1/ why this sourcepackages.microsoft.comanddl.google.com(the runner's other apt origins) don't carrylibexpat1.Validation
Pre-Depends: libc6 (>= 2.38)(installs on noble's 2.39).Co-authored-by: Copilot [email protected]