Bug 690114

Summary: /ToUnicode or /CMapName with // (double slash) error: /typecheck in --run--
Product: Ghostscript Reporter: Piotr Strzelczyk <piotr>
Component: PDF WriterAssignee: Ken Sharp <ken.sharp>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P4    
Version: 8.63   
Hardware: PC   
OS: All   
Customer: Word Size: ---
Attachments: sample-error
sample-fixed

Description Piotr Strzelczyk 2008-10-09 05:08:40 UTC
Uploaded you'll find two sample PDF files:

* one of them, SAMPLE1.pdf (created by XeTeX), apparently properly formed
  (Acrobat Reader and GS display it properly) -- cannot be repeatedly
  distilled using Ghostscript -- GS (8.63) reports the following error
  (output other than pdfwrite work OK):

Error: /typecheck in --run--
Operand stack:
  --nostringval--   --dict:8/17(L)--   F1   9.963   --dict:6/6(L)--
  --dict:6/6(L)--   VEHHKD+LMRoman10-Regular-Identity-H   --dict:9/10(L)--
  --dict:6/6(L)--   --dict:9/10(L)--   --nostringval--   --dict:1/1(L)--
  4511   CMapName      usr   local   share   --nostringval--   fonts
Execution stack:
  %interp_exit   .runexec2   --nostringval--   --nostringval--
  --nostringval--   2   %stopped_push   --nostringval--   --nostringval--
  --nostringval--   false   1   %stopped_push   1905   1   3   %oparray_pop
  1904   1   3   %oparray_pop   1888   1   3   %oparray_pop   --nostringval--
  --nostringval--   2   1   1   --nostringval--   %for_pos_int_continue
  --nostringval--   --nostringval--   --nostringval--   --nostringval--
  %array_continue   --nostringval--   false   1   %stopped_push
  --nostringval--   %loop_continue   --nostringval--   --nostringval--
  --nostringval--   --nostringval--   --nostringval--   --nostringval--
  --nostringval--
Dictionary stack:
  --dict:1146/1684(ro)(G)--   --dict:1/20(G)--   --dict:76/200(L)--
  --dict:76/200(L)--   --dict:106/127(ro)(G)--   --dict:275/300(ro)(G)--
  --dict:22/25(L)--   --dict:4/6(L)--   --dict:22/40(L)--   --dict:5/5(L)--
  --dict:6/8(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript 8.63: Unrecoverable error, exit code 1

* the second sample resulted from the first one by removing
  the entry /ToUnicode from the font dictionary -- this PDF
  can be distilled without problems

This report probably is confirmation of bug 689842.

Best regards -- Piotr Strzelczyk
Comment 1 Piotr Strzelczyk 2008-10-09 05:11:14 UTC
Created attachment 4480 [details]
sample-error

This file causes the error
Comment 2 Piotr Strzelczyk 2008-10-09 05:11:57 UTC
Created attachment 4481 [details]
sample-fixed

This sample can be distilled
Comment 3 Ken Sharp 2008-10-09 05:17:50 UTC
Going by the comments from Alex in bug #689842, this is almost certainly the
same problem, and should be a PDF Interpreter problem, not a PDF writer issue.

I won't mark it as a duplicate, because I haven't checked.
Comment 4 Alex Cherepanov 2008-10-09 06:30:55 UTC
This case of CMap syntax abuse is worse than anything we have seen before.

/CMapName //usr/local/share/fonts/lm-o/lmroman10-regular.otf,000-UTF16 def

However the fix is still the same: search for keywords and ignore
all PostScript cruft.


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