texlive[55767] Build/source/texk/web2c: avoid seg fault in unusual

commits+karl at tug.org commits+karl at tug.org
Tue Jul 7 00:42:47 CEST 2020


Revision: 55767
          http://tug.org/svn/texlive?view=revision&revision=55767
Author:   karl
Date:     2020-07-07 00:42:47 +0200 (Tue, 07 Jul 2020)
Log Message:
-----------
avoid seg fault in unusual interaction sequence

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

Modified: trunk/Build/source/texk/web2c/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ChangeLog	2020-07-06 21:01:23 UTC (rev 55766)
+++ trunk/Build/source/texk/web2c/ChangeLog	2020-07-06 22:42:47 UTC (rev 55767)
@@ -1,3 +1,14 @@
+2020-07-06  Karl Berry  <karl at freefriends.org>
+
+	* tex.ch (<Get user's advice...>): return early if
+	interaction<>error_stop_mode; else a nested error()
+	call in unusual interactive sequences can mess up
+	the selector value, ultimately causing a segmentation fault
+	from writing to a closed stream \write15. Fix primarily
+	from David Fuchs.
+	https://tex.stackexchange.com/questions/551313/
+	https://tug.org/pipermail/tex-live/2020-June/045876.html
+
 2020-06-22  Karl Berry  <karl at freefriends.org>
 
 	* doc/web2c.texi (Runtime options): move from install.texi,

Modified: trunk/Build/source/texk/web2c/tex.ch
===================================================================
--- trunk/Build/source/texk/web2c/tex.ch	2020-07-06 21:01:23 UTC (rev 55766)
+++ trunk/Build/source/texk/web2c/tex.ch	2020-07-06 22:42:47 UTC (rev 55767)
@@ -853,7 +853,26 @@
 end;
 @z
 
- at x [6.84] l.1888 - Implement the switch-to-editor option.
+% Original reports:
+%   https://tex.stackexchange.com/questions/551313/
+%   https://tug.org/pipermail/tex-live/2020-June/045876.html
+%
+% This will probably be fixed by DEK in the 2021 tuneup in a different
+% way (so we'll have to remove or alter this change), but the interaction
+% sequence in the reports above causes a segmentation fault in web2c -
+% writing to the closed \write15 stream because we wrongly decrement
+% selector from 16 to 15 in term_input, due to the lack of this check in
+% a recursive error() call.
+%
+ at x [6.83] l.1893 - avoid wrong interaction 
+loop at +begin continue: clear_for_error_prompt; prompt_input("? ");
+ at y
+loop at +begin continue:
+if interaction<>error_stop_mode then return;
+clear_for_error_prompt; prompt_input("? ");
+ at z
+
+ at x [6.84] l.1904 - Implement the switch-to-editor option.
 line ready to be edited. But such an extension requires some system
 wizardry, so the present implementation simply types out the name of the
 file that should be



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