#1210 tex: tex goes into an infinite loop

open
TeX (59)
2012-10-17
2005-01-19
Tino Weinkauf
No

If latex is called with "-interaction=nonstopmode", a
certain error causes it to wait for user input. Though it
should abort.

Tested with mikTeX 2.4.1705. This is to reproduce the
bug:

\documentclass[11pt]{article}
\begin{document}
${<x,i,b>:i\leq |f(x)|\and}$ %gives error
\end{document}

If LaTeX is called from the command line without
"-interaction=nonstopmode", it certainly asks earlier for
recovering. Anyway, if one types "q" to enter the batch
mode, it won't quit. Typing Ctrl-C several times helps to
quit the job.

This bug was reported to the TeXnicCenter Bug List. And
I am very sorry, Christian, it was reported long ago:
2003-12-17. Sorry.

Anyway, as mentioned above, the current version has
this problem as well.

Discussion

  • Logged In: YES
    user_id=67066

    Thanks for the report. I can reproduce the problem.

     
  • Logged In: YES
    user_id=729328

    Maybe I'm missing something but I see this as exactly what
    you'd expect. Just for the record: "q" means quiet
    (=\batchmode), not quit. If you want to quit you press "x".

    What you see here is TeX running along showing all the error
    messages on the terminal but not stopping for them (the
    definition of \nonstopmode) and it so happens that this
    particular error causes TeX to go into an inifinite loop. What
    you see at the end is not TeX waiting for user input but simply
    TeX trying to find the end of an infinite loop.

     
  • Tino Weinkauf
    Tino Weinkauf
    2005-01-20

    Logged In: YES
    user_id=439379

    Hi Morten!

    Did you try it?

    Yes, I know what "q" means. As I wrote above: "if one types
    "q" to enter the batch mode".

    The main problem, i.e. bug, is that latex simply doesn't
    quit. I consider an infinite loop as a bug.

    Might be, that it is not waiting for user input. But I
    executed it 10 minutes on a 1.7 GHz P4. It does not quit.
    The log file does not get bigger than 5 KB. It takes 99%
    system performance. Indeed, the latter speaks for the idea,
    that it doesn't wait for user input.

    Even if you don't enter the batch mode, the job will go into
    the infinite loop. Simply press enter several times at the
    tex prompt and after some error messages it won't return
    anymore to ask you something.

    So lets conclude: The job never finishes. Thats problematic
    enough to be considered as a bug.

    Ciao.Tino.

     
  • Logged In: YES
    user_id=729328

    Sorry, but you won't find any help anywhere. The ability to
    create an infinite loop is something any programming language
    can do. Try definining \def\quark{\quark} and see what
    happens when \quark is executed. Same thing. Or try a
    number comparison test like \@whilenum1<2\do{} which also
    goes straight into an infinite loop.

    You happened to get into an infinite loop after TeX had given
    you a number of warnings telling you had misplaced something.
    It would be a bug if TeX went into an infinite loop if you had
    given it error free input that ought to wrok but that wasn't
    the case.

     
  • Tino Weinkauf
    Tino Weinkauf
    2005-01-20

    Logged In: YES
    user_id=439379

    Yes, you might be right. Btw, thats enough to reproduce it:

    \documentclass{article}
    \begin{document}
    ${\and}$ %gives error
    \end{document}

    I am not sure, why this should end into an infinite loop.
    But I do not know the definition of \and at the moment. Anyway.

     
  • Logged In: YES
    user_id=729328

    \and is used when adding authors in \author{A \and B}. Try
    typing \show\and to see the definition.

     
  • Logged In: YES
    user_id=67066

    This is not a MiKTeX-specific problem:
    teTeX 3.0 (under Cygwin XP) goes into an infite loop, too.