7

Disclaimer: I did not know if this was the best place to post this issue or if I should have posted it on Stack Overflow instead, as it is more compilation-oriented than a real (La)TeX issue.


I am redacting my PhD thesis using TeXStudio as an IDE, OS is MacOS Sonoma 14.2.1 on an M2 Pro silicon (MacBook Pro 2023); I compile using LuaTeX. Here and there - and even if the compilation apparently goes well - I can notice in my process monitor an orphan pdftex process which just keeps writing on the hard drive. Typically, overnight, my 1To SSD - which is normally 80% free - is full, and everything on the system stops working.

Sometimes just killing the process would free disk space but sometimes not, and using Disk Inventory X allowed me to rapidly pinpoint the issue to a 799GB log file located in /private/var/folders/gx/9929__yd3r5_wzfsytpfvt740000gp/T

The log file begins (cannot open it in regular text editor of course, using head) as what appears to my novice eyes to be a fine pdftex compilation:

This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=pdflatex 2023.11.4)  20 MAY 2024 13:50
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**&pdflatex hCceVjK \dump
(./hCceVjK.tex
LaTeX2e <2022-11-01> patch level 1
L3 programming layer <2023-02-22>
(/usr/local/texlive/2023/texmf-dist/tex/latex/base/book.cls
Document Class: book 2022/07/02 v1.4n Standard LaTeX document class
(/usr/local/texlive/2023/texmf-dist/tex/latex/base/bk10.clo
File: bk10.clo 2022/07/02 v1.4n Standard LaTeX file (size option)
)
\c@part=\count185
\c@chapter=\count186
\c@section=\count187
\c@subsection=\count188
\c@subsubsection=\count189
\c@paragraph=\count190
\c@subparagraph=\count191
\c@figure=\count192
\c@table=\count193
\abovecaptionskip=\skip48
\belowcaptionskip=\skip49
\bibindent=\dimen140
)
(/usr/local/texlive/2023/texmf-dist/tex/latex/geometry/geometry.sty
Package: geometry 2020/01/02 v5.9 Page Geometry

but the tail is:

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
<*> &pdflatex hCceVjK \dump
                           
You're in trouble here.  Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

! Undefined control sequence.
<inserted text> {\LuaULResetUnderline 
                                      *\let \par \@@par \ifnum \outputpenalt...
<*> &pdflatex hCceVjK \dump
                           
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.


! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
<*> &pdflatex hCceVjK \dump
                           
You're in trouble here.  Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

! Undefined control sequence.
<inserted text> {\LuaULResetUnderline 
                                      *\let \par \@@par \ifnum \outputpenalt...
<*> &pdflatex hCceVjK \dump
                           
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.


! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
<*> &pdflatex hCceVjK \dump
                           
You're in trouble here.  Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

! Undefined control sequence.
<inserted text> {\LuaULResetUnderline 
                                      *\let \par \@@par \ifnum \outputpenalt...
<*> &pdflatex hCceVjK \dump
                           
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.


! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
<*> &pdflatex hCceVjK \dump
                           
You're in trouble here.  Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

! Undefined control sequence.
<inserted text> {\LuaULResetUnderline 
                                      *\let \par \@@par \ifnum \outputpenalt...
<*> &pdflatex hCceVjK \dump
                           
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.


! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
<*> &pdflatex hCceVjK \dump
                           
You're in trouble here.  Try typing%

going on again and again. I tried to pinpoint the exact point where it goes wrong (about line 1800) and this happens:

Package glossaries Info: Writing glossary file hCceVjK.glo on input line 70.

(/usr/local/texlive/2023/texmf-dist/tex/latex/preview/preview.sty
Package: preview 2017/04/24 13.1 (AUCTeX/preview-latex)

(/usr/local/texlive/2023/texmf-dist/tex/generic/luatex85/luatex85.sty
Package: luatex85 2016/06/15 v1.4 pdftex aliases for luatex
)
(/usr/local/texlive/2023/texmf-dist/tex/latex/preview/prtightpage.def
\PreviewBorder=\dimen364
)
\pr@snippet=\count536
\pr@box=\box107
\pr@output=\toks58
)
(/usr/local/texlive/2023/texmf-dist/tex/latex/varwidth/varwidth.sty
Package: varwidth 2009/03/30 ver 0.92;  Variable-width minipages
\@vwid@box=\box108
\sift@deathcycles=\count537
\@vwid@loff=\dimen365
\@vwid@roff=\dimen366
))
! Undefined control sequence.
<inserted text> {\LuaULResetUnderline 
                                      *\let \par \@@par \ifnum \outputpenalt...
<*> &pdflatex hCceVjK \dump
                           
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.


! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
<*> &pdflatex hCceVjK \dump

with the <*> &pdflatex hCceVjK \dump message announcing the beginning of this ever-writing hell.


This is quite annoying since the only parade that I found is to periodically check my process monitor to kill the infamous process (and before posting this question, I was starting to seriously consider writing a daemon to do this for me) before all hell breaks loose. If you have any clue on what's happening I'd be glad to have your insights.

Note:

  • what's especially strange is that I set the compilation to LuaLaTeX in TexStudio, and I do not see whence pdftex is called. Do you think I should report this to TeXStudio as a bug?
  • this seem to appear randomly, i.e. most of the time I can compile, and no pdftex process appears in my process monitor. Thus it is difficult to investigate and pinpoint the exact cause making this happen...

Edit as of 03/06/2024

As suggested by Sam Carter in the comments, I realised that the default preview tool (which can be seen in Preferences -> Preview -> Command) was pdflatex instead of lualatex.

It is indeed rather strange that TexStudio does not automatically adapt its previewing tool to the compilation toolchain, i.e. using pdflatex's preview for pdflatex-compiled document, lualatex's preview for lualatex-compiled document, and so forth and so on.

So far (about two weeks of time, and easily tens if not hundreds of compilations) the issue did not pop up again after having changed the preview tool to lualatex. I'll keep you posted if it raises again, but I think that the afore-mentioned change fixed it. However, I am yet reluctant to put this in an (accepted) answer, as I am not really sure that the issue is definitely fixed, due to its somewhat random / non-reproducible nature.

9
  • 2
    Are you able to find (after stopping the rogue process) the file looping, eg. hCceVjK.tex? This seems some program using TeX under the hood for example to produce graphics or similar things, looking at the content of that file should shed some light....
    – Rmano
    Commented May 22 at 6:21
  • 1
    Perhaps related to the math preview utility of TeXstudio. Commented May 22 at 6:28
  • 1
    If I remember correctly (it's been a couple of years), TeX Studio does this when you hover over an equation to try and display a rendered image of it. Of course, if your document requires LuaTeX, then trying to compile it with pdfTeX will result in an error. Rendering the equation like this is a “feature” (I've never liked it, but it's useful to some people), but producing a 800 GB log file is definitely a bug I'd say. Commented May 22 at 6:32
  • 2
    @mranvick Try less or, failing that, more so it pages it. These aren't editors.
    – cfr
    Commented May 22 at 6:54
  • 5
    lua-ul shouldn't loop in such a case so I added an issue at lua-ul: github.com/zauguin/luaul/issues/22. You could use the iftex package and surround lualatex specific code with \iflualatex ... \fi but naturally it would be better if texstudio wouldn't use pdflatex on a lualatex preamble. Commented May 22 at 7:30

0

You must log in to answer this question.

Browse other questions tagged .