HP4 bug detecting file (fwd)

Petr Sojka sojka at erebor.ics.muni.cz
Fri Feb 11 12:16:41 CET 1994


Forwarded message:
>From owner-emtex-user at chemie.fu-berlin.de Fri Feb 11 03:37:23 1994
From: "Ralf Muehlen" <muehlen at rz.uni-sb.de>
Message-Id:  <9402102057.AA16230 at sbusol.rz.uni-sb.de>
Subject: HP4 bug detecting file
To: muehlen at rz.uni-sb.de (Ralf Muehlen)
Date: Thu, 10 Feb 1994 21:57:07 +0100 (MET)
Cc: jeacocke at s1.elec.uq.oz.au, emtex-user at chemie.fu-berlin.de
In-Reply-To:  <9402101125.AA01591 at sbusol.rz.uni-sb.de> from "Ralf Muehlen" at Feb 10, 94 12:25:02 pm
X-Mailer: ELM [version 2.4 PL21]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Length: 5086
Precedence: bulk

Ok, folks, before my mailbox will overflow, I gonna post two files
for detecting the bug in some HP4s. The author of these programs is
Jim Curry <curry at iiasa.ac.at>. In his original posting he put the
programs in one shell-script, but since emTeX is a DOS and OS/2
program some of you might not have a Bourne shell. So I have cut
the PS files out. You just have to send them to your PS printer.

Unfortuantely I made the mistake to call the bug a *floating point ROM*
error; that's wrong. The bug is in the *PostScript ROM*, hence HP4*
or any other HP printers without PS are not affected.

--------------------------------8<-------cut here------------------------
%!
% echo x - hp-4-bug1.ps
% sed -e 's/^X//' > hp-4-bug1.ps <<'!End-Of-hp-4-bug1.ps!'
% This should be done with a us-letter tray loaded, or, if you don't
% have such a beast, with the "letter" function inserted after the first
% line.  If the bug is fixed, it will print a thin vertical line
% somewhere in the middle of the page.  If not, it will print a right
% triangle.
%
%   Apparently, this is caused by the floating-point math library used
% to build the PostScript interpreter; when it tries to round a number
% that's very close to an integer, it produces dramatically wrong
% results (TeX output seems to trigger it a lot).
%
%!
% on an HP4si/MX or 4M, with us-letter paper loaded, this prints
% a triangle; on most anything else, it prints a thin vertical line.
%
72 300 div dup neg scale
310 -3005 translate
451 1680 moveto
2 0 rlineto
0 -50 rlineto
-2 0 rlineto
closepath fill
showpage
% End-Of-hp-4-bug1.ps
--------------------------------8<-------cut here------------------------
--------------------------------8<-------cut here------------------------
%!
% echo x - hp-4-bug2.ps
% sed -e 's/^X//' > hp-4-bug2.ps <<'!End-Of-hp-4-bug2.ps!'
%!
% -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= bug, bug, bug =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
% In late January, I posted about a serious "arithmetic" bug that I found
% in the LJ-4 PS-processor.  The symptom is that under some user-space-to-
% device-space transformations (including at least the one used by `dvips'),
% "rmoveto" (or "rlineto" or "show") operations generate incorrect results
% for certain coordinate values.  (Specifically, in all cases I've seen,
% some power of 2 gets added to or subtracted from the correct x-value;
% it seems obvious that this is due to a floating-point-arithmetic bug.)
%
% So any LJ-4 page might have a seemingly-random positioning error.  Yuck.
%
% Responses from the net confirmed that the bug exists on all current LJ-4's.
%
% In early February, I reported the bug to the HP people in Vienna.
% HP acknowledged the problem, and said that they would have someone
% from Adobe phone me.  An Adobe person did phone me a few days later;
% he said that Adobe would investigate, and would get back to me ASAP.
%
% I have heard nothing from Adobe or HP in the five weeks since then.  Grrh.
%
% So I'm wondering whether anyone else reported the bug to HP or to a supplier,
% and, if so, what response was offered.  If no one has heard anything, maybe
% it's time to start collectively pestering the folks at HP and/or Adobe.
%
% (I don't expect an instant fix, since that probably means a new LJ-4 PS ROM.
% But specific info about the bug might make it possible for someone to come up
% with a RELIABLE temporary fix -- for example, scaling everything by 1.0001
% might work if the bug is KNOWN to be triggered ONLY by integer coordinates.)
%
% Please post responses; this topic is clearly of interest to all LJ-4 users.
%
% Jim Curry                    ||  E-mail:    curry at iiasa.ac.at
% International Institute for  ||  Telephone: +43-2236-71521-204
%    Applied Systems Analysis  ||  Telefax:   +43-2236-71313
% A-2361 Laxenburg // Austria  ||  Telex:     079137 iiasa a
%
%PS: For completeness, here's the original example demonstrating the bug:
%==============================================================================
%!
  /save-x { currentpoint pop 100 string cvs def } def
  a4  % NOTE: with "letter" instead of "a4", the bug does NOT appear.
  72 300 div 72 300 div scale  300 0 translate
  412 0 moveto  /x1 save-x  % x1 should be 412
   14 0 rmoveto /x2 save-x  % x2 should be 426 (412+14)
    2 0 rmoveto /x3 save-x  % x3 should be 428 (426+2)
  /Courier findfont 50 scalefont setfont 600 600 moveto
  x1 show ( ) show x2 show ( ) show x3 show   showpage
  % This SHOULD show "412.0 426.0 428.0".  But on an LJ-4, it actually shows
  %   "412.0 426.0 940.0" (940 == 428 + 512).  I have several other examples.
%-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= bug, bug, bug =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
% End-Of-hp-4-bug2.ps
% exit
--------------------------------8<-------cut here------------------------


--
 Ralf Muehlen                                       ww02ksrm at rz.uni-sb.de
-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
   Any rumors that the world is coming to an end just because I'm about to
   release a 1.0-version are greatly exaggerated.  I think.
  					    - Linus Torvalds




More information about the csTeX mailing list