Bug 74633

Summary: ghostscript fails with error /rangecheck in --get-- when run over idraw files with text
Product: [Retired] Red Hat Linux Reporter: John Heidemann <johnh>
Component: ghostscriptAssignee: Tim Waugh <twaugh>
Status: CLOSED NOTABUG QA Contact: Mike McLean <mikem>
Severity: high Docs Contact:
Priority: medium    
Version: 7.3   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-10-14 05:56:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Heidemann 2002-09-28 00:39:39 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020827

Description of problem:
I've had trouble with old idraw files giving the following error
message in recent versions of ghostscript on Redhat Linux.

I haven't been able to find any related bug reports in the ghostscript
bug list.

Specificially, the attached idraw file (created with idraw 1.0.6 with the
text string "bar" in it), the gv the file using ghostscript-6.52-9.4 on
Redhat 7.3, it gives the following error message:

gs ~/NOTES/200208/idraw_failing_in_ghostscript_020808.idraw 
GNU Ghostscript 6.52 (2001-10-20)
Copyright (C) 2001 artofcode LLC, Benicia, CA.  All rights reserved.
This software comes with NO WARRANTY: see the file COPYING for details.
Loading NimbusRomNo9L-Regu font from
/usr/share/fonts/default/Type1/n021003l.pfb... 2418892 1059509 1622424 328620 0
done.
Loading NimbusSanL-Regu font from /usr/share/fonts/default/Type1/n019003l.pfb...
2757092 1364390 1642520 336084 0 done.
Error: /rangecheck in --get--
Operand stack:
   --nostringval--   --nostringval--   --nostringval--   descender   0  
--nostringval--   1
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--  
--nostringval--   2   %stopped_push   --nostringval--   --nostringval--  
--nostringval--   false   1   %stopped_push   1   3   %oparray_pop   1   3  
%oparray_pop   1   3   %oparray_pop   .runexec2   --nostringval--  
--nostringval--   --nostringval--   2   %stopped_push   --nostringval--  
--nostringval--   --nostringval--   --nostringval--
Dictionary stack:
   --dict:1035/1476(ro)(G)--   --dict:0/20(G)--   --dict:90/200(L)--  
--dict:36/51(L)--   --dict:1/17(L)--   --dict:5/17(L)--   --dict:1/3(L)--  
--dict:13/14(ro)(L)--
Current allocation mode is local
Current file position is 10606
GNU Ghostscript 6.52: Unrecoverable error, exit code 1

Position 10438 is the first character of the "End" just after
the "] Text" line in the file.

