Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
flyn-org opened this issue Apr 5, 2023 · 10 comments
Open

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

flyn-org opened this issue Apr 5, 2023 · 10 comments
Labels
regression texlive 2022 specific to a texlive-2022 toolchain
Milestone

Comments

@flyn-org
Copy link
Contributor

flyn-org commented Apr 5, 2023

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.

@dginev
Copy link
Collaborator

dginev commented Apr 5, 2023

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

@flyn-org
Copy link
Contributor Author

flyn-org commented Apr 5, 2023

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:
    }

@dginev dginev added texlive 2022 specific to a texlive-2022 toolchain and removed texlive 2023 labels Apr 5, 2023
@ehuelsmann
Copy link

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

@flyn-org
Copy link
Contributor Author

flyn-org commented Apr 9, 2023

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

@nschloe
Copy link

nschloe commented May 3, 2023

The real culprit appears to be expl3:

\documentclass{article}

\usepackage{expl3}

\begin{document}
\end{document}

@brucemiller
Copy link
Owner

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

@neilt
Copy link

neilt commented Mar 28, 2024

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.

@dginev
Copy link
Collaborator

dginev commented Mar 29, 2024

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.

@vincentzlt
Copy link

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

@dginev
Copy link
Collaborator

dginev commented Aug 14, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression texlive 2022 specific to a texlive-2022 toolchain
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants