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 13:03:00 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
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 19:33:08 EDT
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 06:52:15 EDT
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 07:00:28 EDT
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 07:16:47 EDT
Confirmed: With those two patches applied to the rawhide package, printing via
pksmraw works again.
Comment 4 Tim Waugh 2007-09-27 07:38:21 EDT
Please try ghostscript-8.60-3.fc8.
Comment 5 David Woodhouse 2007-09-27 08:10:34 EDT
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 08:18:58 EDT
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 05:41:40 EDT
This (or something like it) is happening again with 8.62.
Comment 8 David Woodhouse 2008-03-26 07:54:05 EDT
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 07:55:09 EDT
Created attachment 299132 [details]
/usr/share/foo2zjs/crd/prolog.ps
Comment 10 David Woodhouse 2008-03-26 07:55:56 EDT
Created attachment 299133 [details]
mozilla.ps
Comment 11 David Woodhouse 2008-03-26 09:52:52 EDT
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 12:39:38 EDT
This corresponds with SVN revision 8484.
Comment 13 David Woodhouse 2008-03-26 13:15:08 EDT
(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 09:42:07 EDT
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 13:03:00 EDT
Should be fixed in ghostscript-8.62-3.fc9 then.  Thanks for tracking it down.
Comment 16 Tim Waugh 2008-04-01 04:51:50 EDT
Fixed in Fedora 8 test update as well: ghostscript-8.62-3.fc8.