Bug 689614 - Problem reading PDF file: Error: /rangecheck in --.type2execchar--
Summary: Problem reading PDF file: Error: /rangecheck in --.type2execchar--
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: 8.61
Hardware: PC Linux
: P2 normal
Assignee: Alex Cherepanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-14 09:52 UTC by Marcos H. Woehrmann
Modified: 2008-12-19 08:31 UTC (History)
0 users

See Also:
Customer: 384
Word Size: ---


Attachments
hack91.pdf (2.06 KB, application/pdf)
2007-12-24 19:50 UTC, Alex Cherepanov
Details
patch (1.46 KB, patch)
2007-12-30 22:04 UTC, Alex Cherepanov
Details | Diff
hack8l.pdf (2.31 KB, application/pdf)
2007-12-30 22:18 UTC, Alex Cherepanov
Details
patch 2 (2.58 KB, patch)
2007-12-31 14:42 UTC, Alex Cherepanov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos H. Woehrmann 2007-12-14 09:52:15 UTC
The customer reports and I've verified that gs8.54, gs8.61, and gshead (r8434)
report an error when reading the attached PDF file.  The 1766208.PDF file is the
original file, 1766208_simplified.pdf is a much simplified version and should
not need to be private (I've redacted all of the private text and cropped the page)/

The command line I used for testing:

  bin/gs -sDEVICE=bbox ./1766208_simplified.pdf

Note that gs8.54 produces the error messages in the bug summary; later versions
produce a more generic message: "/undefinedresult in --run--".
Comment 1 Marcos H. Woehrmann 2007-12-14 09:52:59 UTC
Created attachment 3630 [details]
1766208.PDF
Comment 2 Marcos H. Woehrmann 2007-12-14 09:53:31 UTC
Created attachment 3631 [details]
1766208_simplified.pdf
Comment 3 Alex Cherepanov 2007-12-24 19:50:25 UTC
Created attachment 3660 [details]
hack91.pdf

A really small sample file that sets degenerate text matrix and exercises a
composite font.
Comment 4 Alex Cherepanov 2007-12-30 22:04:40 UTC
Created attachment 3662 [details]
patch 

Don't try to obtain the bounding box of a glyph when FontBBox is not valid
and CTM is singular. Set an empty box and consider it valid. The bounding box
is not used when the CTM is singular.

Regression testing shows no differences.
Comment 5 Alex Cherepanov 2007-12-30 22:15:16 UTC
The patch is committed as a rev. 8466. It fixes the simplified sample file
(attachment #3 [details]) but the original sample file exposes one more bug - an
mix-up between stringwidth rendering and "3 Tr" PDF mode.
Comment 6 Alex Cherepanov 2007-12-30 22:18:05 UTC
Created attachment 3663 [details]
hack8l.pdf

PDF file that exercises "3 Tr" and singular CTM.
Comment 7 Alex Cherepanov 2007-12-31 14:42:12 UTC
Created attachment 3666 [details]
patch 2

Add a flag that marks PDF text rendering mode 3 to avoid confusion with other
non-rendering text operations such as stringwidth. This avoids unnecessary 
calculation of the current point, which fails when the CTM is singular. This
patch
continues conservative approach to the text rendering modes started in
rev. 4006.
Comment 8 Alex Cherepanov 2007-12-31 14:48:34 UTC
The patch 2 is committed as a rev. 8470. Regression testing shows no differences.