Bug 696682

Summary: Unrecoverable error on attached document
Product: Ghostscript Reporter: Kenneth Chan <kenneth>
Component: Graphics LibraryAssignee: Marcos H. Woehrmann <marcos.woehrmann>
Status: RESOLVED MOVED    
Severity: normal CC: kenneth, tony
Priority: P4    
Version: 9.19   
Hardware: All   
OS: All   
Customer: Word Size: ---
Attachments: document that produces unrecoverable error

Description Kenneth Chan 2016-03-29 16:02:01 UTC
Created attachment 12412 [details]
document that produces unrecoverable error

gs  -dNOPAUSE -dBATCH -dQUIET -dNOPAGEPROMPT -sDEVICE=png16m -r18 -dFirstPage=1 -dLastPage=1 -sOutputFile=failure.png ./fails_ghostscript_9.19.pdf                                                                                                                                                                                                                                                                2.2.4
   **** Error reading a content stream. The page may be incomplete.
               Output may be incorrect.
   **** Error reading a content stream. The page may be incomplete.
               Output may be incorrect.
Error: /typecheck in --run--
Operand stack:
   --dict:8/17(L)--   --nostringval--   --dict:7/7(ro)(L)--   --nostringval--   false   2729   0   1   --nostringval--   --dict:7/7(ro)(G)--   10   --nostringval--
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1967   1   3   %oparray_pop   1966   1   3   %oparray_pop   1950   1   3   %oparray_pop   --nostringval--   --nostringval--   2   1   1   --nostringval--   %for_pos_int_continue   --nostringval--   --nostringval--   false   1   %stopped_push   --nostringval--
Dictionary stack:
   --dict:1199/1684(ro)(G)--   --dict:1/20(G)--   --dict:83/200(L)--   --dict:83/200(L)--   --dict:132/256(ro)(G)--   --dict:287/300(ro)(G)--   --dict:29/32(L)--   --dict:6/8(L)--   --dict:23/40(L)--   --dict:1/1(ro)(G)--   --dict:5/5(L)--   --dict:1/1(ro)(G)--   --dict:5/5(L)--   --dict:18/25(L)--
Current allocation mode is local
Last OS error: No such file or directory
GPL Ghostscript 9.19: Unrecoverable error, exit code 1
Comment 1 Ken Sharp 2016-03-30 00:46:54 UTC
The problem is the resolution, setting resolution to 18 dpi (-r18) causes a shading pattern to collapse (results in a rangecheck error in makepattern) which the interpreter ignores. However, ignoring parts of the page simply causes problems later on and eventually this becomes unrecoverable.

Don't set the resolution to 18 dpi, 39 dpi is the lowest value which will work for this particular file.
Comment 2 Kenneth Chan 2016-03-30 11:26:28 UTC
How did you determine the minimum resolution for this particular file? It seems work at >=37 for this document. Even without the unrecoverable error, the arrows do not show up.
Comment 3 Ken Sharp 2016-03-30 12:32:56 UTC
(In reply to Kenneth Chan from comment #2)
> How did you determine the minimum resolution for this particular file?

Binary chop.

> It
> seems work at >=37 for this document.

Not for me, but I used Windows, the C math library may give fractionally different results.

> Even without the unrecoverable error,
> the arrows do not show up.

Those are also shadings, if you make the resolution too small they simply won;t have enough pixels to be visible....
Comment 4 Kenneth Chan 2016-03-30 13:08:06 UTC
(In reply to Ken Sharp from comment #3)
> (In reply to Kenneth Chan from comment #2)
> > Even without the unrecoverable error,
> > the arrows do not show up.
> 
> Those are also shadings, if you make the resolution too small they simply
> won;t have enough pixels to be visible....

But the arrows don't show up at high resolution either...
Comment 5 Ken Sharp 2016-03-31 00:05:30 UTC
(In reply to Kenneth Chan from comment #4)
> (In reply to Ken Sharp from comment #3)
> > (In reply to Kenneth Chan from comment #2)
> > > Even without the unrecoverable error,
> > > the arrows do not show up.
> > 
> > Those are also shadings, if you make the resolution too small they simply
> > won;t have enough pixels to be visible....
> 
> But the arrows don't show up at high resolution either...

Then that is a different issue and needs a different bug report.
Comment 6 Marcos H. Woehrmann 2016-06-22 17:58:43 UTC
I've opened Bug 696864 for the missing arrows issue.