[tex-live] fmtutil bogus infinite loop

Norbert Preining preining at logic.at
Mon Dec 21 10:09:08 CET 2009


Dear all,

I found that with current fmtutil if you duplicate a format definition
in fmtutil.cnf, fmtutil breaks down with
	Infinite loop detected
The problem is quite simple: We try to detect recursive calls to fmtutil
by adding
	$format/$engine
to an exported variable, and check that this format/engine combination
hasn't been built already.

(Easy to reproduce, edit your fmtutil.cnf, duplicate the first format
definition you find, run fmtutil-sys --all)

But we do not reset that variable when a new format is generated.

I was thinking a bit how to fix it, but the structure of the script
does not lend itself easy to fixing that at the read of the lines.

I decided for a much simpler approach: the infinite recursion only
happens when $engine is calling mktexfmt for creating a format.
And there is already a variable mktexfmtMode that is set specifically
for that.

So I reset the loop check variable if we are NOT in mktexfmtMode. That
should make sure that infinite recursions are still deteced.

Here is the patch:

--- fmtutil.orig	2009-12-21 18:02:24.000000000 +0900
+++ fmtutil	2009-12-21 18:02:03.000000000 +0900
@@ -714,6 +714,9 @@
   rm -f $fmtfile
 
   # Check for infinite recursion before running the iniTeX:
+  # We do this check only if we are running in mktexfmt mode
+  # otherwise double format definitions will create an infinite loop, too
+  $mktexfmtMode || mktexfmt_loop="" 
   case :$mktexfmt_loop: in
   *:"$format/$engine":*)
     abort "Infinite recursion detected, giving up!" ;;


If anyone has a different idea please let me know. And if nobody objects
I will commit that to the texlive repository.

Best wishes

Norbert

----------------------------------------------------------------------------
Norbert Preining                preining@{jaist.ac.jp, logic.at, debian.org}
JAIST, Japan               TU Wien, Austria            Debian TeX Task Force
gpg DSA: 0x09C5B094   fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
----------------------------------------------------------------------------
RIPON (vb.)
(Of literary critics.) To include all the best jokes from the book in
the review to make it look as if the critic thought of them.
			--- Douglas Adams, The Meaning of Liff


More information about the tex-live mailing list