(FYI, idraw's native file format is postscript with idraw-specific comments.

This problem didn't happen on Redhat Linux 7.2, but it persists even
if I downgrade ghostview in RH 7.3 to the 7.2 version
(ghostscript-6.51-12).  (Suggesting perhaps it's a library problem,
rather than a problem directly in ghostscript.)  The problem persists
in rehdat 8.0 beta with ghostscript-7.05-20.  (I haven't been able to
test gs-7.30.)

The idraw folks seemt to think this is a ghostscript bug since the
idraw files that used to work no longer do.


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. download 
<http://www.isi.edu/~johnh/PUBLIC/idraw_failing_in_ghostscript_020808.idraw>
(the extension is .idraw but it's really a postscript file)

2. try and ghostview it (run "gv
idraw_failing_in_ghostscript_020808.idraw")

Under RH 7.2 this succeeded, under RH 7.3 it fails with the error

gs ~/NOTES/200208/idraw_failing_in_ghostscript_020808.idraw 
GNU Ghostscript 6.52 (2001-10-20)
Copyright (C) 2001 artofcode LLC, Benicia, CA.  All rights reserved.
This software comes with NO WARRANTY: see the file COPYING for details.
Loading NimbusRomNo9L-Regu font from
/usr/share/fonts/default/Type1/n021003l.pfb... 2418892 1059509 1622424 328620 0
done.
Loading NimbusSanL-Regu font from /usr/share/fonts/default/Type1/n019003l.pfb...
2757092 1364390 1642520 336084 0 done.
Error: /rangecheck in --get--
Operand stack:
   --nostringval--   --nostringval--   --nostringval--   descender   0  
--nostringval--   1
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--  
--nostringval--   2   %stopped_push   --nostringval--   --nostringval--  
--nostringval--   false   1   %stopped_push   1   3   %oparray_pop   1   3  
%oparray_pop   1   3   %oparray_pop   .runexec2   --nostringval--  
--nostringval--   --nostringval--   2   %stopped_push   --nostringval--  
--nostringval--   --nostringval--   --nostringval--
Dictionary stack:
   --dict:1035/1476(ro)(G)--   --dict:0/20(G)--   --dict:90/200(L)--  
--dict:36/51(L)--   --dict:1/17(L)--   --dict:5/17(L)--   --dict:1/3(L)--  
--dict:13/14(ro)(L)--
Current allocation mode is local
Current file position is 10606
GNU Ghostscript 6.52: Unrecoverable error, exit code 1


Actual Results:  GNU Ghostscript 6.52 (2001-10-20)
Copyright (C) 2001 artofcode LLC, Benicia, CA.  All rights reserved.
This software comes with NO WARRANTY: see the file COPYING for details.
Loading NimbusRomNo9L-Regu font from
/usr/share/fonts/default/Type1/n021003l.pfb... 2418892 1059509 1622424 328620 0
done.
Loading NimbusSanL-Regu font from /usr/share/fonts/default/Type1/n019003l.pfb...
2757092 1364390 1642520 336084 0 done.
Error: /rangecheck in --get--
Operand stack:
   --nostringval--   --nostringval--   --nostringval--   descender   0  
--nostringval--   1
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--  
--nostringval--   2   %stopped_push   --nostringval--   --nostringval--  
--nostringval--   false   1   %stopped_push   1   3   %oparray_pop   1   3  
%oparray_pop   1   3   %oparray_pop   .runexec2   --nostringval--  
--nostringval--   --nostringval--   2   %stopped_push   --nostringval--  
--nostringval--   --nostringval--   --nostringval--
Dictionary stack:
   --dict:1035/1476(ro)(G)--   --dict:0/20(G)--   --dict:90/200(L)--  
--dict:36/51(L)--   --dict:1/17(L)--   --dict:5/17(L)--   --dict:1/3(L)--  
--dict:13/14(ro)(L)--
Current allocation mode is local
Current file position is 10606
GNU Ghostscript 6.52: Unrecoverable error, exit code 1


Expected Results:  It should render an image of a black square and the text "bar"
in the ghostscript window.


Additional info:

The problem's been reported both to
the 
idraw (ivtools-users.net)
and 
ghostscript (bug-ghostscript)
maintainers,
but it's not clear if it's an idraw problem (bad postscript only now caught)
a ghostscript problem (a too strict or buggy interpreter)
or some sort of interaction with libraries (suggested
by the fact that downgrading to the RH 7.2 ghostscript doesn't fix the
problem).

Comment 1 Alex Cherepanov 2002-10-14 05:05:06 UTC
The sample file is incorrect. It assumes that FontBBox is an
executable array. Although many fonts are designed this way
there is no such requiriment in the spec. Probably, different RH
versions install different fonts. The file should be
changed as following to work with both executable and literal
arrays.

*** test.ps	Mon Oct 14 00:02:53 2002
--- test-hacked.ps	Mon Oct 14 00:53:20 2002
***************
*** 362,368 ****
  gsave
  fgred fggreen fgblue setrgbcolor
  /fontDict printFont printSize scalefont dup setfont def
! /descender fontDict begin 0 [FontBBox] 1 get FontMatrix end
  transform exch pop def
  /vertoffset 1 printSize sub descender sub def {
  0 vertoffset moveto show
--- 362,368 ----
  gsave
  fgred fggreen fgblue setrgbcolor
  /fontDict printFont printSize scalefont dup setfont def
! /descender fontDict begin 0 /FontBBox load 1 get FontMatrix end
  transform exch pop def
  /vertoffset 1 printSize sub descender sub def {
  0 vertoffset moveto show




Comment 2 John Heidemann 2002-10-14 05:56:37 UTC
twaugh, can you close this bug? alexcher's patch fixes it (thanks!),
indicating that this is an idraw bug, not a ghostscript bug.
I have passed the bug report back to ivtools-users.

Comment 3 Tim Waugh 2002-10-14 07:13:46 UTC
Thanks.

Comment 4 Tim Waugh 2002-10-14 20:16:29 UTC
*** Bug 65335 has been marked as a duplicate of this bug. ***