Bug 1749661

Summary: Error OFFENDING command STACK: in outputted postscript file
Product: [Fedora] Fedora Reporter: Zdenek Dohnal <zdohnal>
Component: ghostscriptAssignee: Martin Osvald 🛹 <mosvald>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: deekej, mosvald, twaugh, zdohnal
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-09-06 10:21:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Input pdf (outputted from pdftopdf filter)
none
Output of gs - with error in it none

Description Zdenek Dohnal 2019-09-06 07:37:23 UTC
Created attachment 1612225 [details]
Input pdf (outputted from pdftopdf filter)

Hi,

I was debugging https://bugzilla.redhat.com/show_bug.cgi?id=1716582 and I found out user's pdf file got bad after running through gs.
When you open it in 'gs' - you can see that error sometimes, but if you open it in text editor, you can see the error clearly:

(ERROR: )//prnt exec errorname//prnt exec
(OFFENDING COMMAND: )//prnt exec
/command load//prnt exec
$error/ostack known{
(%%[STACK:)=
(STACK:)//prnt exec

I got the input pdf by running pdftopdf filter by hand, I'll attach it to ticket.
I'm not sure how would be output on user's printer, but when I printed out the output on canon imagerunner (with canon-imagerunner_C5185i postscript ppd), the headline got garbled.

Version-Release number of selected component (if applicable):
ghostscript-9.26-5fc29

Steps to Reproduce:
gs -q -dNOPAUSE -dBATCH -dSAFER -dNOMEDIAATTRS -sDEVICE=ps2write -dShowAcroForm -sOUTPUTFILE=out2.ps -dLanguageLevel=3 -r600 -dCompressFonts=false -dNoT3CCITT -dNOINTERPOLATE -c 'save pop' -f out1.pdf

Actual results:
Error in postscript file, resulting in garbled document

Expected results:
No error, good printout document

Comment 1 Zdenek Dohnal 2019-09-06 07:38:58 UTC
Created attachment 1612226 [details]
Output of gs - with error in it

Comment 2 Martin Osvald 🛹 2019-09-06 09:26:53 UTC
It would be good to get the exact error the mentioned ps code prints to stdout because the generated code looks correct.

I just compared the produced code on our 9.26-5 and it is exactly the same as for the current upstream master/b5e5ed8620f348e0fa619171d6f05a966a4bcf83.

~~~
$ diff -y --suppress-common-lines  master-b5e5ed8620f348e0fa619171d6f05a966a4bcf83-out2.ps out2-error-from-BZ.ps 
%%Invocation: gs -q -dNOPAUSE -dBATCH -dSAFER -dNOMEDIAATTRS  <
%%Creator: GPL Ghostscript GIT PRERELEASE 929 (ps2write)      | %%Creator: GPL Ghostscript 926 (ps2write)
%%CreationDate: D:20190906044406-04'00'                       | %%CreationDate: D:20190906083545+02'00'
pagesave restore                                              <
/pagesave save def                                            <
                                                              > /pagesave save def
                                                              > pagesave restore
                                                              > %%PageTrailer
$
~~~

and when displaying both of them through gs they show all the elements correctly/the same like it is with the input pdf file.

It looks as if the problem with mangled page arose somewhere else during the process of printing.

Comment 3 Zdenek Dohnal 2019-09-06 10:21:14 UTC
I'm sorry the garbled pdf was actually caused by sending a file which was preprocessed with other driver than driver which was used for printing.

Meaning:
I ran filters which created pdf file for one ppd, but then I printed result with other ppd.