CURRENT BLFS: Version SVN-20120320

Compiling TexLive-20110705 with gcc-4.6.2/glibc-2.14.1 has no 
difficulties, but when "tex file.tex" is run, a stack overflow occurs. 
This is due to a coding glitch in the source. A pointer overrun happens. 
The glitch was already present in the old TeTeX-3.0, but older 
gcc-versions were more lenient on it. The problem can be fixed by two 
sed-lines:

sed -i "s|array \[0..127\]|array \[0..128\]|" texk/web2c /enctex.ch &&
sed -i "s|array \[0..127\]|array \[0..128\]|" texk/web2c/xetexd/xetex.ch

The seds have no influence when the code is compiled and run under 
gcc-4.5.2. Indeed, they only improve the code.

Below is also a patch based on the above (hardly worth the status of patch):

texlive-2011-pointers.patch

diff -Naur texlive-20110705-source/texk/web2c/enctex.ch 
texlive-20110705-source.mod/texk/web2c/enctex.ch
--- texlive-20110705-source/texk/web2c/enctex.ch        2011-01-09 
17:18:42.000000000 +0200
+++ texlive-20110705-source.mod/texk/web2c/enctex.ch    2012-03-22 
17:06:50.938086446 +0200
@@ -11,7 +11,7 @@
     { non zero iff character begins the multi byte code }
  mubyte_write: array [ASCII_code] of str_number;
     { non zero iff character expands to multi bytes in log and write 
files }
-mubyte_cswrite: array [0..127] of pointer;
+mubyte_cswrite: array [0..128] of pointer;
     { non null iff cs mod 128 expands to multi bytes in log and write 
files }
  mubyte_skip: integer;  { the number of bytes to skip in |buffer| }
  mubyte_keep: integer; { the number of chars we need to keep unchanged }
diff -Naur texlive-20110705-source/texk/web2c/xetexdir/xetex.ch 
texlive-20110705-source.mod/texk/web2c/xetexdir/xetex.ch
--- texlive-20110705-source/texk/web2c/xetexdir/xetex.ch 
2011-04-19 15:44:09.000000000 +0200
+++ texlive-20110705-source.mod/texk/web2c/xetexdir/xetex.ch 
2012-03-22 17:06:50.968078747 +0200
@@ -194,7 +194,7 @@
     { non zero iff character begins the multi byte code }
  mubyte_write: array [ASCII_code] of str_number;
     { non zero iff character expands to multi bytes in log and write 
files }
-mubyte_cswrite: array [0..127] of pointer;
+mubyte_cswrite: array [0..128] of pointer;
     { non null iff cs mod 128 expands to multi bytes in log and write 
files }
  mubyte_skip: integer;  { the number of bytes to skip in |buffer| }
  mubyte_keep: integer; { the number of chars we need to keep unchanged }


I have tested the compiled programmes against a number of existing 
TeX-files. So far nothing untowards happened.

Perhaps you can pass this on to the TexLive developers.

Niko Sauer
Pretoria
South Africa
-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to