[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#63451: tetex-bin: Comparison is always false errors in tftopl and vftovp; patch enclosed




Package: tetex-bin
Version: 1.0.6-5
Severity: normal


When building tetex 1.0.6, tftopl and vftovp trigger ``comparison
is always false due to limited range of data type'' warnings from
the gcc 2.95 compiler, indicating a bug in the code.  This bug
means that if a TFM file has more than 32510 ligkern entries,
instead of dying with an error message, tftopl and vftovp will
overflow various arrays.

The code causing these errors is identical in both files:

   if nl>4*lig_size then
     abort('The lig/kern program is longer than I can handle!');

(See line 482 of tftopl.web and line 644 of vftovp.web.)

As I understand it, there is no reason for multiplying lig_size by
four -- this code *should* read:

   if nl>lig_size then
     abort('The lig/kern program is longer than I can handle!');

Both nl and lig_size measure the size of the lig/kern program in
words. Quoting the source, nl is defined as 

   |@!nl|&number of words in the lig/kern table;\cr

(line 150 in tftopl.web; line 313 in vftopl.web), and the .ch
files set lig_size to be

   @!lig_size=32510; {maximum length of |lig_kern| program, in words}

(line 68 in tftopl.ch; line 55 in vftopl.ch)


The following patch will fix the .ch files so that the correct C
code is generated by web2c:

--- texk/web2c/tftopl.ch.orig	Sat Apr 29 02:21:12 2000
+++ texk/web2c/tftopl.ch	Sat Apr 29 02:05:15 2000
@@ -136,6 +136,16 @@
   := cast_to_byte_pointer (xrealloc (tfm_file_array, 4 * lf - 1 + 1002));
 @z
 
+% Change made by C.M. Connelly <c@eskimo.com>
+% to fix a problem resulting in ``comparison always false due to
+% limited range of data type'' errors from gcc.
+@x
+if nl>4*lig_size then
+@y
+if nl>lig_size then
+@z
+
+
 % [27, 28] Change strings to C char pointers. The Pascal strings are
 % indexed starting at 1, so we pad with a blank.
 @x
@@ -428,3 +438,4 @@
 @<Global...@> =
 @!tfm_name, @!pl_name:c_string;
 @z
+
--- texk/web2c/vftovp.ch.orig	Sat Apr 29 02:21:12 2000
+++ texk/web2c/vftovp.ch	Sat Apr 29 02:05:25 2000
@@ -123,6 +123,15 @@
   end
 @z
 
+% Change made by C.M. Connelly <c@eskimo.com>
+% to fix a problem resulting in ``comparison always false due to
+% limited range of data type'' errors from gcc.
+@x
+if nl>4*lig_size then
+@y
+if nl>lig_size then
+@z
+
 % [31] Ditto for vf_abort.
 @x
 @d vf_abort(#)==
@@ -244,6 +253,7 @@
 cur_name[r] := 0; {Append null byte since this is C.}
 @z
 
+
 @x [49] Change strings to C char pointers, so we can initialize them.
 @!ASCII_04,@!ASCII_10,@!ASCII_14: packed array [1..32] of char;
   {strings for output in the user's external character set}
@@ -622,3 +632,4 @@
 @<Global...@> =
 @!vf_name, @!tfm_name, @!vpl_name:c_string;
 @z
+


I found this bug when reviewing the fail logs generated by the
PowerPC build daemon.  It has been reported upstream; this patch
should allow you to fix the frozen version.

   CMC


System information
==================

Debian Release: potato
Architecture: powerpc
Kernel: Linux diziet 2.2.15pre20 #2 Tue Apr 25 17:06:54 PDT 2000 ppc



Versions of packages tetex-bin depends on:

libc6 (>= 2.1.2), libpng2, libstdc++2.10, libz1, tetex-lib, xlib6g, xlib6g (>= 3.3.6), tetex-lib (>= 1.0.6), tetex-base (>= 1.0-5), ed, debianutils (>= 1.13.1)
ii  libc6          2.1.3-8        GNU C Library: Shared libraries and Timezone
ii  libpng2        1.0.5-1        PNG library - runtime
ii  libstdc++2.10  2.95.2-7       The GNU stdc++ library
un  libz1          <none>         (no description available)
ii  zlib1g         1.1.3-5        compression library - runtime
^^^^^^^^^^ replacement for libz1
ii  tetex-lib      1.0.6-1.1      shared libkpathsea for teTeX
ii  xlib6g         3.3.6-6        shared libraries required by X clients
ii  xlib6g         3.3.6-6        shared libraries required by X clients
ii  tetex-lib      1.0.6-1.1      shared libkpathsea for teTeX
ii  tetex-base     1.0-5          basic teTeX library files
ii  ed             0.2-18         The classic unix line editor
ii  debianutils    1.13.3         Miscellaneous utilities specific to Debian.


Reply to: