Opened 3 years ago

Last modified 3 years ago

#64648 new defect

ghostscript @9.55.0_0+x11: Colored tiling Patterns not working

Reported by: arvas512 Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Colored tiling Patterns Cc:
Port: ghostscript

Description

Given on terminal the command 'gs Example_4_21.eps' (where file 'Example_4_21.eps', contains the example 4.21 from Postscript Reference Manual, page 255) it terminates with the following error:

GPL Ghostscript 9.55.0 (2021-09-27)
Copyright (C) 2021 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
Error: /rangecheck in --fill--
Operand stack:
   120   120   184   120
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1990   1   3   %oparray_pop   1989   1   3   %oparray_pop   1988   1   3   %oparray_pop   --nostringval--   1977   1   3   %oparray_pop   1833   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   rectfill   (NULL)   (gs_pattern1_instance_t)   (pattern accumulator)   4   %pattern_paint_finish   --nostringval--   --nostringval--
Dictionary stack:
   --dict:762/1123(ro)(G)--   --dict:0/20(G)--   --dict:80/200(L)--   --dict:9/9(ro)(L)--
Current allocation mode is local
Current file position is 839
GPL Ghostscript 9.55.0: Unrecoverable error, exit code 1 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++ The same command 'gs Example_4_21.eps' works properly, with ghostscript @9.54.0_1+x11 +++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

GPL Ghostscript 9.54.0 (2021-03-30)
Copyright (C) 2021 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
Loading NimbusRoman-Regular font from /opt/local/share/ghostscript/9.54.0/Resource/Font/NimbusRoman-Regular... 4392556 2898080 3914624 2599950 2 done.
>>showpage, press <return> to continue<<

Attachments (1)

Example_4_21.eps (1023 bytes) - added by arvas512 3 years ago.
Eps, based on example 4.21, from Postscript Reference Manual, page 255

Download all attachments as: .zip

Change History (6)

Changed 3 years ago by arvas512

Attachment: Example_4_21.eps added

Eps, based on example 4.21, from Postscript Reference Manual, page 255

comment:1 Changed 3 years ago by tomio-arisaka (Tomio Arisaka)

Thanks for the report, but I think you should post the issue on the official website of Ghostscript. <https://bugs.ghostscript.com/>

I guess that the issue happens due to the default output device.
Because "gs" works well with the device "x11cmyk8" instead of "x11alpha".

$ gs --help
GPL Ghostscript 9.55.0 (2021-09-27)
Copyright (C) 2021 Artifex Software, Inc.  All rights reserved.
Usage: gs [switches] [file1.ps file2.ps ...]
Most frequently used switches: (you can use # in place of =)
 -dNOPAUSE           no pause after page   | -q       `quiet', fewer messages
 -g<width>x<height>  page size in pixels   | -r<res>  pixels/inch resolution
 -sDEVICE=<devname>  select device         | -dBATCH  exit after last file
 -sOutputFile=<file> select output file: - for stdout, |command for pipe,
                                         embed %d or %ld for page #
Input formats: PostScript PostScriptLevel1 PostScriptLevel2 PostScriptLevel3 PDF
Default output device: x11alpha
Available devices:
   ...
   ...
   x11 x11alpha x11cmyk x11cmyk2 x11cmyk4
   x11cmyk8 x11gray2 x11gray4 x11mono x11rg16x x11rg32x 
   ...
   ...
Ghostscript is also using fontconfig to search for font files
For more information, see /opt/local/share/doc/ghostscript/9.55.0/Use.htm.
Please report bugs to bugs.ghostscript.com.
$

$ gs -sDEVICE=x11cmyk8  ./Example_4_21.eps
GPL Ghostscript 9.55.0 (2021-09-27)
Copyright (C) 2021 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
Loading NimbusRoman-Regular font from /opt/local/share/ghostscript/9.55.0/Resource/Font/NimbusRoman-Regular... 4661700 3102068 4673072 3367948 2 done.
>>showpage, press <return> to continue<<

GS>quit
$

comment:2 in reply to:  1 Changed 3 years ago by arvas512

Replying to tomio-arisaka:

Thanks for the report, but I think you should post the issue on the official website of Ghostscript. <https://bugs.ghostscript.com/>

I guess that the issue happens due to the default output device.
Because "gs" works well with the device "x11cmyk8" instead of "x11alpha".

$ gs --help
GPL Ghostscript 9.55.0 (2021-09-27)
Copyright (C) 2021 Artifex Software, Inc.  All rights reserved.
Usage: gs [switches] [file1.ps file2.ps ...]
Most frequently used switches: (you can use # in place of =)
 -dNOPAUSE           no pause after page   | -q       `quiet', fewer messages
 -g<width>x<height>  page size in pixels   | -r<res>  pixels/inch resolution
 -sDEVICE=<devname>  select device         | -dBATCH  exit after last file
 -sOutputFile=<file> select output file: - for stdout, |command for pipe,
                                         embed %d or %ld for page #
Input formats: PostScript PostScriptLevel1 PostScriptLevel2 PostScriptLevel3 PDF
Default output device: x11alpha
Available devices:
   ...
   ...
   x11 x11alpha x11cmyk x11cmyk2 x11cmyk4
   x11cmyk8 x11gray2 x11gray4 x11mono x11rg16x x11rg32x 
   ...
   ...
Ghostscript is also using fontconfig to search for font files
For more information, see /opt/local/share/doc/ghostscript/9.55.0/Use.htm.
Please report bugs to bugs.ghostscript.com.
$

$ gs -sDEVICE=x11cmyk8  ./Example_4_21.eps
GPL Ghostscript 9.55.0 (2021-09-27)
Copyright (C) 2021 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
Loading NimbusRoman-Regular font from /opt/local/share/ghostscript/9.55.0/Resource/Font/NimbusRoman-Regular... 4661700 3102068 4673072 3367948 2 done.
>>showpage, press <return> to continue<<

GS>quit
$

Thanks for replying.
Indeed, the option -sDEVICE=x11cmyk8 corrects the behavior of ghostsript @9.55.0_0+x11.
But, activating ghostsript @9.54.0_0 ( >port activate ghostscript @9.54.0_0+x11 ),
the same command >gs Example_4_21.eps, works as expected without the option -sDEVICE=x11cmyk8.

Therefore, it seems that latest changes in macports cause the problem.

comment:3 Changed 3 years ago by tomio-arisaka (Tomio Arisaka)

I looked at the commit history of portfile, but I was not able to find any patches to be applied to x11alpha. <https://github.com/macports/macports-ports/commits/master/print/ghostscript/Portfile>
So I think the issue has been introduced to 9.55.0 by upstream developers.

e.g. Ghostscript-9.55.0 has another issue as follows:
When using the device "pngalpha", I get the same issue as "x11alpha".

$ gs -P- -dSAFER -q -P- -dNOPAUSE -dBATCH -sDEVICE=pngalpha -sstdout=%stderr -sOutputFile=./Example_4_21.png -P- -dSAFER ./Example_4_21.eps
Error: /rangecheck in --fill--
Operand stack:
   120   120   184   120
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1990   1   3   %oparray_pop   1989   1   3   %oparray_pop   1988   1   3   %oparray_pop   --nostringval--   1977   1   3   %oparray_pop   1833   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   rectfill   (NULL)   (gs_pattern1_instance_t)   (pattern accumulator)   4   %pattern_paint_finish   --nostringval--   --nostringval--
Dictionary stack:
   --dict:765/1123(ro)(G)--   --dict:0/20(G)--   --dict:80/200(L)--   --dict:9/9(ro)(L)--
Current allocation mode is local
Current file position is 839
GPL Ghostscript 9.55.0: Unrecoverable error, exit code 1
$

I tried to build the development version of Ghostscript. (9.56.0rc1: commit 8e52d5a85978c6f721ad4a3ffdf25bf18bce9d20)
Then it works well with x11alpha and pngalpha. It seems that the issue has been resolved:)

