Bug 689353 - Regression: Error: /undefinedresource in --showpage-- with Clarke-Tate-Manns-Chinese.ai
Summary: Regression: Error: /undefinedresource in --showpage-- with Clarke-Tate-Manns...
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Graphics Library (show other bugs)
Version: master
Hardware: PC Linux
: P5 normal
Assignee: Marcos H. Woehrmann
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-12 12:56 UTC by Marcos H. Woehrmann
Modified: 2008-12-19 08:31 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
patch (508 bytes, patch)
2007-08-19 14:53 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-07-12 12:56:57 UTC
Starting with r8118 Ghostscript produces an error when converting
Tate-Manns-Chinese.ai at 300 DPI:

GPL Ghostscript SVN PRE-RELEASE 8.60 (2007-05-12)
Copyright (C) 2007 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 1.
Page 1
Error: /undefinedresource in --showpage--
Operand stack:
   1   true
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--  
--nostringval--   2   %stopped_push   --nostringval--   --nostringval--  
--nostringval--   false   1   %stopped_push   1889   1   3   %oparray_pop   1888
  1   3   %oparray_pop   1872   1   3   %oparray_pop   --nostringval--  
--nostringval--   2   1   1   --nostringval--   %for_pos_int_continue  
--nostringval--   --nostringval--   1761   0   9   %oparray_pop  
--nostringval--   --nostringval--
Dictionary stack:
   --dict:1147/1684(ro)(G)--   --dict:2/20(G)--   --dict:75/200(L)--  
--dict:75/200(L)--   --dict:106/127(ro)(G)--   --dict:274/300(ro)(G)--  
--dict:21/25(L)--   --dict:4/6(L)--   --dict:25/31(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript SVN PRE-RELEASE 8.60: Unrecoverable error, exit code 1


The command line I used for testing:

bin/gs -sDEVICE=ppmraw -sOutputFile=test.ppm -r300 ./Clarke-Tate-Manns-Chinese.ai

I believe this to be different problem than bug 689352 even though the error
message is the same since it happens with a different revision.

There were many changes to many files between r8117 and r8118, so I won't
attempt to list them.
Comment 1 leonardo 2007-07-13 11:57:48 UTC
Can't reproduce.
r8118 doesn't change resource machinery.
Returning to support - please check your configuration.
Comment 2 Marcos H. Woehrmann 2007-07-13 21:19:02 UTC
This appears to be a 64 bit issue.  On my iMac G5 the command line I listed
works with gshead (r8123) but fails on my AMD64 system.

With r8123 the error message has changed:

marcos@amd64:[970]% gshead -sDEVICE=ppmraw -sOutputFile=test.ppm -r300
./Clarke-Tate-Manns-Chinese.ai
GPL Ghostscript SVN PRE-RELEASE 8.60 (2007-05-12)
Copyright (C) 2007 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 1.
Page 1
Error: /unregistered in --showpage--
Operand stack:
   1   true
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--  
--nostringval--   2   %stopped_push   --nostringval--   --nostringval--  
--nostringval--   false   1   %stopped_push   1889   1   3   %oparray_pop   1888
  1   3   %oparray_pop   1872   1   3   %oparray_pop   --nostringval--  
--nostringval--   2   1   1   --nostringval--   %for_pos_int_continue  
--nostringval--   --nostringval--   1761   0   9   %oparray_pop  
--nostringval--   --nostringval--
Dictionary stack:
   --dict:1147/1684(ro)(G)--   --dict:2/20(G)--   --dict:75/200(L)--  
--dict:75/200(L)--   --dict:106/127(ro)(G)--   --dict:274/300(ro)(G)--  
--dict:21/25(L)--   --dict:4/6(L)--   --dict:25/31(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript SVN PRE-RELEASE 8.60: Unrecoverable error, exit code 1
Comment 3 Alex Cherepanov 2007-08-19 14:53:51 UTC
Created attachment 3290 [details]
patch

Fix command list-based devices on 64-bit platforms.

Ghostscript always writes int values to the command list but old code
interpreted the bit pattern as a long int, causing conversion of the negative
values to large positive ones.

BTW, the variable-length format used to represent numbers is inefficient
for negative numbers. They always take 5 bytes. Perhaps a sign + module
representation will work better.
Comment 4 leonardo 2007-08-19 19:03:50 UTC
The patch is good. Alexm\, you may commit it.

frac31 values are always not negative, so providing negative values is not 
necessary.
Comment 5 Alex Cherepanov 2007-08-20 10:21:30 UTC
The patch is committed as a rev. 8198.
My little UDB box is too underpowered to test PDF interpreter.
Marcos, please re-test 64-bit regression cases.
Comment 6 Marcos H. Woehrmann 2007-08-21 09:49:53 UTC
The current gshead (r8198) processes the file correctly on my 64 bit Linux box.
Comment 7 Ray Johnston 2007-08-23 17:07:53 UTC
Assign to Marcos to test on 64-bit platform to make sure that the issue is
actually resolved.

Thanks to Alex for the patch that we expect to fix it.
Comment 8 Marcos H. Woehrmann 2007-08-26 10:08:33 UTC
Works with r8204 on my 64 bit Linux box.