texlive[64547] Build/source/texk/web2c: protect against recursive

commits+karl at tug.org commits+karl at tug.org
Thu Sep 29 03:20:56 CEST 2022


Revision: 64547
          http://tug.org/svn/texlive?view=revision&revision=64547
Author:   karl
Date:     2022-09-29 03:20:56 +0200 (Thu, 29 Sep 2022)
Log Message:
-----------
protect against recursive --halt-on-error

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/ChangeLog
    trunk/Build/source/texk/web2c/mf.ch
    trunk/Build/source/texk/web2c/tex.ch

Modified: trunk/Build/source/texk/web2c/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ChangeLog	2022-09-28 23:49:29 UTC (rev 64546)
+++ trunk/Build/source/texk/web2c/ChangeLog	2022-09-29 01:20:56 UTC (rev 64547)
@@ -1,3 +1,14 @@
+2022-09-28  Karl Berry  <karl at freefriends.org>
+
+	* tex.ch (halting_on_error_p): new variable, set when we start to
+	halt_on_error, and exit immediately if seen again.
+	* mf.ch: likewise.
+	(The cause is that close_files_and_terminate tries to close out
+	the dvi file nicely, which includes figuring out the
+	magnification, so if the magnification is already set, there's a
+	"recursive" error, which caused an infloop.)
+	Report from Bachir Bendrissou, tlsecurity 28 Sep 2022 12:28:10.
+
 2022-09-03  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 
 	* bibtex.ch:

Modified: trunk/Build/source/texk/web2c/mf.ch
===================================================================
--- trunk/Build/source/texk/web2c/mf.ch	2022-09-28 23:49:29 UTC (rev 64546)
+++ trunk/Build/source/texk/web2c/mf.ch	2022-09-29 01:20:56 UTC (rev 64547)
@@ -207,6 +207,7 @@
 @!file_line_error_style_p:c_int_type; {output file:line:error style errors.}
 @!eight_bit_p:c_int_type; {make all characters printable by default}
 @!halt_on_error_p:c_int_type; {stop at first error}
+@!halting_on_error_p:boolean; {already trying to halt?}
 @!quoted_filename:boolean; {current filename is quoted}
 @z
 
@@ -675,7 +676,12 @@
 @y
 print_char("."); show_context;
 if (halt_on_error_p) then begin
-  history:=fatal_error_stop; jump_out;
+  {If |close_files_and_terminate| generates an error, we'll end up back
+   here; just give up in that case. If files are truncated, too bad.}
+  if (halting_on_error_p) then do_final_end; {quit immediately}
+  halting_on_error_p:=true;
+  history:=fatal_error_stop;
+  jump_out;
 end;
 @z
 
@@ -1983,9 +1989,15 @@
 @ The |edit_name_start| will be set to point into |str_pool| somewhere after
 its beginning if \MF\ is supposed to switch to an editor on exit.
 
+Initialize the |stop_at_space| variable for filename parsing.
+
+Initialize the |halting_on_error_p| variable to avoid infloop with
+\.{--halt-on-error}.
+
 @<Set init...@>=
 edit_name_start:=0;
 stop_at_space:=true;
+halting_on_error_p:=false;
 
 @ Dumping the |xord|, |xchr|, and |xprn| arrays.  We dump these always
 in the format, so a TCX file loaded during format creation can set a

Modified: trunk/Build/source/texk/web2c/tex.ch
===================================================================
--- trunk/Build/source/texk/web2c/tex.ch	2022-09-28 23:49:29 UTC (rev 64546)
+++ trunk/Build/source/texk/web2c/tex.ch	2022-09-29 01:20:56 UTC (rev 64547)
@@ -575,6 +575,7 @@
 @!file_line_error_style_p:cinttype; {format messages as file:line:error}
 @!eight_bit_p:cinttype; {make all characters printable by default}
 @!halt_on_error_p:cinttype; {stop at first error}
+@!halting_on_error_p:boolean; {already trying to halt?}
 @!quoted_filename:boolean; {current filename is quoted}
 {Variables for source specials}
 @!src_specials_p : boolean;{Whether |src_specials| are enabled at all}
@@ -875,7 +876,12 @@
 @y
 print_char("."); show_context;
 if (halt_on_error_p) then begin
-  history:=fatal_error_stop; jump_out;
+  {If |close_files_and_terminate| generates an error, we'll end up back
+   here; just give up in that case. If files are truncated, too bad.}
+  if (halting_on_error_p) then do_final_end; {quit immediately}
+  halting_on_error_p:=true;
+  history:=fatal_error_stop;
+  jump_out;
 end;
 @z
 
@@ -4494,9 +4500,15 @@
 @ The |edit_name_start| will be set to point into |str_pool| somewhere after
 its beginning if \TeX\ is supposed to switch to an editor on exit.
 
+Initialize the |stop_at_space| variable for filename parsing.
+
+Initialize the |halting_on_error_p| variable to avoid infloop with
+\.{--halt-on-error}.
+
 @<Set init...@>=
 edit_name_start:=0;
 stop_at_space:=true;
+halting_on_error_p:=false;
 
 @ These are used when we regenerate the representation of the first 256
 strings.



More information about the tex-live-commits mailing list.