Bug 473889 - ghostscript hangs on some PDF files
ghostscript hangs on some PDF files
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: ghostscript (Show other bugs)
5.2
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Tim Waugh
QE Internationalization Bugs
:
Depends On:
Blocks: 5.4/TechnicalNotes
  Show dependency treegraph
 
Reported: 2008-12-01 05:34 EST by Arnaud Gomes-do-Vale
Modified: 2010-10-18 12:58 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
A typographical error in the gsiparam.h header file made it possible for some PDF files to cause ghostscript to fall into an infinite loop. This update fixes the error. (BZ#473889)
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-02 05:11:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Broken PDF file. (102.54 KB, application/pdf)
2008-12-01 05:34 EST, Arnaud Gomes-do-Vale
no flags Details
strace gs -sDEVICE=x11 broken.pdf 2>&1 (272.31 KB, application/octet-stream)
2008-12-01 05:35 EST, Arnaud Gomes-do-Vale
no flags Details
strace convert broken.pdf broken.gif 2>&1 (269.45 KB, application/octet-stream)
2008-12-01 05:35 EST, Arnaud Gomes-do-Vale
no flags Details
ghostscript-pdf-loop.patch (2.70 KB, patch)
2009-03-24 10:57 EDT, Tim Waugh
no flags Details | Diff

  None (edit)
Description Arnaud Gomes-do-Vale 2008-12-01 05:34:20 EST
Created attachment 325204 [details]
Broken PDF file.

Description of problem:

Ghostscript hangs when rendering some PDF files. "gs -sDEVICE=x11 foo.pdf" just displays a blank window, with nothing happening. "convert foo.pdf foo.gif" just sits here doing nothing.

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

ghostscript-8.15.2-9.3.el5

This is on a Scientific Linux box, but the same happened on a CentOS server so I guess the bug is upstream.

Upgrading to ghostscript-8.63-4 (rebuilt from Fedora) fixed the issue.

How reproducible:

This happens only with a few PDF files, but these always have the issue. These files are not totally broken as xpdf (from xpdf-3.01-28.el5) displays them correctly.

Steps to Reproduce:
1. gs -sDEVICE=x11 foo.pdf
  
Actual results:

Display blank window.

Expected results:

Display PDF file.

Additional info:

I add one of my "broken" files as an attachement, as well as the output from "strace gs -sDEVICE=x11 broken.pdf 2>&1" and "strace convert broken.pdf broken.gif 2>&1".
Comment 1 Arnaud Gomes-do-Vale 2008-12-01 05:35:00 EST
Created attachment 325205 [details]
strace gs -sDEVICE=x11 broken.pdf 2>&1
Comment 2 Arnaud Gomes-do-Vale 2008-12-01 05:35:26 EST
Created attachment 325206 [details]
strace convert broken.pdf broken.gif 2>&1
Comment 3 Arnaud Gomes-do-Vale 2008-12-01 05:43:49 EST
ghostscript-8.15.2-9.1.el5_1.1 (from Scientific Linux) has a somewhat different behavior. Neither 8.15.2-9.1.el5_1.1 nor 8.15.2-9.3.el5 display the PDF, but 8.15.2-9.3.el5 just sits idle whereas 8.15.2-9.1.el5_1.1 grows to 100% CPU usage (which top displays as 100% user).
Comment 5 Tim Waugh 2009-02-24 07:44:10 EST
Confirmed.
Comment 7 Tim Waugh 2009-03-24 10:57:12 EDT
Created attachment 336480 [details]
ghostscript-pdf-loop.patch

This is the fix.
Comment 15 Tim Waugh 2009-06-24 10:34:23 EDT
Release note added. If any revisions are required, please set the 
"requires_release_notes" flag to "?" and edit the "Release Notes" field accordingly.
All revisions will be proofread by the Engineering Content Services team.

New Contents:
A bug that could cause ghostscript to run in an infinite loop when handling certain PDF files has been fixed.
Comment 18 Ryan Lerch 2009-08-19 00:42:10 EDT
Release note updated. If any revisions are required, please set the 
"requires_release_notes"  flag to "?" and edit the "Release Notes" field accordingly.
All revisions will be proofread by the Engineering Content Services team.

Diffed Contents:
@@ -1 +1,4 @@
-A bug that could cause ghostscript to run in an infinite loop when handling certain PDF files has been fixed.+A typographical error in the gsiparam.h header file made it possible for
+some PDF files to cause ghostscript to fall into an infinite loop. This
+update fixes the error.
+(BZ#473889)
Comment 19 errata-xmlrpc 2009-09-02 05:11:55 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1257.html

Note You need to log in before you can comment on or make changes to this bug.