Article View: comp.lang.postscript
Article #12Help! Trying to track down a bug.
From: David Bau
Date: Tue, 27 Oct 1992 23:20
Date: Tue, 27 Oct 1992 23:20
64 lines
4289 bytes
4289 bytes
Below I've pasted a piece of postscript code which produces no output (not
even error output) on an Apple LaserWriter II. Can somebody out there try
testing this on some other Adobe Postscript equipment for me?
I have been developing and compressing this postscript file (it draws 3d
mazes) using ghostscript to preview my work, and using sparcprinters
(NEWS) for producing hardcopies. Everything has been working fine, and
I was very suprised when the Adobe interpreter choked on it.
The compressed (and obfuscated) code lies below. I have an uncompressed
version which also crashes on the Adobe hardware, but which is much longer.
(i.e. the problem doesn't seem to be with my decompression algorithm.)
I've tried to track down the problem, and it seems that the printer
crashes at the end of the 1750th iteration through the central maze-
generation "loop". It gets to the very end of the code enclosed by the
loop, but never gets back to the beginning to start the 1751st iteration,
and it never gets to the code right after the loop. (At least, it never
produces any output after the 1750th iteration). It should take more
than 2000 iterations before it is supposed to stop; and futhermore,
there are no (cannot be any!) intervening "exits" between the last
line and the first line! Has anybody else had a problem like this?
If anybody has the time to help, I'll send you the big source. Is there
somebody at Adobe I can ask?
Thanks!
David
By the way, enjoy the mazes if you can get them to print.
Here's the code (2.1 K only)
}---- cut here ----{
%!
% Expert Labyrinth for Postscript printers, Copyright 1992 by David Bau
.40 .15 % line weights (0..1) % This file is free puzzleware. :)
-.70 % tunnel shape (-1..1) % Please distribute it and its output only for
40 % twistiness (0..100) % free, and keep my original comments intact.
true % tunnel crossings % If you like it or if you have a suggestion,
612 792 % page dimensions % send me a postcard from your home town!
78 168 % page margins % 777 South Avenue; Weston, MA 02193; USA
12 % cell size % bau@cs.cornell.edu
/`/def/*/repeat/~/lineto/!/mod/@/if/#/ifelse/$/dup/^/add/|/stroke/'/put/S/gsave
/./exit/,/and/&/sub/-/or/_/loop/=/exch/+/eq/Z/ne/"/bind/:/get/;/bitshift/W/exec
/N/mul/O/translate/P/neg/Q/for/?/moveto/T/grestore/X/showpage/$/dup/V/arc/M/pop
/Y/setlinewidth/R/div 78 dict begin 35{load def}repeat(,b5;-'/aabaCPbzN^`/bbw4!
`}{/bb3^4!`}#}_}"WYI$0Z{SXTIYH}{M}#XT)(31)({.}@}_c1eK$G4-'c0eK5'cfdK$G1-'cfdKw5
'/hfwdK`/a0eK`/b0`{ah+{.}@aGbJ,0Z{caaG)(ge)(gf2R&)(abs)(;`b4+{.}@/abaCPbzNa^`}#
}_{/eghw`/dghw`de&)(-5)(,u5;-}@'}_caaGu$5;=J--'}{/baG)(lt{15 xor 31)(-6h3)(16)(
`caaGbJ-'baC{BcaaG)(xor)({{l$i=:d{.}@M}_}{4}#}#`b4Z{/ub2)(100 h n ge ,{b}{false
i{d -}forall)('}Q}*/afhwghwK`/bl`ca45;'{/b/i[013{aC}Q]`ib:d)(16)(,0Z/nA013{$Ji,
0Z{/uA/lu`/ml`4{/mmw4!`LmJi,0Z{tl4^m&4!:W/lm`}@um+{.}@}*.}@LM}QT}Q}D/H{/a0eK`/b
0`{/maG5P;`SaEOb{L}*mw4!b+{L}@kmb^2!:WTah+{.}@/bm`baCP{BSaEOb2!{L}*1y?sy~ry?0y~
|T}_}_}D{01px{c=0'}Q01opo&1p0opoxop4{x{c=)(15 ,/i A 16)(O}D/B{/aabz^`x$0+{M.}@}
D/I{01px{/aASaEOaG$)(/L{90 rotate 0 -1)(,FZ{P.}@}_}D)(15)(,0+{M.}@)(31)(#/FA0{w
/jjv^`jG$)({10}{5})(0V|}"}{{0y?yy~y1~|}"}#]`/l{{5h$4Z{.}@M}_}D/C{/jA$z/vA1,0+)(
270)(V|}"}{{1r?sr~s0~|}"}#]`/k[{1y?0y~|}"e{{01y)(90 180)(V|}"}{{1r?rr~rs~1s~|}"
{1r?rr~r1~|}"}#{1r?0r~n{s0?sr~r0?rr~}@|}"e{{10r)(180 270)/j{F = i $ 1 ^/i = ` =
'}/m{32 j}S/F 2157 string/i 0/v{forall}5{`}*(V1r~|}"{11s)(90 270)(x}D/z{[1o1PoP
]=:}D/J{1=;}D/G{c=:}D/t[e{{1s?yyq)(idiv)(=!}D/K{oN^}D/E{$o!x=o)(array `/w{1 ^}D
/x{1 &}D/h{rand)(2R/qA/ryq&`/syq^`/of2^`/pog2^N`/cp)(ge/e A/y .5 ` abs)({{1+}}#
"/dA/nA$0)(scale{{1 ge}})($/fAcN&2R/oAopOcc)(cvi)$($/gAcN&2R/pA$o&cR)=(3{0`}*/D
{"`}"`/A{=`}D/cA$^/pA$^/oA$p&cR)F{M m}v/i 0 `(/b/a/u)25{{j}v m{$ j 47 Z{m}@}v}*
F cvx W end
Technical Details
Message-ID:
<1992Oct27.232005.10713@cs.cornell.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!caen!batcomputer!cornell!bauReferences:
<1c793rINNoce@darkstar.UCSC.EDU> <2044@shaman.wv.tek.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.postscript Path: arc1-ca.pugleaf.net!sparky!uunet!caen!batcomputer!cornell!bau From: bau@cs.cornell.edu (David Bau) Subject: Help! Trying to track down a bug. Message-ID: <1992Oct27.232005.10713@cs.cornell.edu> Organization: Cornell Univ. CS Dept, Ithaca NY 14853 References: <1c793rINNoce@darkstar.UCSC.EDU> <2044@shaman.wv.tek.com> Date: Tue, 27 Oct 1992 23:20:05 GMT Lines: 64