[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#264394: tetex-bin: e-TeX is broken on registers > 255



Hilmar Preusse writes:
> On 08.08.04 Benjamin BAYART (bayartb@edgard.fdn.fr) wrote:

>> On a document of mine, too complex to be sent as a minimal example,
>> e-TeX seems broken with registers after 255. The following input:

> minimal exmaple (just took your one and reduced it):

> \documentclass{minimal}
> \begin{document}
> \makeatletter
> \dimendef\z@=263\relax
> \z@=0pt\relax
> \show\z@
> \end{document}

> root@drachi:~# latex etex1.tex
> This is e-TeX, Version 3.14159-2.1 (Web2C 7.4.5)
> entering extended mode
> (./etex1.tex
> LaTeX2e <2001/06/01>
> Babel <v3.7h> and hyphenation patterns for american, french, german, ngerman, russian, nohyphenation, loaded.
> (/usr/share/texmf/tex/latex/base/minimal.cls
> Document Class: minimal 2001/05/25 Standard LaTeX minimal class
> ) (./etex1.aux)
>> \z@=\dimen263.
> l.7 \show\z@

> ?

You misunderstood the nature of the problem.  Using a variation of the
original example:

$ cat etex-bug.tex
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\makeatletter
\dimendef\z@=256\relax
\z@=0pt\relax
\[aa\]
\show\z@
\end{document}
$ latex etex-bug.tex
This is pdfeTeX, Version 3.141592-1.20a-rc7.1-2.1 (Web2C 7.5.3)
output format initialized to DVI
entering extended mode
(./etex-bug.tex
LaTeX2e <2003/12/01>
Babel <v3.8c> and hyphenation patterns for english, french, german, ngerman, ca
talan, croatian, czech, danish, dutch, estonian, finnish, greek, hungarian, ita
lian, latin, mongolian, norwegian, polish, portuguese, romanian, russian, slove
ne, slovak, spanish, swedish, ukenglish, ukrainian, welsh, dumylang, nohyphenat
ion, loaded.
(/usr/local/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2004/02/16 v1.4f Standard LaTeX document class
(/usr/local/share/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/share/texmf-dist/tex/latex/amslatex/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/share/texmf-dist/tex/latex/amslatex/amstext.sty
(/usr/local/share/texmf-dist/tex/latex/amslatex/amsgen.sty))
(/usr/local/share/texmf-dist/tex/latex/amslatex/amsbsy.sty)
(/usr/local/share/texmf-dist/tex/latex/amslatex/amsopn.sty)) (./etex-bug.aux)
> \z@=\count652.
l.8 \show\z@

?

The significant bit is that it prints \z@=\count652 instead of

1) Complaining about a "Bad register code" (which plain TeX would have
   done.
2) Printing \z@=\dimen256 like omega or aleph does.

This is evidence that e-TeX's internal datastructures are messed up.

In e-TeX registers 0..255 are handled as in TeX, but the
larger-numbered registers are allocated in a sparce array, and
deallocated when there is no longer any reference to them.  What
appears to happen is that the reference counting doesn't take into
account that references already exist to \z@ because it is being
redefined instead of seeing a pristine definition.  So the register
gets deallocated and the memory reused.  This is something I'll have
to punt to the e-TeX maintainer (who's on vacation at the moment).

The amsmath code is needed just to provide enough "churn" to actually
make this problem manifest itself in the example.

-- 
Olaf Weber

               (This space left blank for technical reasons.)




Reply to: