x/image/font: Opentype allocates bunch of memory when calculating Glyph of some characters. #46836
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
I am using latest release.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I am trying to render font with using image opentype package, everything is good except one font file.
The font is an .otf font and I packed with nerdfont packer from Cascadia Mono font. After drawing some glyphs
it freezes when it comes to nerd icons. Allocates bunch of memory and not finishing 'Glyph' function. If I try with
-race option it gives this error:
==8788==ERROR: ThreadSanitizer failed to allocate 0x0001f6000000 (8422162432) bytes at 0x040094000000 (error code: 1455)
I am drawing glyph with this code:
I tried font file with other programs and I don't see any issues. I can draw other fonts and characters with this
function. But only this one causing error. The base font file is original Cascadia Code and packed with nerd fonts.
This shows the usage of memory. Normally ~50 mb
And this is the font file:
Cascadia Mono Regular Nerd Font Complete Mono Windows Compatible.zip
Edit:
I tried with same font but ttf and it's works perfectly. I don't know if this is an issue but high memory usage and not giving an error may need to be fixed.
What did you expect to see?
Just draw the font.
What did you see instead?
Memory corruption and I think a long unexpected loop.
The text was updated successfully, but these errors were encountered: