<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Dear all,</div><div dir="ltr"><br></div><div dir="ltr">I'd like to report what looks like a bug in tex-live. Apologies if I'm sending this to the wrong place.  I did my best to find the proper bug tracker for tex-live, and I couldn't understand how to search through previous bug reports.</div><div dir="ltr"><br></div><div dir="ltr">*Bug summary*:  pdflatex hangs when building tex file that calls a command with self-referential definition of the form \newcommand{\bad}{\bad}.  I believe it should instead throw an error.  </div><div dir="ltr"><br></div><div dir="ltr">Detail below.</div><div dir="ltr"><br></div><div dir="ltr">Best regards,</div><div dir="ltr">Jess Riedel</div><div dir="ltr"><br></div><div dir="ltr">-------------------------</div><div dir="ltr"><br></div><div dir="ltr">==== Main bug report ====</div><div dir="ltr"><br></div><div dir="ltr">After incorrectly using find-replace-all, my tex file accidentally defined a new command self-referentially.  Here is a minimal example using `\bad` as the command.</div><div dir="ltr"><br></div><div dir="ltr">    \documentclass{article}</div><div dir="ltr">    \newcommand{\bad}{\bad}</div><div dir="ltr">    \begin{document}</div><div dir="ltr"><span style="white-space:pre">     </span>   Test words.</div><div dir="ltr"><span style="white-space:pre">  </span>   \bad</div><div dir="ltr">    \end{document}`</div><div dir="ltr"><br></div><div dir="ltr">Call that "test.tex".  When I build this in TexStudio, the message console displays</div><div dir="ltr"><br></div><div dir="ltr">Process started: /Library/TeX/texbin/pdflatex -synctex=1 -interaction=nonstopmode "test".tex</div><div dir="ltr"><br></div><div dir="ltr">and then TexStudio became unresponsive.  By looking at the MacOS Activity Monitor I can see that the process `pdftex` gets stuck at 99% CPU usage.</div><div dir="ltr"><br></div><div dir="ltr">If I comment out the `\bad` command, it builds fine, even with the bad definition in place.</div><div dir="ltr"><br></div><div dir="ltr">I confirmed that this happens when running `pdflatex test.tex` directly from the command line.  The output is given below</div><div dir="ltr"><br></div><div dir="ltr">### Environment</div><div dir="ltr">- TeXstudio 2.12.6 (hg 6631:16db084dae24)</div><div dir="ltr">- Using Qt Version 5.7.1, compiled with Qt 5.7.1 R</div><div dir="ltr">- OS: MacOS version 10.14.2 (18C54)</div><div dir="ltr">- TeX distribution: pdfTeX 3.14159265-2.6-1.40.16 (TeX Live 2015).  kpathsea version 6.2.1</div><div dir="ltr"><br></div><div dir="ltr">### Expected behavior</div><div dir="ltr"><br></div><div dir="ltr">`pdftex` should throw an error that can be caught by TexStudio.</div><div dir="ltr"><br></div><div dir="ltr">### Actual behavior</div><div dir="ltr"><br></div><div dir="ltr">`pdftex` hangs.</div><div dir="ltr"><br></div><div dir="ltr">### How to reproduce</div><div dir="ltr"><br></div><div dir="ltr">Run from the command line</div><div dir="ltr"><br></div><div dir="ltr">   $ pdflatex "test".tex</div><div dir="ltr"><br></div><div dir="ltr">This produces the following output, after which pdftex hangs:</div><div dir="ltr"><br></div><div dir="ltr">   This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex)</div><div dir="ltr">   restricted \write18 enabled.</div><div dir="ltr">   entering extended mode</div><div dir="ltr">   (./test.tex</div><div dir="ltr">   LaTeX2e <2015/01/01></div><div dir="ltr">   Babel <3.9l> and hyphenation patterns for 79 languages loaded.</div><div dir="ltr">   (/usr/local/texlive/2015/texmf-dist/tex/latex/base/article.cls</div><div dir="ltr">   Document Class: article 2014/09/29 v1.4h Standard LaTeX document class</div><div dir="ltr">   (/usr/local/texlive/2015/texmf-dist/tex/latex/base/size10.clo)) (./test.aux)</div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div></div></div></div></div>