deps: bump typesetting past the CFF2 INDEX allocation bug - #845
Closed
felix-dumit wants to merge 2 commits into
Closed
felix-dumit wants to merge 2 commits into
felix-dumit wants to merge 2 commits into
Conversation
/api/code-fonts parses every system font. On macOS, SFIndia.ttc makes typesetting v0.3.4 allocate tens of GB before panicking: its CFF2 INDEX parser sizes a slice from an unvalidated uint32 count. safelyInspectCodeFont recovers the panic, so discovery still returns and nothing is logged, but the allocation already happened and Go does not give it back on Darwin. A _serve process after one Settings open went 7.6 GB -> 2.5 GB and held there for the rest of its life. A full system font scan drops from ~14.9 GB peak RSS to 469 MB. Upstream fixed this in 9e0086e and 4b2141b, which are on main but not in any tagged release, so this points at a pseudo-version until they tag.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #845 +/- ##
==========================================
+ Coverage 73.51% 75.86% +2.35%
==========================================
Files 154 161 +7
Lines 21448 21582 +134
==========================================
+ Hits 15768 16374 +606
+ Misses 4369 3892 -477
- Partials 1311 1316 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
tomasz-tomczyk
marked this pull request as ready for review
September 4, 2026 21:19
Owner
|
I was wondering why my terminals kept going OOM!!! Took me a while to arrive at this same thing. Wish you undrafted this a while ago! 😆 |
Owner
Contributor
Author
Yeah I went down a deep rabbit hole to find this 😅, I was waiting to see if upstream would release a new version, but thanks for fixing! |
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.
Why
/api/code-fontsparses every font on the system. On macOS one of them,/System/Library/Fonts/SFIndia.ttc, makes typesettingv0.3.4allocate tens ofGB before panicking — its CFF2 INDEX parser sizes a slice from an unvalidated
uint32count.safelyInspectCodeFontrecovers the panic, so discovery returns normally andnothing is logged. The allocation still happened, and Go does not hand it back
on Darwin. A
_serveprocess after one Settings open went 7.6 GB → 2.5 GB andstayed at 2.5 GB for the rest of its life.
Full system font scan (
TestDiscoverCodeFontFamiliesScansTheCurrentSystem):v0.3.4What
Bumps typesetting to a pseudo-version off upstream
main, which carries the fix(go-text/typesetting
9e0086eand4b2141b). No tagged release has it yet —v0.3.4predates both. Worth swapping for a normal version tag once upstreamcuts one.
go-text/typesetting#267
Testing
go build ./...andgo test ./internal/server/both clean.