Bug 797049

Summary: Landscape prints as truncated portrait
Product: [Fedora] Fedora Reporter: Jonathan Dieter <jdieter>
Component: cupsAssignee: Tim Waugh <twaugh>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: caolanm, dtardon, erack, jpopelka, ltinkl, mstahl, sbergman, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-29 16:06:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
CUPS error log none

Description Jonathan Dieter 2012-02-24 06:09:23 UTC
Description of problem:
When we try to print a landscape document from LibreOffice on our Fedora 16 desktops, it prints as portrait, truncating the edges of the page.  The printer is on a cups print server running CentOS 6, and printing landscape works fine from our Fedora 13 desktops.

When I set up a local printer on one of the Fedora 16 desktops, it had the same problem.

If I change the Printer Language to PostScript, landscape pages print fine, but there doesn't seem to be a way to make that a system setting and it has to be set for each document.

Version-Release number of selected component (if applicable):
libreoffice-writer-3.4.5.2-5.fc16.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Go to Format, Page and set as Landscape
2. Go to File, Print
  
Actual results:
Page prints as truncated portrait

Expected results:
Page prints in landscape

Comment 1 Caolan McNamara 2012-02-27 09:58:39 UTC
Isn't this cups, not us that's doing the truncation ?

Comment 2 Caolan McNamara 2012-02-27 10:04:11 UTC
Sounds like #740496

Can we get the output of...

rpm -q cups ghostscript-cups

please

Comment 3 Jonathan Dieter 2012-02-27 10:09:59 UTC
On the desktops:
$ rpm -q cups ghostscript-cups
cups-1.5.2-1.fc16.x86_64
ghostscript-cups-9.04-7.fc16.x86_64

On the print server:
# rpm -q cups ghostscript-cups
cups-1.4.2-44.el6.x86_64
package ghostscript-cups is not installed

Though we have the same problem printing directly from the desktops to an attached printer.  (All the printers are HP if that has anything to do with anything.)

Comment 4 Tim Waugh 2012-02-27 10:38:55 UTC
Could this be bug #768811?  Try using the hpcups driver instead of hpijs (see bug #768811 comment #10, obviously choose the appropriate model instead of what's written there).

Comment 5 Jonathan Dieter 2012-02-27 13:51:34 UTC
Ok, that was an interesting couple of hours.  As mentioned above we have two printers attached to a CentOS server that the desktops print to.  Switching the driver for both printers to hpcups from hplip caused landscape documents printed from Fedora 16 using PDF as the printer language to completely fail to print.  The print jobs just hang on the Fedora desktops, with ps showing the ipp job just sitting there sleeping.  Portrait documents print immediately.

As for the printer attached directly to the Fedora 16 desktop, it's using the foo2zjs driver and attempting to switch to hpcups or hplip resulted in hung print jobs.  I even tried to run hp-setup -i and it still didn't work.  Reverting to foo2zjs allowed me to print again, but with the same original bug of landscape jobs being truncated.

If I'm doing something stupid, please let me know.  If you want me to set up a Fedora print server instead of CentOS, I'll happily do that (it's just a VM).  And if I need to split this into a couple of bug reports (obviously foo2zjs isn't in Fedora, though I'd love to get that system running with hpcups) I'll happily do that too.

FWIW, the printers are:
Attached to print server
HP LaserJet 1505n
HP LaserJet P2015n

Attached to the desktop:
HP LaserJet P1606dn

Comment 6 Tim Waugh 2012-02-27 14:57:53 UTC
Let's concentrate on the P1505n and P2015n for the moment.  It sounds like the jobs are hitting some sort of error when the server processes them.

Could you try running 'cupsctl --debug-logging' on the print server, and sending it a landscape job again?  Then look in /var/log/cups/error_log -- you should see some sort of error message somewhere (errors have 'E' at the beginning of the line), and the lines leading up to that will help to give that some context.

(Yes, aware this is CentOS -- but it might be possible to identify a similar bug in Fedora or Red Hat Enterprise Linux based on debugging it...)

Comment 7 Jonathan Dieter 2012-02-27 15:14:06 UTC
Created attachment 566068 [details]
CUPS error log

This is the trimmed output of:
# cat /var/log/cups/error_log | grep "^E" -B 100 -A 220

Let me know if you need any more

Comment 8 Tim Waugh 2012-02-27 16:53:59 UTC
Here are the interesting bits:

D [27/Feb/2012:17:07:06 +0200] [Job 2146] printer-state-reasons=�marker-supply-low-warning

Wonder what those strange characters are doing there?

D [27/Feb/2012:17:07:02 +0200] [Job 2146] prnt/hpcups/HPCupsFilter.cpp 493: cupsRasterOpen failed, fd = 0
D [27/Feb/2012:17:07:02 +0200] PID 19686 (/usr/lib/cups/filter/hpcups) stopped with status 1!
E [27/Feb/2012:17:07:02 +0200] PID 19685 (/usr/lib/cups/filter/pstoraster) crashed on signal 11!

This looks like the pstoraster process, i.e. ghostscript, crashed causing truncated output; that in turn caused hpcups to fail because it hadn't finished reading the CUPS Raster header.

It would be interesting to see whether Fedora 16 also fails in this way.  My guess is that it won't, and that bug #639593 is the root cause of the CentOS 6 failure.

Needinfo: whether pstoraster crashes in Fedora 16 too.

Comment 9 Jonathan Dieter 2012-02-27 18:11:11 UTC
I've just moved the printer server over to a Fedora 15 VM, but the printers themselves are powered down for the night.  I'll test in the morning and see if they work in landscape.  Thanks for the guidance!

Comment 10 Jonathan Dieter 2012-02-28 05:55:04 UTC
Ok, that did the trick.  I'm able to print just fine in both portrait and landscape using Fedora 15 as the print server.

I noticed that you reverted the patch in bug #639593.  Is there a working patch that can be applied to ghostscript-8.70?

Again, a huge thank you for your help.

Comment 11 Tim Waugh 2012-02-29 16:06:55 UTC
I think you want a26ed9754118ab5a6027346f2e4d0c41077dfc1c, but I expect it depends on earlier patches.

Closing as CURRENTRELEASE as currently supported versions of Fedora work correctly.

Comment 12 Jonathan Dieter 2012-02-29 19:33:24 UTC
Thanks again for your help.