debian: fix VS Code crash via Pango 1.56.x fontconfig workaround#14
Merged
debian: fix VS Code crash via Pango 1.56.x fontconfig workaround#14
Conversation
Pango 1.56.x introduced a thread pool for font loading ([pango] fontcon threads). When FONTCONFIG_FILE is unset or points directly to /etc/fonts/fonts.conf, these threads hit a stack corruption bug while processing cache-11 entries for variable fonts (Cascadia Code, Fira Code, Cantarell-VF, etc.). The crash manifests as a SIGTRAP from a ud2 instruction, with the stack return address overwritten with 'slotsize' (a HarfBuzz/fontconfig internal field name). The fix involves three changes: 1. Rebuild the fontconfig cache (fc-cache -f) after desktop package install to ensure it is up to date and not stale/missing. 2. Set FONTCONFIG_FILE to a wrapper config that includes /etc/fonts/fonts.conf via <include> rather than pointing at fonts.conf directly. This causes Pango to use a different internal code path that avoids the corrupting write. The wrapper produces identical font enumeration, so no behavior change for end users. Three activation methods for coverage: - ~/.config/environment.d/fontconfig.conf (systemd user session / GNOME) - ~/.bashrc export (new terminal sessions) - export in the script itself (current bootstrap session) 3. Apply the same FONTCONFIG_FILE export to .zshrc (in addition to .bashrc), since zsh is the default shell after install-zsh-customizations runs. Without this, users on zsh would not have the variable set in their interactive terminal sessions. Remove this workaround when Pango >= 1.57 is available in Debian stable. Validated: bash scripts/check.sh passes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pango 1.56.x introduced a thread pool for font loading ([pango] fontcon threads). When FONTCONFIG_FILE is unset or points directly to /etc/fonts/fonts.conf, these threads hit a stack corruption bug while processing cache-11 entries for variable fonts (Cascadia Code, Fira Code, Cantarell-VF, etc.). The crash manifests as a SIGTRAP from a ud2 instruction, with the stack return address overwritten with 'slotsize' (a HarfBuzz/fontconfig internal field name).
The fix involves three changes:
Rebuild the fontconfig cache (fc-cache -f) after desktop package install to ensure it is up to date and not stale/missing.
Set FONTCONFIG_FILE to a wrapper config that includes /etc/fonts/fonts.conf via rather than pointing at fonts.conf directly. This causes Pango to use a different internal code path that avoids the corrupting write. The wrapper produces identical font enumeration, so no behavior change for end users.
Three activation methods for coverage:
Remove this workaround when Pango >= 1.57 is available in Debian stable. Validated: bash scripts/check.sh passes.