[cups.bugs] [CRIT] STR #1470: pstops filter corrupts PostScript

Till Kamppeter till.kamppeter at gmx.net
Thu Mar 9 02:48:17 PST 2006


[STR New]

I am on CUPS 1.2 beta 1 now (SVN rev 5256) but it happened already on rev
5239.

It seems there is a bug in the pstops filter which breaks the PostScript.

To reproduce:

Get HP's PPD file for the HP LaserJet 4050

http://www.linuxprinting.org/foomatic-db/db/source/PPD/HP/mono_laser/HP_LaserJet_4050_Series.ppd

to have a pure PostScript printer which does not need GhostScript.

Add "FileDevice Yes" to /etc/cups/cupsd.conf and restart CUPS.

Set up a print queue with the downloaded PPD file:

lpadmin -p LJ4050 -E -v file:/tmp/printout -P
HP_LaserJet_4050_Series.ppd.gz -o PageSize=A4

Print a job:

lpr /usr/share/cups/data/testprint.ps

Try to display the /tmp/printout which should be PostScript:

gs -sDEVICE=x11 /tmp/printout

You will get output as follows:

----------------------------------------------------------------------
[root at majax c]# gs -sDEVICE=x11 /tmp/printout
ESP Ghostscript 815.01 (2005-09-22)
Copyright (C) 2004 artofcode LLC, Benicia, CA.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Loading NimbusSanL-Bold font from
/usr/share/fonts/default/Type1/n019004l.pfb... 2591852 1022928 1677540
358286 1 done.
Using NimbusSansL-Bold font for NimbusSanL-Bold.

Error: /undefined in stoppe
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Additional information: [/Duplex false]
Operand stack:
   --nostringval--   --nostringval--
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--  
--nostringval--   2   %stopped_push   --nostringval--   --nostringval--  
--nostringval--   false   1   %stopped_push   1   3   %oparray_pop   1   3
  %oparray_pop   1   3   %oparray_pop   1   3   %oparray_pop   .runexec2  
--nostringval--   --nostringval--   --nostringval--   2   %stopped_push  
--nostringval--
Dictionary stack:
   --dict:1115/1686(ro)(G)--   --dict:0/20(G)--   --dict:95/200(L)--
Current allocation mode is local
Last OS error: 2
Current file position is 9588
ESP Ghostscript 815.01: Unrecoverable error, exit code 1
[root at majax c]#
----------------------------------------------------------------------

There is an "Error: /undefined in stoppe"

This indicates that the PostScript is broken (My LaserJet 4050 here prints
a similar error message when I print this file with "nc -w1 <IP> 9100 <
/tmp/printout").

If I edit the file and fix the problem, The file can be correctly
displayed and printed. To try it out, find

----------------------------------------------------------------------
} stoppe% x y w h ESPrc - Clip to a rectangle.
----------------------------------------------------------------------

and fix is as follows

----------------------------------------------------------------------
} stopped cleartomark
% x y w h ESPrc - Clip to a rectangle.
----------------------------------------------------------------------

Alternatively, you can get CUPS producing a correct file directly. Edit
/etc/cups/mime.convs to deactivate pstops:

Change

----------------------------------------------------------------------
application/postscript	application/vnd.cups-postscript	66	pstops
----------------------------------------------------------------------

to

----------------------------------------------------------------------
application/postscript	application/vnd.cups-postscript	66	-
----------------------------------------------------------------------

Then /tmp/printout can directly be displayed or printed, but without
pstops most option settings are ignored.

So the problem clearly lies in the pstops filter.

Link: http://www.cups.org/str.php?L1470
Version: 1.2-current





More information about the cups-devel mailing list