Printing a transparent gif header result in a completely black header.

Bug #196009 reported by Saivann Carignan
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
GS-GPL
Fix Released
Medium
ghostscript (Ubuntu)
Fix Released
High
Till Kamppeter
gnucash (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I tried to print a invoice that has a transparent gif image file for the logo and cupsd fails silently to print the invoice. It does not happen with a jpg file.

Steps to reproduce :

1. Have/Create a gnucash account file
2. Click on Business / Customer / New customer to create at least one customer
3. Click on Business / Customer / New invoice to create at least one invoice, publish that invoice.
4. Click on Edit / Style sheets to edit the style sheets
5. Choose the technicolor one and click on Edit
6. Go to the Image tab and change the heading banner to the attached gif from that bug report. and set heading alignment to center, save everything.
7. Click on Report / Business / Printable invoice
8. Click on the Option button to search a invoice number to print and choose technicolor as the style sheet.
9. Click on Print to print the invoice.

Actual results : The cupsd printer applet appears and the print task appears but is stopped. dmesg shows this :

[ 8953.284716] audit(1204086305.869:7): operation="inode_permission" request_mask="::rw" denied_mask="::rw" name="/dev/tty" pid=20017 profile="/usr/sbin/cupsd" namespace="default"
[ 8953.363526] audit(1204086305.949:8): operation="inode_permission" request_mask="::rw" denied_mask="::rw" name="/dev/tty" pid=20020 profile="/usr/sbin/cupsd" namespace="default"
[ 9048.715902] audit(1204086401.469:9): operation="inode_permission" request_mask="::rw" denied_mask="::rw" name="/dev/tty" pid=20056 profile="/usr/sbin/cupsd" namespace="default"
[ 9048.735003] audit(1204086401.489:10): operation="inode_permission" request_mask="::rw" denied_mask="::rw" name="/dev/tty" pid=20059 profile="/usr/sbin/cupsd" namespace="default"
[ 9665.378617] audit(1204087019.229:11): operation="inode_permission" request_mask="::rw" denied_mask="::rw" name="/dev/tty" pid=20112 profile="/usr/sbin/cupsd" namespace="default"
[ 9665.395434] audit(1204087019.249:12): operation="inode_permission" request_mask="::rw" denied_mask="::rw" name="/dev/tty" pid=20115 profile="/usr/sbin/cupsd" namespace="default"

sudo aa-complain cupsd does not fix the printing problem.

Expected results : The invoice should print without problems.

Tested on ubuntu Hardy alpha 5 up to date
gnucash : 2.2.3-1ubuntu3
cupsys : 1.3.5-2ubuntu1
printer : Network HP Photosmart C6180, foomatic PPD file configured with hplip toolbox

** Update : Under intrepid, the invoice now prints. However, the header is almost completely black (all transparent zones are printed in black on paper).

Related branches

CVE References

Revision history for this message
Saivann Carignan (oxmosys) wrote :
Revision history for this message
Daniel T Chen (crimsun) wrote :

Is this symptom still reproducible in 8.10 or 9.04?

Changed in cupsys:
status: New → Incomplete
Revision history for this message
Saivann Carignan (oxmosys) wrote :

Still confirmed under intrepid. However, while it didn't print in the past, it now results in ugly completely black header, which is still a bug. I updated bug title and description.

description: updated
description: updated
Changed in cupsys:
status: Incomplete → New
Revision history for this message
Saivann Carignan (oxmosys) wrote :
Revision history for this message
Saivann Carignan (oxmosys) wrote :
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Can you attach the error_log after doing "cupsctl LogLevel=debug" and then printing such a job? Can you print into a PostScript file from GNU Cash to see whether the image comes out black already from the application?

Changed in gnucash:
status: New → Incomplete
Changed in cupsys:
status: New → Incomplete
Revision history for this message
Saivann Carignan (oxmosys) wrote :

Till Kamppeter : When printing a postscript file, the bug does not happen. It only happens when printing with my HP printer so far. I removed error_log, did "sudo cupsctl LogLevel=debug" and printed with my printer. I attach the clean error_log file from /var/log/cups .

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

The error_log shopws that GNU Cash is sending PDF to the printing system and this gets processed at first by pdftopdf and then by foomatic-rip. So there are theree possibilities for what makes the GIF images black (or at least the transparent parts of them):

- GNU Cash already
- The pdftopdf filter
- Ghostscript and the HPIJS printer driver (they get called by foomatic-rip).

The first step is to find out what GNU Cash sends to the printing system.

To find out this, disable your print queue with

cupsdisable <queue name>

This prevents jobs which you send from being processed and removed from the queue,

Send a job from GNU Cash with your GIF image to the print queue. It will stay waiting in the

/var/spool/cups/

directory, a file whose name begins with a "d". Copy the file into your home directory (note that normal users cannot read these files):

sudo cp /var/spool/cups/d* .
sudo chown <your user name> d*
mv d* gnucash.pdf

Clean up your print queue with

cancel -a
cupsenable <queue name>

Now have a look at the file with evince or Adobe Reader. Is the image already black? If so, GNU Cash (or the GUI libraries which it is using) has a bug.

If not, the problem is in the filters. Do

cupsfilter -m application/vnd.cups-pdf -p /etc/cups/ppd/<your print queue>.ppd gnucash.pdf > pdftopdfout.pdf 2>pdftopdf.log

This runs only the pdftopdf filter. Display pdftopdfout.pdf with evince or Adobe Reader. How does the image look like. If it is black, pdftopdf has a bug, otherwise the bug is in Ghostscript or the driver. Try to display it also with Ghostscript, ("gs pdftopdfout.pdf"). If the image is black only then, the bug is in Ghostscript.

Set up a print queue for your printer with Gutenprint as the driver (Use the HP DeskJet 990C as the model if Gutenprint is not listed as a driver for your printer). Does the image come out correctly then. If so, the HPIJS driver or the IJS interface of Ghostscript is faulty. To check whether it is not Ghostscript's IJS interface you can install the packages foomatic-db-gutenprint and ijsgutenprint and set up a queue with a "Foomatic/gutenprint-ijs" driver. If the image comes out correctly, the bug is in HPIJS, otherwise in Ghostscript's IJS interface.

Revision history for this message
Saivann Carignan (oxmosys) wrote :

Here's the result!

/var/spool/cups/d* OK
pdftopdfout.pdf OK
gs pdftopdfout.pdf BUG! (The header is only black at that point).

I changed the driver of my printer to HP Deskjet 990C Gutenprint and reproduced the same steps from the beginning, and the result is exactly the same. I didn't try "Foomatic/gutenprint-ijs" driver because I didn't find it in the list (I already installed the packages, I'm probably missing the category where these printers are classified).

Changed in gnucash:
status: Incomplete → Invalid
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Can you please attach /var/spool/cups/d* and pdftopdfout.pdf?

Please do an actual printout with the HP Deskjet 990C/Gutenprint queue. Does the GIF come out black?

Did you install both the foomatic-db-gutenprint and ijsgutenprint packages? In system-config-printer you choose "HP", "DeskJet 990C", and then "HP DeskJet 990C Foomatic/gutenprint-ijs.5.2". Do also an actual print out with this queue and tell whether the GIF comes out correctly.

Revision history for this message
Saivann Carignan (oxmosys) wrote :

Ok I already did that (changing driver of my printer to "HP DeskJet 990C Foomatic/gutenprint-ijs.5.2" and follow the steps you wrote) and the result is :

/var/spool/cups/d* OK
pdftopdfout.pdf OK
gs pdftopdfout.pdf BUG! (The header is only black at that point).

I'm attaching the requested files, Thanks for your instructions.

Revision history for this message
Saivann Carignan (oxmosys) wrote :
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Thank you for the file. evince (=Poppler) displays it correctly and gv (=Ghostscript which ships with Intrepid) not. I have also taken a Subversion snapshot of the newest development state of Ghostscript. Also here the GIF comes out black (I used the "png16m" output device). So current Ghostscript still has the bug and the bug is independent of the output device/driver. It is also not dependent on Ubuntu's patches. Iy is an upstream bug.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

It also does not depend on whether pdftopdf has processed the file. I get the same results with both your d00217-001 and pdftopdfout.pdf.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :
Changed in cups:
importance: Undecided → High
status: Incomplete → Triaged
Changed in gs-gpl:
status: Unknown → New
Changed in ghostscript:
assignee: nobody → till-kamppeter
Revision history for this message
Saivann Carignan (oxmosys) wrote :

In case that it might be useful information, I was also able to reproduce the bug by printing Firefox png icon in /usr/share/pixmaps directly from eog.

Changed in gs-gpl:
status: New → In Progress
Changed in gs-gpl:
status: In Progress → Confirmed
Revision history for this message
tomdean (tomdean) wrote :

I have a series of similar entries in /var/log/messages. These were generated when printing from seamonkey.

# grep cups /var/log/messages
May 29 08:40:27 asus kernel: [254244.927576] type=1503 audit(1243611627.586:40): operation="inode_permission" requested_mask="::r" denied_mask="::r" fsuid=7 name="/var/run/samba/gencache.tdb" pid=19270 profile="/usr/sbin/cupsd"
May 29 08:40:27 asus kernel: [254244.927615] type=1503 audit(1243611627.586:41): operation="inode_permission" requested_mask="::r" denied_mask="::r" fsuid=7 name="/var/run/samba/gencache.tdb" pid=19270 profile="/usr/sbin/cupsd"
May 29 08:40:27 asus kernel: [254245.158900] type=1503 audit(1243611627.818:42): operation="inode_permission" requested_mask="::r" denied_mask="::r" fsuid=7 name="/var/run/samba/unexpected.tdb" pid=19270 profile="/usr/sbin/cupsd"
May 29 08:40:27 asus kernel: [254245.249089] type=1503 audit(1243611627.911:43): operation="inode_permission" requested_mask="::r" denied_mask="::r" fsuid=7 name="/var/run/samba/unexpected.tdb" pid=19270 profile="/usr/sbin/cupsd"
May 29 08:40:28 asus kernel: [254245.339282] type=1503 audit(1243611627.998:44): operation="inode_permission" requested_mask="::r" denied_mask="::r" fsuid=7 name="/var/run/samba/unexpected.tdb" pid=19270 profile="/usr/sbin/cupsd"
May 29 08:40:28 asus kernel: [254245.339330] type=1503 audit(1243611627.998:45): operation="inode_permission" requested_mask="::r" denied_mask="::r" fsuid=7 name="/var/run/samba/gencache.tdb" pid=19270 profile="/usr/sbin/cupsd"
May 29 12:33:45 asus kernel: [268242.875303] type=1503 audit(1243625625.535:46): operation="inode_permission" requested_mask="::r" denied_mask="::r" fsuid=7 name="/var/run/samba/gencache.tdb" pid=24312 profile="/usr/sbin/cupsd"
May 29 12:33:45 asus kernel: [268242.875343] type=1503 audit(1243625625.535:47): operation="inode_permission" requested_mask="::r" denied_mask="::r" fsuid=7 name="/var/run/samba/gencache.tdb" pid=24312 profile="/usr/sbin/cupsd"
May 29 12:33:45 asus kernel: [268242.997639] type=1503 audit(1243625625.658:48): operation="inode_permission" requested_mask="::r" denied_mask="::r" fsuid=7 name="/var/run/samba/unexpected.tdb" pid=24312 profile="/usr/sbin/cupsd"
May 29 12:33:45 asus kernel: [268243.087797] type=1503 audit(1243625625.746:49): operation="inode_permission" requested_mask="::r" denied_mask="::r" fsuid=7 name="/var/run/samba/unexpected.tdb" pid=24312 profile="/usr/sbin/cupsd"
May 29 12:33:45 asus kernel: [268243.177967] type=1503 audit(1243625625.838:50): operation="inode_permission" requested_mask="::r" denied_mask="::r" fsuid=7 name="/var/run/samba/unexpected.tdb" pid=24312 profile="/usr/sbin/cupsd"
May 29 12:33:45 asus kernel: [268243.178025] type=1503 audit(1243625625.838:51): operation="inode_permission" requested_mask="::r" denied_mask="::r" fsuid=7 name="/var/run/samba/gencache.tdb" pid=24312 profile="/usr/sbin/cupsd"

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Bug 362641 is probably the same problem.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

This bug is fixed in the upcoming Ghostscript 8.70 which will be released next week, so the bug will be fixed in Karmic.

Changed in ghostscript (Ubuntu):
status: Triaged → In Progress
Changed in gs-gpl:
status: Confirmed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ghostscript - 8.70.dfsg.1~rc1-0ubuntu1

---------------
ghostscript (8.70.dfsg.1~rc1-0ubuntu1) karmic; urgency=low

  * New upstream release
     o Fixes many transparency problems: color space conversion, mask contexts,
       patterns, ...
     o Fixes in font handling, especially when generating PDF
     o Improvements in robustness, correctness, and performance
     o New generic Esc/Page drivers: "eplmono", "eplcolor"
     o New "cdnj500" driver for many HP DesignJet printers
     o License is now GPLv2 or later and not GPLv2-only any more
     o Merged all patches of the Ubuntu and Debian packages upstream
     o Fixes LP: #196009
  * debian/patches/33_bad-params-to-xinitimage-on-large-bitmaps.dpatch,
    debian/patches/35_bitcmyk-blank-output.dpatch,
    debian/patches/37_fix-segfault-in-cups-raster-output-device.dpatch,
    debian/patches/38_CVE-2009-0583_0584.dpatch,
    debian/patches/40_pdfwrite-numcopies.dpatch,
    debian/patches/41_CVE-2009-0196.dpatch,
    debian/patches/42_CVE-2009-0792.dpatch,
    debian/patches/43_add-cdnj500-driver.dpatch,
    debian/patches/45_cups-device-pagesize-margins-duplex-fixes.dpatch,
    debian/patches/47_ps2write-segfault-fix.dpatch,
    debian/patches/50_ps2write-do-not-advertize-dsc-conformance.dpatch,
    debian/patches/53_fix-pstoraster-for-call-with-input-filename.dpatch:
    Removed patches backported from upstream.
  * debian/copyright: License change.
  * debian/ghostscript.links: s/8.64/8.70/

 -- Till Kamppeter <email address hidden> Wed, 29 Jul 2009 09:47:54 +0200

Changed in ghostscript (Ubuntu):
status: In Progress → Fix Released
Changed in gs-gpl:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.