LaTeXML icon indicating copy to clipboard operation
LaTeXML copied to clipboard

LaTeXML with current Fedora 38 beta LaTeX causes infinite (?) loop

Open flyn-org opened this issue 2 years ago • 10 comments
trafficstars

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 avatar Apr 05 '23 14:04 flyn-org

@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.

dginev avatar Apr 05 '23 15:04 dginev

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 avatar Apr 05 '23 15:04 flyn-org

@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)

ehuelsmann avatar Apr 09 '23 19:04 ehuelsmann

$ rpm -q perl
perl-5.36.0-495.fc38.x86_64

flyn-org avatar Apr 09 '23 21:04 flyn-org

The real culprit appears to be expl3:

\documentclass{article}

\usepackage{expl3}

\begin{document}
\end{document}

nschloe avatar May 03 '23 07:05 nschloe

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...

brucemiller avatar May 16 '23 18:05 brucemiller

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.

neilt avatar Mar 28 '24 19:03 neilt

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.

dginev avatar Mar 29 '24 00:03 dginev

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 avatar Aug 14 '24 01:08 vincentzlt

@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.

dginev avatar Aug 14 '24 02:08 dginev