LaTeXML
LaTeXML copied to clipboard
LaTeXML with current Fedora 38 beta LaTeX causes infinite (?) loop
I process LaTeX on Fedora 38 beta using LaTeXML. Recently, I started observing that some latexml runs seem to enter in infinite loop. I spent some time narrowing this down until I arrived at the following minimum example:
\documentclass{article}
\usepackage{siunitx}
\begin{document}
\end{document}
When I run latexml foo.tex, the conversion hangs with:
latexml (LaTeXML version 0.8.7) processing foo.tex
Package: expl3
Digesting > Processing > Loading > Loading > Loading > Processing > Processing definitions /usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3-code.tex
Removing in import of siunitx fixes the problem. My Fedora 38 beta install provides LaTeXML-0.8.7-1.fc38.noarch and texlive-l3kernel-svn65299-65.fc38.noarch.
@flyn-org could you share the output of pdflatex --version as well on that machine?
I suspect this is a fresh regression due to the upstream texlive.
Here is the output from pdflatex --version:
pdfTeX 3.141592653-2.6-1.40.24 (TeX Live 2022)
kpathsea version 6.3.4
Copyright 2022 Han The Thanh (pdfTeX) et al.
There is NO warranty. Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.13; using zlib 1.2.13
Compiled with xpdf version 4.04
I just found that if I leave the LaTeXML process running long enough, it eventually terminates with:
latexml (LaTeXML version 0.8.7) processing foo.tex
Package: expl3
Error:expected:Match:? Missing argument Match:? for Core::Definition::Expandable[\??? Match:?] at expl3-code.tex; line 32108 col 0
Error:expected:Match:? Missing argument Match:? for Core::Definition::Expandable[\??? Match:?] at expl3-code.tex; line 32108 col 0
[...]
Error:expected:Match:? Missing argument Match:? for Core::Definition::Expandable[\??? Match:?] at expl3-code.tex; line 32108 col 0
Error:expected:Match:? Missing argument Match:? for Core::Definition::Expandable[\??? Match:?] at expl3-code.tex; line 32108 col 0
Fatal:too_many_errors:100 Too many errors (> 100)!
at expl3-code.tex; line 32108 col 0 - line 32108 col 5
In Core::Definition::Expandable[\??? Mat... /usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3-code.tex; from line 10718 col 0 to line 10718 col 33
Conversion failed 101 errors; 1 fatal error (See /tmp/foo.latexml.log) (reqd. 27m 22.74s)
Line 32108 of expl3-code.tex is the closing brace for the following statement:
\ior_str_map_inline:Nn \g__codepoint_data_ior
{
\reverse_if:N \if:w \c_hash_str \tl_head:w #1 \c_hash_str \q_stop
\__codepoint_data_auxi:w #1 \q_stop
\fi:
}
@flyn-org what is the Perl version on Fedora 38? LaTeXML 0.8.7 doesn't seem to work on Ubuntu Lunar (the unreleased next release). It has Perl 5.36; whereas I'm perfectly able to run 0.8.7 on Ubuntu Jammy (22.04 / 22.10)
$ rpm -q perl
perl-5.36.0-495.fc38.x86_64
The real culprit appears to be expl3:
\documentclass{article}
\usepackage{expl3}
\begin{document}
\end{document}
It indeed is in expl3; more recent versions are doing much more (pre)processing of Unicode information which is currently causing a huge slowdown, and then errors. It's not actually an infinite loop, however. Still debugging...
We are still experiencing this slowdown. It is currently taking over 22 minutes to build the XML with Tex Live 2024 and LaTeXML 0.8.8 for https://github.com/ehuelsmann/ledgersmb-book. We have limited our CI tests to Tex Live 2022 and LaTeXML 0.8.7 for now, but that will eventually not be acceptable. We would appreciate any progress possible on this huge slowdown.
that will eventually not be acceptable. We would appreciate any progress possible on this huge slowdown.
We agree wholeheartedly. But I have to moderate expectations that the current situation will likely not improve before v0.8.9, since the necessary upgrades are rather significant.
Any update on this issue? Or what should I do to not using the expl3 feature? I found there are no \usepackage{expl3} in my code but still experiencing similar problem..
@vincentzlt as per my last comment - we're still at v0.8.8, so no expected major updates to the situation.
If you can avoid expl3 use with latexml for now - you should - as you will encounter a performance penalty at the least, and regressions at the worst. Recent PRs are inching us closer to a sped up setup, but still some ground to cover.