Bug 689366 - Most japanese market printer drivers produce zero-length output/floating point exceptions
Summary: Most japanese market printer drivers produce zero-length output/floating poin...
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Printer Driver (show other bugs)
Version: master
Hardware: All All
: P4 normal
Assignee: Default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-25 13:46 UTC by Till Kamppeter
Modified: 2008-12-19 08:31 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
CUPS test page with which the bug occurred (18.01 KB, application/postscript)
2007-07-25 16:58 UTC, Till Kamppeter
Details
patch (857 bytes, patch)
2007-07-26 21:30 UTC, Alex Cherepanov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Till Kamppeter 2007-07-25 13:46:17 UTC
If I run the following command line

cat /usr/share/cups/data/testprint.ps | gs -q -dBATCH -dPARANOIDSAFER -dQUIET
-dNOPAUSE -sDEVICE=rpdl -sOutputFile=- - | cat - > x

The file x will have zero-length, which means that the driver has no output at
all on a valid PostScript input file.

If I do (direct output into x, no pipe)

cat /usr/share/cups/data/testprint.ps | gs -q -dBATCH -dPARANOIDSAFER -dQUIET
-dNOPAUSE -sDEVICE=rpdl -sOutputFile=x -

I get

Floating point exception (core dumped)

Ghostscript version is a recent (yesterday) snapshot of the trunf of the SVN
repo, so it is more or less GS 8.60.
Comment 1 Alex Cherepanov 2007-07-25 16:07:06 UTC
Please attach the sample file. Different versions of cups may have different
samples. Please also specify your platform and OS. This bug cannot happen on
all platforms because x86 doesn't detect floating point exceptions and MS Windows
doesn't dump core.
Comment 2 Till Kamppeter 2007-07-25 16:56:39 UTC
This is on Ubuntu Gutsy 32-bit x86 Linux and Ubuntu Feisty 64-bit x86 Linux.

On both systems I get the described results.

Comment 3 Till Kamppeter 2007-07-25 16:58:36 UTC
Created attachment 3206 [details]
CUPS test page with which the bug occurred

Test page of CUPS 1.2.x as it comes with the current Ubuntu distributions. The
problem occurred with this test page.
Comment 4 Alex Cherepanov 2007-07-26 13:41:29 UTC
The problem is reproduced on peeves with:
  gs -sDEVICE=rpdl -sOutputFile=x -c showpage

The immediate cause of the crash is division by 0 in 
rpdl_print_page_copies( ...... )
{ 
   .....
   int maxY = lprn->BlockLine / lprn->nBh * lprn->nBh;
   .....
}

nBh seems to be initialised and a non-0 value is reported by currentpagedevice
but it's value is 0 at the rendering time. Probably, the structure is only
partly copied.
Comment 5 Till Kamppeter 2007-07-26 14:05:58 UTC
Same behavior with the "bjc880j" driver:

------------------------------------------------------------------------------
till@till-desktop:~/printing-tests$ cat /usr/share/cups/data/testprint.ps | gs
-q -dBATCH -dPARANOIDSAFER -dQUIET -dNOPAUSE -sDEVICE=bjc880j -sOutputFile=- -
-sOutputFile=- - | cat -> x
till@till-desktop:~/printing-tests$ ls -l x
-rw-r--r-- 1 till till 0 2007-07-26 22:09 x
till@till-desktop:~/printing-tests$ cat /usr/share/cups/data/testprint.ps | gs
-q -dBATCH -dPARANOIDSAFER -dQUIET -dNOPAUSE -sDEVICE=bjc880j -sOutputFile=- -
-sOutputFile=x -
Floating point exception (core dumped)
till@till-desktop:~/printing-tests$ 
------------------------------------------------------------------------------
Comment 6 Till Kamppeter 2007-07-26 14:18:56 UTC
There are more drivers with this problem, here a list:

- rpdl
- bjc880v
- lips4
- lips3
- lips2p
- lips4v
- lp2000
- escpage

It seems that all drivers for japanese market laser printer vector PDLs are
affected by this bug.
Comment 7 Till Kamppeter 2007-07-26 14:49:21 UTC
Also

- npdl

is affected.
Comment 8 Alex Cherepanov 2007-07-26 21:30:39 UTC
Created attachment 3226 [details]
patch 

Add a missing member to the initializer macro for the device structure of
Japanese laser printer vector PDLs. Fix a FPE crash. Bug 689366.

The patch is committed as a rev. 8146.