Bug 2123391

Summary: ghostscript-9.56.1-1 regression: gs -sDEVICE=pnggray -g20x20 -dPDFFitPage -sOutputFile=/tmp/out.png: Error: /typecheck in --runpdf--: Last OS error: No such file or directory, Unrecoverable error
Product: [Fedora] Fedora Reporter: Petr Pisar <ppisar>
Component: ghostscriptAssignee: Richard Lescak <rlescak>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 35CC: akhaitovich, mjg, mosvald, rlescak, zdohnal
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://koschei.fedoraproject.org/package/perl-PDF-Builder?collection=f35
Whiteboard:
Fixed In Version: ghostscript-9.56.1-2.fc38 ghostscript-9.56.1-2.fc36 ghostscript-9.56.1-2.fc37 ghostscript-9.56.1-2.fc35 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-09-12 07:43:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
test.pdf none

Description Petr Pisar 2022-09-01 14:29:49 UTC
After upgrading ghostscript from 9.55.0-2.fc35 to 9.56.1-1.fc35, a perl-PDF-Builder fails. The reason is that ghostscript fails like this:

$ ls -l /tmp/test.pdf
-rw-r--r--. 1 petr petr 1361  1. zář 16.20 /tmp/test.pdf

$ gs -q -dNOPAUSE -dBATCH -sDEVICE=pnggray -g20x20 -dPDFFitPage -sOutputFile=/tmp/out.png /tmp/test.pdf
Error: /typecheck in --runpdf--
Operand stack:
   --dict:6/14(L)--   --dict:6/14(L)--   --dict:6/14(L)--   MediaBox   --nostringval--   20.0   20.0   20.0   20.0   false   20.0   2
Execution stack:
   %interp_exit   .runexec2   --nostringval--   runpdf   --nostringval--   2   %stopped_push   --nostringval--   runpdf   runpdf   false   1   %stopped_push   1974   1   3   %oparray_pop   1973   1   3   %oparray_pop   1961   1   3   %oparray_pop   1962   1   3   %oparray_pop   runpdf   runpdf   2   1   1   runpdf   %for_pos_int_continue   runpdf   runpdf   runpdf
Dictionary stack:
   --dict:764/1123(ro)(G)--   --dict:0/20(G)--   --dict:76/200(L)--   --dict:18/20(L)--
Current allocation mode is local
Last OS error: No such file or directory
GPL Ghostscript 9.56.1: Unrecoverable error, exit code 1

If I remove -dPDFFitPage option, the command succeeds.

Comment 1 Petr Pisar 2022-09-01 14:30:46 UTC
Created attachment 1908973 [details]
test.pdf

Comment 2 Petr Pisar 2022-09-01 14:35:54 UTC
A plain display works "gs /tmp/test.pdf". With the -dPDFFitPage option ( gs -dPDFFitPage /tmp/test.pdf) I receive SIGABRT:

GPL Ghostscript 9.56.1 (2022-04-04)
Copyright (C) 2022 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.
Processing pages 1 through 1.
Error: /typecheck in --runpdf--
Operand stack:
   --dict:6/14(L)--   --dict:6/14(L)--   --dict:6/14(L)--   MediaBox   --nostringval--   20.0   20.0   594.268   841.607   false   841.607   2
Execution stack:
   %interp_exit   .runexec2   --nostringval--   runpdf   --nostringval--   2   %stopped_push   --nostringval--   runpdf   runpdf   false   1   %stopped_push   1974   1   3   %oparray_pop   1973   1   3   %oparray_pop   1961   1   3   %oparray_pop   1962   1   3   %oparray_pop   runpdf   runpdf   2   1   1   runpdf   %for_pos_int_continue   runpdf   runpdf   runpdf
Dictionary stack:
   --dict:763/1123(ro)(G)--   --dict:0/20(G)--   --dict:76/200(L)--   --dict:18/20(L)--
Current allocation mode is local
Last OS error: Resource temporarily unavailable
GPL Ghostscript 9.56.1: Unrecoverable error, exit code 1
free(): double free detected in tcache 2

Comment 3 Petr Pisar 2022-09-01 14:42:09 UTC
For your information this happens also in Fedora 38 (when I install an F37 build there).

Comment 4 Michael J Gruber 2022-09-01 19:00:25 UTC
Same problem on F36 with the build from updates-testing.

Apparantly, this is a problem with the new PDF interpreter, as things work with "-dNEWPDF=false".

Comment 5 Michael J Gruber 2022-09-06 11:05:54 UTC
Filed upstream as: https://bugs.ghostscript.com/show_bug.cgi?id=705849

Comment 6 Michael J Gruber 2022-09-06 15:49:02 UTC
What an incredibly fast upstream!

They fixed this on the master branch. Here are copr builds with a backport:

https://copr.fedorainfracloud.org/coprs/mjg/ghostscript/

I'll submit this as a dist-git PR asap. (Fix works on F36 at least.)

Comment 7 Fedora Update System 2022-09-09 13:31:07 UTC
FEDORA-2022-9538525c97 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2022-9538525c97

Comment 8 Fedora Update System 2022-09-09 14:01:07 UTC
FEDORA-2022-bf9ccbb1d1 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-bf9ccbb1d1

Comment 9 Fedora Update System 2022-09-09 14:30:45 UTC
FEDORA-2022-f8c697678c has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-f8c697678c

Comment 10 Fedora Update System 2022-09-10 17:21:00 UTC
FEDORA-2022-bf9ccbb1d1 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-bf9ccbb1d1`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-bf9ccbb1d1

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2022-09-10 19:44:13 UTC
FEDORA-2022-f8c697678c has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-f8c697678c`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-f8c697678c

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2022-09-12 07:31:49 UTC
FEDORA-2022-9d6c59dcba has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-9d6c59dcba

Comment 13 Fedora Update System 2022-09-12 07:43:59 UTC
FEDORA-2022-9538525c97 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 14 Fedora Update System 2022-09-13 02:37:37 UTC
FEDORA-2022-9d6c59dcba has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-9d6c59dcba`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-9d6c59dcba

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 15 Fedora Update System 2022-09-14 01:39:56 UTC
FEDORA-2022-f8c697678c has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 16 Fedora Update System 2022-09-16 00:16:16 UTC
FEDORA-2022-bf9ccbb1d1 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 17 Fedora Update System 2022-09-21 01:21:35 UTC
FEDORA-2022-9d6c59dcba has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.