Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 4 product line. The current stable release is 4.9. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 418051

Summary: ps2pdf fails with some ps files
Product: Red Hat Enterprise Linux 4 Reporter: Jose Plans <jplans>
Component: ghostscriptAssignee: Tim Waugh <twaugh>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.8CC: pknirsch, tao
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
* The ps2pdf program could fail with an invalidfont error in some circumstances. This was due to the package being built with strict variable aliasing optimizations in place. The version of ps2pdf provided with this advisory is built without these optimizations and does not fail under these circumstances.
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-05-18 20:03:47 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: 465960    
Attachments:
Description Flags
test case none

Description Jose Plans 2007-12-10 13:34:14 UTC
Description of problem:

When using ps2pdf to convert ps files generated with Oracle Toolkit 2 for Motif
6.0.8.24.0 to pdf, this one fails with
the following error:

---
Error: /invalidfont in --show--
Operand stack:
  --nostringval--   --nostringval--
Execution stack:
  %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--
  2   %stopped_push   --nostringval--   --nostringval--   --nostringval--  
false   1   %stopped_push   1   3   %oparray_pop   1   3   %oparray_pop   1   3
  %oparray_pop   1   3   %oparray_pop   .runexec2   --nostringval--  
--nostringval--   --nostringval--   2   %stopped_push   --nostringval--  
--nostringval--   --nostringval--
Dictionary stack:
  --dict:1063/1123(ro)(G)--   --dict:0/20(G)--   --dict:198/200(L)--
Current allocation mode is local
Last OS error: 2
Current file position is 57249
GNU Ghostscript 7.07: Unrecoverable error, exit code 1
---

This instruction show fails if used with embedded fonts defined within the
postcript document and when trying to show a
character non-defined. The failing postscript instruction is then "()SH" being
SH defined to "show".

Two workarounds have been provided:

cat file.ps | sed -e 's/()SH//' > new.file.ps

or

cat file.ps | sed -e 's/()SH/save ()SH/' > new.file.ps

Also this seems to work correctly on version >8 of ghostscript.


Version-Release number of selected component (if applicable):
7.0.7

How reproducible:
Always.

Steps to Reproduce:
1. Use Oracle Toolkit 2 -or- this document attached.
2. run ps2pdf against the ps file
  
Actual results:
---
Error: /invalidfont in --show--
Operand stack:
  --nostringval--   --nostringval--
Execution stack:
  %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--
  2   %stopped_push   --nostringval--   --nostringval--   --nostringval--  
false   1   %stopped_push   1   3   %oparray_pop   1   3   %oparray_pop   1   3
  %oparray_pop   1   3   %oparray_pop   .runexec2   --nostringval--  
--nostringval--   --nostringval--   2   %stopped_push   --nostringval--  
--nostringval--   --nostringval--
Dictionary stack:
  --dict:1063/1123(ro)(G)--   --dict:0/20(G)--   --dict:198/200(L)--
Current allocation mode is local
Last OS error: 2
Current file position is 57249
GNU Ghostscript 7.07: Unrecoverable error, exit code 1
---

Expected results:
After a while, prompt is back and we can print.

Additional info:
I couldn't get any deeper. There are many theories I followed in the font stack
code but without the expertise I cannot
decide whether this is a bug on the application or ghostscript or if a change
upstream made this disappear.

Attached is a test case that reproduces the issue.
Let me know if you need more informations.

Comment 1 Jose Plans 2007-12-10 13:34:15 UTC
Created attachment 282761 [details]
test case

Comment 3 RHEL Program Management 2008-09-05 17:07:27 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 14 Ruediger Landmann 2009-01-14 06:45:04 UTC
Release note added. If any revisions are required, please set the 
"requires_release_notes" flag to "?" and edit the "Release Notes" field accordingly.
All revisions will be proofread by the Engineering Content Services team.

New Contents:
* The ps2pdf program could fail with an invalidfont error in some circumstances.  This was due to the package being built with strict variable aliasing optimizations in place. The version of ps2pdf provided with this advisory is built without these optimizations and does not fail under these circumstances.

Comment 15 errata-xmlrpc 2009-05-18 20:03:47 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-0949.html