Bug 689842 - /typecheck in --run--
Summary: /typecheck in --run--
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: 8.62
Hardware: PC Windows XP
: P2 normal
Assignee: Alex Cherepanov
URL:
Keywords:
: 690114 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-05-14 02:19 UTC by artifex
Modified: 2008-12-19 08:31 UTC (History)
1 user (show)

See Also:
Customer: 870
Word Size: ---


Attachments
page13.pdf (76.13 KB, application/pdf)
2008-05-14 02:20 UTC, artifex
Details

Note You need to log in before you can comment on or make changes to this bug.
Description artifex 2008-05-14 02:19:55 UTC
The conversion of the file page13.pdf to PDF with following command:

gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=out.pdf page13.pdf


fails with error message:

Error: /typecheck in --run--
Operand stack:
   --nostringval--   --dict:6/15(L)--   F12+1   3.84   --dict:10/19(L)--  
--dict:10/19(L)--   --dict:12/16(ro)(L)--   --nostringval--   --dict:10/19(L)--
  --dict:12/16(ro)(L)--   --nostringval--   68713   --nostringval--   CMapName
Execution stack:
Comment 1 artifex 2008-05-14 02:20:59 UTC
Created attachment 4015 [details]
page13.pdf
Comment 2 Alex Cherepanov 2008-05-14 12:16:28 UTC
An CMap stream in the sample file has a name that starts with 2 slash
characters but should not be parsed as an immediately evaluated name.
So it's an PDF interpreter issue.
Comment 3 Ray Johnston 2008-05-15 09:48:21 UTC
Sounds like a job for PDFScanRules
Comment 4 Alex Cherepanov 2008-05-16 05:53:24 UTC
Use PDFScanRules to scan ToUnicode CMap. Fix a case where CMap stream has
a name starting with 2 slashes that should not be parsed as an immediately
evaluated name.

The following patch is committed as a rev. 8742.
http://ghostscript.com/pipermail/gs-cvs/2008-May/008321.html
Regression testing shows no differences.
Comment 5 Alex Cherepanov 2008-05-16 05:56:24 UTC
Restoring the accidentally changed priority.
 
Comment 6 artifex 2008-06-10 05:08:08 UTC
I activated the patch ( rev. 8742 ), but the behaviour does not change !
The conversion of the file page13.pdf still fails. 
Comment 7 Alex Cherepanov 2008-06-11 08:51:47 UTC
I confirm that the patch doesn't fix the bug. It just replaces one error with
another error.

To fix this bug we need a streamlined parser that searches for keywords
in the CMap stream and ignores most of PostScript syntax. This is what
Acrobat Reader does. Removing of all def operators from CMap or replacing
them with random junk leaves the CMap readable for Acrobat Reader.
Comment 8 Alex Cherepanov 2008-10-09 06:31:00 UTC
*** Bug 690114 has been marked as a duplicate of this bug. ***
Comment 9 Alex Cherepanov 2008-11-24 15:08:12 UTC
Skip everything before 'begincodespacerange' in ToUnicode CMap stream
to avoid PostScript errors in CMap headers. PDF interpreter doesn't
need any data from the header. Bug 689842, customer 870.

Local testing shows no raster differences.
Ghostscript no longer detects and reports any errors in the CMap header.

The following patch is committed as a rev. 9240
http://ghostscript.com/pipermail/gs-cvs/2008-November/008819.html