Bug 473889 - ghostscript hangs on some PDF files
Summary: ghostscript hangs on some PDF files
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: ghostscript
Version: 5.2
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Tim Waugh
QA Contact: QE Internationalization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 5.4, TechnicalNotes
TreeView+ depends on / blocked
 
Reported: 2008-12-01 10:34 UTC by Arnaud Gomes-do-Vale
Modified: 2010-10-18 16:58 UTC (History)
3 users (show)

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)
Clone Of:
Environment:
Last Closed: 2009-09-02 09:11:55 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1257 0 normal SHIPPED_LIVE ghostscript bug fix update 2009-09-01 09:09:13 UTC

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


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