$ gs ${HOME}/Downloads/Example_4_21.eps
GPL GhostscriptRELEASE CANDIDATE 1 9.56.0 (2022-02-22)
Copyright (C) 2021 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
Loading NimbusRoman-Regular font from /opt/local/share/ghostscript/9.56.0/Resource/Font/NimbusRoman-Regular... 4359656 2845941 3894296 2584964 2 done.
>>showpage, press <return> to continue<<

GS>quit
$

comment:4 in reply to:  3 Changed 3 years ago by arvas512

Replying to tomio-arisaka:

I looked at the commit history of portfile, but I was not able to find any patches to be applied to x11alpha. <https://github.com/macports/macports-ports/commits/master/print/ghostscript/Portfile>
So I think the issue has been introduced to 9.55.0 by upstream developers.

e.g. Ghostscript-9.55.0 has another issue as follows:
When using the device "pngalpha", I get the same issue as "x11alpha".

$ gs -P- -dSAFER -q -P- -dNOPAUSE -dBATCH -sDEVICE=pngalpha -sstdout=%stderr -sOutputFile=./Example_4_21.png -P- -dSAFER ./Example_4_21.eps
Error: /rangecheck in --fill--
Operand stack:
   120   120   184   120
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1990   1   3   %oparray_pop   1989   1   3   %oparray_pop   1988   1   3   %oparray_pop   --nostringval--   1977   1   3   %oparray_pop   1833   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   rectfill   (NULL)   (gs_pattern1_instance_t)   (pattern accumulator)   4   %pattern_paint_finish   --nostringval--   --nostringval--
Dictionary stack:
   --dict:765/1123(ro)(G)--   --dict:0/20(G)--   --dict:80/200(L)--   --dict:9/9(ro)(L)--
Current allocation mode is local
Current file position is 839
GPL Ghostscript 9.55.0: Unrecoverable error, exit code 1
$

I tried to build the development version of Ghostscript. (9.56.0rc1: commit 8e52d5a85978c6f721ad4a3ffdf25bf18bce9d20)
Then it works well with x11alpha and pngalpha. It seems that the issue has been resolved:)

$ gs ${HOME}/Downloads/Example_4_21.eps
GPL GhostscriptRELEASE CANDIDATE 1 9.56.0 (2022-02-22)
Copyright (C) 2021 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
Loading NimbusRoman-Regular font from /opt/local/share/ghostscript/9.56.0/Resource/Font/NimbusRoman-Regular... 4359656 2845941 3894296 2584964 2 done.
>>showpage, press <return> to continue<<

GS>quit
$

Very good improvement. What must be done now to make the relevant patch? I know nothing about this process.

Is it enough to close the ticket?

comment:5 Changed 3 years ago by tomio-arisaka (Tomio Arisaka)

I don't know the patch to fix the issue. Because I am not a member of Ghostscript developers.

If you are interested in the commit history of Ghostscript, you should see the log of the git repository.
<http://git.ghostscript.com/?p=ghostpdl.git;a=summary>

Note: See TracTickets for help on using tickets.