Bug 692386 - Regression: PostScript file generated by Ghostscript cannot be read by Ghostscript starting with 5e292c6c611659105f9bbc50ad33518c97a1923d
Summary: Regression: PostScript file generated by Ghostscript cannot be read by Ghosts...
Status: RESOLVED DUPLICATE of bug 692033
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Regression (show other bugs)
Version: master
Hardware: PC Linux
: P2 normal
Assignee: Alex Cherepanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-01 18:44 UTC by Marcos H. Woehrmann
Modified: 2011-09-04 01:13 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos H. Woehrmann 2011-08-01 18:44:30 UTC
Starting with 5e292c6c611659105f9bbc50ad33518c97a1923d the following command produce an error:

 ./bin/gs -o test.ps -sDEVICE=ps2write -r300 ./Bug6901014_Fourth_crash_signature_testcase.pdf
 ./bin/gs -o test.pkm -sDEVICE=pkmraw -r300 ./test.ps

The error message:

GPL Ghostscript GIT PRERELEASE 9.05 (2011-03-30)
Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Data left on ostack after an immediate stream execution.
%%[ Error handled by opdfread.ps : undefined; OffendingCommand: ....Undefined ]%%
Loading NimbusMonL-Regu font from %rom%Resource/Font/NimbusMonL-Regu... 3767784 2435907 12994600 10995745 2 done.
%%[STACK:
918
-mark-
-mark-
-mark-
%%]%
Comment 2 Ken Sharp 2011-08-02 10:32:31 UTC
(In reply to comment #0)
> Starting with 5e292c6c611659105f9bbc50ad33518c97a1923d the following command
> produce an error:
> 
>  ./bin/gs -o test.ps -sDEVICE=ps2write -r300
> ./Bug6901014_Fourth_crash_signature_testcase.pdf
>  ./bin/gs -o test.pkm -sDEVICE=pkmraw -r300 ./test.ps
> 
> The error message:
> 
> GPL Ghostscript GIT PRERELEASE 9.05 (2011-03-30)
> Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
> This software comes with NO WARRANTY: see the file PUBLIC for details.
> Data left on ostack after an immediate stream execution.
> %%[ Error handled by opdfread.ps : undefined; OffendingCommand: ....Undefined
> ]%%
> Loading NimbusMonL-Regu font from %rom%Resource/Font/NimbusMonL-Regu... 3767784
> 2435907 12994600 10995745 2 done.
> %%[STACK:
> 918
> -mark-
> -mark-
> -mark-
> %%]%

This is not caused, precisely, by the commit. This exposes an underlying issue with either the LZWEncode or LZWDecode filter. If -dCompressPages=false then the file runs correctly. If I decode the Encoded data then I see that the page stream ends:

2894 755.668 l
S
Q
Q
918 

The '918' is spurious and is not present if the file is not compressed. If you change the resolution, this causes the exact data to be compressed to alter (because the stream contains an inline image) which makes the problem go away.

This is also why the problem apparently exhibits with this commit, it makes the compressed data stream slightly smaller (two setgray operators are elided) and that triggers the bug.

I believe we already have outstanding bug reports against compression/decompression filters and this seems to be another case of the same bug. I don't know who this should be assigned to, but its not a ps2write problem per se, so I'm re-assigning to support.
Comment 3 Alex Cherepanov 2011-09-04 01:13:53 UTC
This bug has been fixed by the rev. 42582272f2b4dce1ccd5c600a2d6dc71794b4d3e
See the bug 692033 for details.

*** This bug has been marked as a duplicate of bug 692033 ***