Bug 689707

Summary: Error reading PDF: /rangecheck in --cvrs--
Product: Ghostscript Reporter: Marcos H. Woehrmann <marcos.woehrmann>
Component: PDF InterpreterAssignee: Alex Cherepanov <alex>
Status: NOTIFIED FIXED    
Severity: normal    
Priority: P1    
Version: master   
Hardware: PC   
OS: All   
Customer: 531 Word Size: ---
Attachments: simplified sample file
patch

Description Marcos H. Woehrmann 2008-02-14 14:22:11 UTC
The customer reports and I've verified that the attached PDF file produces an
error when read by Ghostscript (customer is using 8.61, but head (r8526) also
fails).  The error message in the summary is from 8.54, more recent versions
report the less informative "/undefined in --run--".

The command line I'm using for testing:

  bin/gs -sDEVICE=ppmraw -o test.ppm ./5957-64.pdf

Acrobat Reader 8.0 and evince can read the file without problem.

Here's the complete output using gs8.61:

GPL Ghostscript 8.61 (2007-11-21)
Copyright (C) 2007 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
   **** Warning:  File has an invalid xref entry:  5.  Rebuilding xref table.
Processing pages 1 through 1.
Page 1
Error: /undefined in --run--
Operand stack:
   --nostringval--   --dict:6/15(L)--   F16   1   --dict:9/18(L)--  
--dict:9/18(L)--   20800   --dict:9/18(L)--   --dict:11/11(L)--   cmap
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:1144/1684(ro)(G)--   --dict:2/20(G)--   --dict:75/200(L)--  
--dict:75/200(L)--   --dict:107/127(ro)(G)--   --dict:275/300(ro)(G)--  
--dict:24/25(L)--   --dict:4/6(L)--   --dict:27/40(L)--   --dict:40/50(ro)(G)--
  --dict:31/40(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript 8.61: Unrecoverable error, exit code 1
Comment 1 Marcos H. Woehrmann 2008-02-14 14:22:46 UTC
Created attachment 3789 [details]
5957-64.pdf
Comment 2 Alex Cherepanov 2008-02-14 19:58:03 UTC
This is yet another case of a TrueType font without a cmap table.
We need to discuss what to do with such fonts.
Comment 3 Alex Cherepanov 2008-02-16 18:45:12 UTC
Created attachment 3793 [details]
simplified sample file

This PDF file exercises a TrueType font without a cmap table.
Acrobat Reader seems to use post table in this case.
Comment 4 Alex Cherepanov 2008-02-25 23:51:31 UTC
Created attachment 3817 [details]
patch

Use identity cmap if it is missing from the TT file. Use unknown language
ID to activate in post table processing.

To avoid false positives run validation of post table to the files produced
by the same software as the reported sample file.
Comment 5 Alex Cherepanov 2008-02-28 06:57:48 UTC
The path is committed as a rev. 8556.
Regression testing shows no differences.