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.
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.
This is on Ubuntu Gutsy 32-bit x86 Linux and Ubuntu Feisty 64-bit x86 Linux. On both systems I get the described results.
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.
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.
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$ ------------------------------------------------------------------------------
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.
Also - npdl is affected.
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.