[tex-k] mf segault

Olaf Weber olaf@infovore.xs4all.nl
30 Dec 2002 15:01:25 +0100


David Necas writes:

> Hello,

> metafont segfaults on i386 Linux on character [52] when run

>   mf '\mode:=deskjet; mag:=1+150/300; nonstopmode; input crashme'

> crashme.mf is attached at the end (be warned, it's monstrous
> and it compiles fr ages).  It crashes identically on all
> installations I have access to now (7.3.2x from TeX Live 6,
> 7.3.1 from RedHat Psyche, 7.3.7 from Debian Woody, 7.3.7x
> from TeX Live 7), so I believe it's generally reproducible.

> Otherwise it depends on the resolution, crashing sooner in
> higher resolutions, and later in smaller.

Basically, mf crashes because it could not create a new independent
variable; it uses serial numbers to distinguish them, a signed 32 bit
counter increased in increments of 64.  It dies when the counter goes
negative, at which point more than 33,000,000 independent variables
have been created during the run.

There are several ways to "fix" this:
- include a check, so mf dies more gracefully;
- use 64bit integers instead of 32bit, postponing metafont's death
  (may be non-trivial);
- be somewhat less ambitious in the metafont source.

-- 
Olaf Weber

               (This space left blank for technical reasons.)