Bug 473889

Summary: ghostscript hangs on some PDF files
Product: Red Hat Enterprise Linux 5 Reporter: Arnaud Gomes-do-Vale <arnaud.gomes>
Component: ghostscriptAssignee: Tim Waugh <twaugh>
Status: CLOSED ERRATA QA Contact: QE Internationalization Bugs <qe-i18n-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.2CC: ddumas, llim, pknirsch
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
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 09:11:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 513501    
Attachments:
Description Flags
Broken PDF file.
none
strace gs -sDEVICE=x11 broken.pdf 2>&1
none
strace convert broken.pdf broken.gif 2>&1
none
ghostscript-pdf-loop.patch none

Description Arnaud Gomes-do-Vale 2008-12-01 10:34:20 UTC
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 10:35:00 UTC
Created attachment 325205 [details]
strace gs -sDEVICE=x11 broken.pdf 2>&1

Comment 2 Arnaud Gomes-do-Vale 2008-12-01 10:35:26 UTC
Created attachment 325206 [details]
strace convert broken.pdf broken.gif 2>&1

Comment 3 Arnaud Gomes-do-Vale 2008-12-01 10:43:49 UTC
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 12:44:10 UTC
Confirmed.

Comment 7 Tim Waugh 2009-03-24 14:57:12 UTC
Created attachment 336480 [details]
ghostscript-pdf-loop.patch

This is the fix.

Comment 15 Tim Waugh 2009-06-24 14:34:23 UTC
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 04:42:10 UTC
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 09:11:55 UTC
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