Utensil's Zettelkasten-style forest of evergreen notes on math and tech. utensil.tngl.sh/forest/
0

Configure Feed

Select the types of activity you want to include in your feed.

fix(dvisvgm): iter 70 — patch upstream FontEngine.cpp:93 off-by-one to stop substr OOB

Root cause for ag-0018, uts-001F (x2), ca-000J tikz-cd placeholders:
dvisvgm 3.6's setFont() enters the sys:// branch on ANY name with
size <= 6 (because the bool is || not &&), then unconditionally calls
fname.substr(6) which throws basic_string::substr on names shorter
than 6 chars. Iter 67's stashed dvisvgm stderr showed __pos=6 > size=3
on a 3-char fname — exact match for this bug.

Fix: flip <= to > and || to && so only true sys://... paths enter the
branch. Triggers a build-depot rebuild (~14m) because dvisvgm is in
the depot NAR closure.

[AGENT: kael]

+13
+13
flake.nix
··· 138 138 # in this nixpkgs revision). 139 139 texlive.bin.core 140 140 ]; 141 + # iter 70 — patch upstream off-by-one in FontEngine.cpp:93. The 142 + # original condition `fname.size() <= 6 || fname.substr(0,6) == "sys://"` 143 + # enters the branch on ANY short name (size <= 6), then calls 144 + # fname.substr(6) which throws basic_string::substr on a sub-6-char 145 + # string. Flip <= to > and || to && so only legit "sys://..." paths 146 + # enter; substr(6) is then always safe. Confirmed crash trigger for 147 + # ag-0018 / uts-001F / ca-000J tikz-cd via iter 67 stashed 148 + # _debug-failures.log (__pos=6 > size=3 on a 3-char fname). 149 + postPatch = '' 150 + substituteInPlace src/FontEngine.cpp \ 151 + --replace 'fname.size() <= 6 || fname.substr(0, 6) == "sys://"' \ 152 + 'fname.size() > 6 && fname.substr(0, 6) == "sys://"' 153 + ''; 141 154 # autotools default — configure + make + make install. 142 155 }; 143 156