Bug 308211

Summary: pksmraw output produces blank pages
Product: [Fedora] Fedora Reporter: David Woodhouse <dwmw2>
Component: ghostscriptAssignee: Tim Waugh <twaugh>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideKeywords: Reopened
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 8.62-3.fc9 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-03-31 17:03:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 235705    
Attachments:
Description Flags
/usr/share/foo2zjs/crd/prolog.ps
none
mozilla.ps none

Description David Woodhouse 2007-09-26 23:33:08 UTC
The foo2zjs print driver uses pksmraw output from Ghostscript.
Since updating to rawhide, I seem to just get blank pages.

I am testing http://david.woodhou.se/testpage.ps with the following command line:

 gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE -sPAPERSIZE=a4 -g9920x7016 -r1200x600
-sDEVICE=pksmraw -dCOLORSCREEN -sOutputFile=testpage.pksmraw testpage.ps

The Gimp seems able to open the resulting file and display _something_, although
it isn't actually correct. It does seem to confirm that the output is entirely
white with ghostscript 8.60 on rawhide, while reverting to 8.15 from F7 makes it
work again. Testing it with the printer right now would make me unpopular, but
I'll verify in the morning that the whole printing process with 8.15 is working
again.

Comment 1 David Woodhouse 2007-09-27 10:52:15 UTC
Putting ghostscript into a sensible version control system and then using
git-bisect seems to indicate that it's fixed in HEAD, and it's fixed by this
patch:
http://git.infradead.org/?p=ghostscript.git;a=commitdiff;h=0513d1b9542d37e7134d36e49222b12ef469b722

Comment 2 David Woodhouse 2007-09-27 11:00:28 UTC
Building a modified 8.60 package with that patch to test.... it seems that
commit dc01761c07d210974d829c35c33a8886c33b0488 is also required.

Comment 3 David Woodhouse 2007-09-27 11:16:47 UTC
Confirmed: With those two patches applied to the rawhide package, printing via
pksmraw works again.

Comment 4 Tim Waugh 2007-09-27 11:38:21 UTC
Please try ghostscript-8.60-3.fc8.

Comment 5 David Woodhouse 2007-09-27 12:10:34 UTC
Works here; thanks. No real clue _why_ this failure mode happens though.

Comparing strace of each version seems to have a lot of '+read(3,...' where the
8.60-3 version reads stuff back from the first tempfile it opens, while the
8.60-2 version doesn't _ever_ actually read back from that file AFAICT.

I'm slightly concerned that we're just papering over a bug which still persists.

http://david.woodhou.se/gs-strace-8.60-2.txt
http://david.woodhou.se/gs-strace-8.60-3.txt

Comment 6 Tim Waugh 2007-09-27 12:18:58 UTC
I think the main thing the patch changes is to switch to the LARGEFILE code, so
I think it's probably just that there's a bug in the non-largefile code (which
we're no longer using).

Comment 7 Tim Waugh 2008-03-26 09:41:40 UTC
This (or something like it) is happening again with 8.62.

Comment 8 David Woodhouse 2008-03-26 11:54:05 UTC
I think it's a different problem. ghostscript-8.61-8.fc8 from F8 updates seems
OK, but ghostscript-8.62-2.fc8 from updates-testing (and 8.62 from rawhide) are
producing blank pages for the following:

gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE -sPAPERSIZE=a4 -g4960x7016 -r600x600
-sDEVICE=pksmraw -dCOLORSCREEN -sOutputFile=mozilla.pksmraw
/usr/share/foo2zjs/crd/prolog.ps mozilla.ps


Comment 9 David Woodhouse 2008-03-26 11:55:09 UTC
Created attachment 299132 [details]
/usr/share/foo2zjs/crd/prolog.ps

Comment 10 David Woodhouse 2008-03-26 11:55:56 UTC
Created attachment 299133 [details]
mozilla.ps

Comment 11 David Woodhouse 2008-03-26 13:52:52 UTC
git-bisect seems to suggest that it's caused by this commit: 

http://git.infradead.org/ghostscript.git?a=commitdiff;h=9513978e3ee397072bc81548b87cc0f5f87a1b1f

Comment 12 Tim Waugh 2008-03-26 16:39:38 UTC
This corresponds with SVN revision 8484.

Comment 13 David Woodhouse 2008-03-26 17:15:08 UTC
(In reply to comment #12)
> This corresponds with SVN revision 8484.

Judging by the 'git-svn-id' in the git copy, isn't revision 8484 the fifth step
in that sequence of patches? The one which introduces the problem is step 3,
which I believe to be revision 8426.


Comment 14 David Woodhouse 2008-03-27 13:42:07 UTC
This seems to fix it for me:

--- a/src/gxclrast.c
+++ b/src/gxclrast.c
@@ -2399,8 +2406,6 @@ static int apply_create_compositor(gx_device_clist_reader
*cdev, gs_imager_state
         rc_increment(tdev);
         *ptarget = tdev;
     }
-    if (code < 0)
-        return code;
 
     /* Perform any updates for the clist device required */
     code = pcomp->type->procs.clist_compositor_read_update(pcomp,


Comment 15 Tim Waugh 2008-03-31 17:03:00 UTC
Should be fixed in ghostscript-8.62-3.fc9 then.  Thanks for tracking it down.

Comment 16 Tim Waugh 2008-04-01 08:51:50 UTC
Fixed in Fedora 8 test update as well: ghostscript-8.62-3.fc8.