Bug 699744 - ps2epsi fails with Error: /undefined in --setpagedevice--
Summary: ps2epsi fails with Error: /undefined in --setpagedevice--
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Regression (show other bugs)
Version: unspecified
Hardware: PC FreeBSD
: P4 normal
Assignee: Default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-07 10:34 UTC by Tijl Coosemans
Modified: 2018-09-08 08:55 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
example input postscript (7.64 KB, application/postscript)
2018-09-07 10:34 UTC, Tijl Coosemans
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tijl Coosemans 2018-09-07 10:34:58 UTC
Created attachment 15585 [details]
example input postscript

The following command fails in 9.24 (freebsd-branches.ps attached):

ps2epsi freebsd-branches.ps

Error: /undefined in --setpagedevice--
Operand stack:
   false   false   --dict:1/1(L)--   --nostringval--   --dict:78/154(ro)(L)--   --dict:1/1(L)--   --dict:9/79(L)--   --dict:0/0(L)--   --dict:343/345(G)--   image8
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   2015   1   4   %oparray_pop   2014   1   4   %oparray_pop   1998   1   4   %oparray_pop   1884   1   4   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   2024   0   5   %oparray_pop   2022   0   5   %oparray_pop   --nostringval--   1977   2   5   %oparray_pop   --nostringval--   --nostringval--
Dictionary stack:
   --dict:985/1684(ro)(G)--   --dict:0/20(G)--   --dict:82/200(L)--   --dict:5/30(L)--   --dict:20/30(L)--
Current allocation mode is local
Current file position is 8580
GPL Ghostscript 9.24: Unrecoverable error, exit code 1


The error happens on the second ghostscript command in the ps2epsi script, the one that runs ps2epsi.ps.
Comment 1 Ken Sharp 2018-09-08 08:50:33 UTC
Changes to the way SAFER mode works (required to prevent security problems) mean that this program, which relies for its operation on non-standard (unsafe) Ghostscript extensions cannot be run in SAFER mode.

I've modified the ps2epsi.ps program, and the scripts, and these now work as well as they ever have.

This program should now be considered as unsafe and you should not use it with untrusted PostScript input.

As noted in the commit message we will likely deprecate and remove this in the future.
Comment 2 Ken Sharp 2018-09-08 08:55:19 UTC
Forgot to note the commit: 95281026d983bff8f72e431c7f620a0e8d07c2af