Bug 690336 - Unrecoverable Error When Appending PDF
Summary: Unrecoverable Error When Appending PDF
Status: RESOLVED INVALID
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Writer (show other bugs)
Version: 8.63
Hardware: Other Linux
: P4 normal
Assignee: Ken Sharp
URL: http://www.devxm.com:1974/prob_pdf.pdf
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-17 09:06 UTC by Joshua
Modified: 2009-03-17 09:33 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
This PDF throws errors when getting appended to others (61.75 KB, application/pdf)
2009-03-17 09:07 UTC, Joshua
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua 2009-03-17 09:06:10 UTC
Hello

I'm using ghostscript to concatenate a bunch of PDFs into a single document via
something like:
gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite
-sOutputFile=/path/to/final.pdf page1.pdf page2.pdf prob_pdf.pdf page4.pdf

Whenever the PDF at the above URL is involved, GS throws an unrecoverable error,
explicitly the following:

   **** Warning:  Generation number out of 0..65535 range, assuming 0.
   **** Warning:  File has an invalid xref entry:  2.  Rebuilding xref table.
Error: /rangecheck in --run--
Operand stack:
   --nostringval--   --dict:13/22(L)--   2   --dict:3/3(L)--
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--   false   1   %stopped_push   --nostringval--
  --nostringval--
Dictionary stack:
   --dict:1150/1684(ro)(G)--   --dict:1/20(G)--   --dict:75/200(L)--  
--dict:75/200(L)--   --dict:106/127(ro)(G)--   --dict:275/300(ro)(G)--  
--dict:24/25(L)--   --dict:4/6(L)--   --dict:22/40(L)--   --dict:7/8(L)--  
--dict:1/1(ro)(G)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript 8.63: Unrecoverable error, exit code 1

Removing that page solves the problem.

Thanks.
Comment 1 Joshua 2009-03-17 09:07:04 UTC
Created attachment 4850 [details]
This PDF throws errors when getting appended to others
Comment 2 Joshua 2009-03-17 09:09:48 UTC
Not sure if pasted error was correct, here is definitive: 

Error: /rangecheck in --run-- Operand stack: --nostringval-- --dict:13/22(L)-- 2
--dict:3/3(L)-- 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-- false 1
%stopped_push --nostringval-- --nostringval-- Dictionary stack:
--dict:1150/1684(ro)(G)-- --dict:1/20(G)-- --dict:75/200(L)-- --dict:75/200(L)--
--dict:106/127(ro)(G)-- --dict:275/300(ro)(G)-- --dict:24/25(L)--
--dict:4/6(L)-- --dict:22/40(L)-- --dict:7/8(L)-- --dict:1/1(ro)(G)-- Current
allocation mode is local Last OS error: 2 Error: /rangecheck in --run-- Operand
stack: 65535
(\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000...)
0
(\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000...)
0 -10 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-- --nostringval-- --nostringval--
--nostringval-- --nostringval-- --nostringval-- %loop_continue --nostringval--
Dictionary stack: --dict:1152/1684(ro)(G)-- --dict:1/20(G)-- --dict:75/200(L)--
--dict:75/200(L)-- --dict:106/127(ro)(G)-- --dict:275/300(ro)(G)--
--dict:19/25(L)-- Current allocation mode is local 
Comment 3 Ken Sharp 2009-03-17 09:33:38 UTC
The file is damaged, the xref table starts like this:

xref
0 25
0000000000 65535 f 
0000062235 00000 n 
0000000000 65536 n 

The maximum allowed value for a generation number is 65535, so 65536 is, as GS
says, invalid (see page 95 of the 1.7 PDF Reference). I tested the file on
Ghostscript version 8.64, and it rebuilt the xref and rendered the file
correctly. I'd recommend you update and try the current version.