[tex-k] METAFONT bug: arithmetic overflow unchecked when the right-hand side is known

胡亚捷 (Hu Yajie) 2500418497 at qq.com
Mon Jun 1 13:52:46 CEST 2020


When METAFONT solves a numeric equation whose right-hand side is known,
section 1009 simply adds it to the (negated) left-hand side without checking
overflow ("value(q):=value(q)+cur_exp" and "value(q):=value(q)+value(r)").
For example, on my machine METAFONT (TeX Live 2017/Debian) reports that
the equation 32*1000=-32*1000 is "off by 1536", and that the equation
32*1000+767.99998=-(32*1000+767.99998) is redundant (i.e. off by <=64epsilon)!
Also if you say "a+32*1000=-32*1000" and ask the computer to "show a",
you'll find that the wrapped value 1536 can affect the program by getting
into a variable, without triggering an "Arithmetic overflow" error message.

Again, sorry if this is already reported.  I did google
"metafont overflow site:tug.org/pipermail/tex-k"
but didn't find any information.



More information about the tex-k mailing list.