Bug 690090 - Error: /rangecheck in resolveobjectstream
Summary: Error: /rangecheck in resolveobjectstream
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PS Interpreter (show other bugs)
Version: master
Hardware: Macintosh MacOS X
: P2 normal
Assignee: Alex Cherepanov
URL:
Keywords:
: 690107 690194 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-09-23 12:30 UTC by Marcos H. Woehrmann
Modified: 2008-12-19 08:31 UTC (History)
2 users (show)

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


Attachments
4356482r.pdf (21.16 KB, application/pdf)
2008-09-23 12:31 UTC, Marcos H. Woehrmann
Details
hack3.ps (2.56 KB, application/postscript)
2008-09-28 21:25 UTC, Alex Cherepanov
Details
PDFReference16.pdf (8.72 MB, application/pdf)
2008-09-30 12:03 UTC, Marcos H. Woehrmann
Details
patch (361 bytes, patch)
2008-10-05 22:06 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 2008-09-23 12:30:48 UTC
The customer reports and I've verified that Ghostscript head (r9115) cannot open the attache file, 
reporting: "Error: /rangecheck in resolveobjectstream".

The command line I'm using for testing:

  bin/gs -sDEVICE=tiff24nc -o test.tif ./4356482r.pdf

I've simplified the file as much as possible.  Here's the output using -dPDFDEBUG:

GPL Ghostscript SVN PRE-RELEASE 8.64 (2008-08-02)
Copyright (C) 2008 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
<<
/Length 52 /Root 34 0 R
/ID [
(\244\271\255j\276\267\317@\256\370\241q\250`r\026) 
(\272\357\t\256\335yGo\263k4:\254\276\206\211) ]
/Info 32 0 R
/Filter /FlateDecode /W [
1 2 0 ]
/Index [
0 1 3 1 32 1 35 1 76 95 191 3 ]
/DecodeParms <<
/Columns 3 /Predictor 12 >>
/Size 194 /Prev 16431 /Type /XRef >>
%FilePosition: 21572
<<
/Length 51 /Root 34 0 R
/ID [
(\244\271\255j\276\267\317@\256\370\241q\250`r\026) 
(\252\267C,\326\023D\357\226\373\355\373-\375?\333) ]
/Info 32 0 R
/Filter /FlateDecode /W [
1 2 0 ]
/Index [
0 1 3 1 32 1 35 1 76 95 180 3 ]
/DecodeParms <<
/Columns 3 /Predictor 12 >>
/Size 183 /Prev 116 /Type /XRef >>
%FilePosition: 16692
<<
/Length 55 /Root 34 0 R
/ID [
(\244\271\255j\276\267\317@\256\370\241q\250`r\026) 
(oZ\034~\225\355Bd\200\264O\361\356\333\325b) ]
/Info 32 0 R
/Filter /FlateDecode /W [
1 2 1 ]
/Index [
33 43 ]
/DecodeParms <<
/Columns 4 /Predictor 12 >>
/Size 76 /Prev 11649 /Type /XRef >>
%FilePosition: 353
<<
/Length 56 /Filter /FlateDecode /W [
1 2 1 ]
/Index [
0 33 ]
/DecodeParms <<
/Columns 4 /Predictor 12 >>
/Size 33 /Type /XRef >>
%FilePosition: 11776
%Resolving: [34 0]
<<
/Names 41 0 R
/Outlines 7 0 R
/Metadata 3 0 R
/Pages 21 0 R
/SpiderInfo 27 0 R
/Type /Catalog >>
endobj
%Resolving: [21 0]
%Resolving object stream: %Resolving: [4 0]
<<
/First 72 /Length 365 /Filter /FlateDecode /N 11 /Type /ObjStm >>
stream
%FilePosition: 11040
endobj
%Resolving compressed object: [21 0]
<< /Kids [{35 0 resolveR}] /Type /Pages /Count 1 >>
%Resolving compressed object: [22 0]
<< /Names [{72 0 resolveR} {25 0 resolveR}] >>
%Resolving compressed object: [23 0]
<< /Names [{24 0 resolveR} {25 0 resolveR}] >>
%Resolving compressed object: [24 0]
(https://entp.hud.gov/clas/html/f17cvrs.cfm)
%Resolving compressed object: [25 0]
<< /O [{35 0 resolveR}] /ID {72 0 resolveR} /SI {26 0 resolveR} /CT (text/html) /S /SPS /T 
(\376\377\000C\000A\000I\000V\000R\000S\000 
\000A\000u\000t\000h\000o\000r\000i\000z\000a\000t\000i\000o\000n) /TS 
(D:20080918140401Z) >>
%Resolving compressed object: [26 0]
<< /AU {24 0 resolveR} /TS (D:20080918140401Z) >>
%Resolving compressed object: [27 0]
<< /C {28 0 resolveR} /V 1.25 >>
%Resolving compressed object: [28 0]
[{29 0 resolveR}]
%Resolving compressed object: [29 0]
<< /S {30 0 resolveR} /URL (https://entp.hud.gov/clas/html/f17cvrs.cfm) >>
%Resolving compressed object: [30 0]
<< /G {31 0 resolveR} /C << >> >>
%Resolving compressed object: [31 0]
<< /AS 1 /AL 0 /CP (utf-8) /M [10.008 10.008 25.992 36.0] /CB 1 /AT 70 /SU 1 /AH 1 /HTST 15 /PS 
[792.0 612.0] /S 0 /JVSC 1 /PO 0 >>
%Resolving: [35 0]
<<
/CropBox [
0.0 0.0 612.0 792.0 ]
/Annots 42 0 R
/Parent 21 0 R
/ID 72 0 R
/Contents 191 0 R
/Rotate 0 /PZ 1.0 /Group 73 0 R
/MediaBox [
0.0 0.0 612.0 792.0 ]
/Resources <<
/ColorSpace <<
/CS0 63 0 R
>>
/Font <<
/TT0 65 0 R
/TT1 67 0 R
/TT2 71 0 R
>>
/ProcSet [
/PDF /Text ]
>>
/Type /Page >>
endobj
%Resolving: [34 0]
%Resolving: [21 0]
%Resolving: [34 0]
%Resolving: [34 0]
%Resolving: [21 0]
Processing pages 1 through 1.
Page 1
%Resolving: [34 0]
%Resolving: [21 0]
%Resolving: [35 0]
%Resolving: [35 0]
%Resolving: [35 0]
%Resolving: [35 0]
%Resolving: [35 0]
%Resolving: [63 0]
%Resolving object stream: %Resolving: [36 0]
<<
/First 262 /Length 2277 /Filter /FlateDecode /N 34 /Type /ObjStm >>
stream
%FilePosition: 1135
endobj
   **** File has an unbalanced >> (close dictionary).
   **** File has an unbalanced >> (close dictionary).
   **** File has an unbalanced >> (close dictionary).
   **** File has an unbalanced >> (close dictionary).
   **** Incorrect object count in object stream.
Error: /rangecheck in resolveobjectstream
Operand stack:
   --nostringval--   --dict:11/11(L)--   --dict:48/48(ro)(L)--   --nostringval--   PageSpotColors   --
dict:11/11(L)--   --dict:0/0(L)--   --dict:1/4(L)--   --dict:3/3(L)--   11657   22   63   --dict:7/15(L)--   
34   --nostringval--   true   --nostringval--   --dict:3/3(L)--   --nostringval--   --dict:6/6(L)--   --
dict:6/6(L)--   --dict:6/6(L)--   --dict:6/6(L)--   --dict:6/6(L)--   --dict:6/6(L)--   --dict:6/6(L)--   -
-dict:6/6(L)--   --dict:6/6(L)--   --nostringval--   Rect   --nostringval--   Subtype   Link   BS   --
dict:3/3(L)--   A   --nostringval--   URI   (https://entp.hud.gov/clas/html/f17case.cfm)   S      URI   
Border   --nostringval--   Type   Annot   --dict:6/6(L)--   --dict:6/6(L)--   --dict:6/6(L)--   --
dict:6/6(L)--   --dict:6/6(L)--   --nostringval--   Rect   --nostringval--   Subtype   Link   BS   --
nostringval--   S   S   W   0   TypeBorder   A   --dict:2/2(L)--   Border   --nostringval--   Type   Annot   -
-dict:6/6(L)--   --dict:6/6(L)--   --dict:6/6(L)--   --dict:6/6(L)--   --nostringval--   --dict:13/13(L)-
-   --dict:8/8(L)--   --dict:13/13(L)--   --dict:8/8(L)--   --dict:13/13(L)--   --dict:8/8(L)--   --
dict:13/13(L)--   --dict:8/8(L)--   (\177\366\374/\213\b.x\307\340\324\202\230\025\222Z)   --
dict:2/2(L)--   --nostringval--
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   -
-nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1830   1   3   
%oparray_pop   1829   1   3   %oparray_pop   1813   1   3   %oparray_pop   --nostringval--   --
nostringval--   2   1   1   --nostringval--   %for_pos_int_continue   --nostringval--   --nostringval--   -
-nostringval--   --nostringval--   --nostringval--   %loop_continue   --nostringval--   --dict:1/1(L)-
-   --nostringval--   1   %dict_continue   --nostringval--   --nostringval--   --nostringval--   --
nostringval--
Dictionary stack:
   --dict:1142/1684(ro)(G)--   --dict:1/20(G)--   --dict:74/200(L)--   --dict:74/200(L)--   --
dict:106/127(ro)(G)--   --dict:277/300(ro)(G)--   --dict:23/25(L)--   --dict:5/5(L)--
Current allocation mode is local
GPL Ghostscript SVN PRE-RELEASE 8.64: Unrecoverable error, exit code 1
Comment 1 Marcos H. Woehrmann 2008-09-23 12:31:06 UTC
Created attachment 4417 [details]
4356482r.pdf
Comment 2 Alex Cherepanov 2008-09-28 21:25:11 UTC
Created attachment 4440 [details]
hack3.ps

This is a bug in the /ReusableStreamDecode filter or its interaction
with operator token. This bug has been introduced in v. 8.63.

The sample file fails on v. 8.63 with '/undefined in URI' but works fine on
v. 8.62 or without /ReusableStreamDecode filter.
Comment 3 Marcos H. Woehrmann 2008-09-29 08:52:00 UTC
Sorry for not checking earlier versions.  This stopped working in r8810:

r8810 | alexcher | 2008-06-29 17:05:40 -0700 (Sun, 29 Jun 2008) | 8 lines

Add one more way to store data of the reusable stream: an array of strings.
Read the input stream into an array of strings during reusable stream
construction and use the array directly as a data storage.
Bug 689476, customer 190.

Comment 4 Marcos H. Woehrmann 2008-09-30 12:03:14 UTC
Created attachment 4451 [details]
PDFReference16.pdf

A different customer sent us this file as another one with the same problem.
Comment 5 Alex Cherepanov 2008-10-05 21:51:36 UTC
*** Bug 690107 has been marked as a duplicate of this bug. ***
Comment 6 Alex Cherepanov 2008-10-05 22:06:43 UTC
Created attachment 4468 [details]
patch

Take into account the data left in the stream buffer
before refilling the buffer.
Comment 7 Alex Cherepanov 2008-10-17 20:13:33 UTC
The patch is committed as a rev. 9172.
Regression testing show no differences.
Comment 8 Alex Cherepanov 2008-12-08 15:44:02 UTC
*** Bug 690194 has been marked as a duplicate of this bug. ***