RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1424752 - ghostscript bug creates high CPU load and hangs
Summary: ghostscript bug creates high CPU load and hangs
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ghostscript
Version: 7.3
Hardware: Unspecified
OS: Linux
urgent
high
Target Milestone: rc
: ---
Assignee: David Kaspar // Dee'Kej
QA Contact: QE Internationalization Bugs
Jiri Herrmann
URL:
Whiteboard:
: 1422491 (view as bug list)
Depends On:
Blocks: 1395973 1420851 1455084
TreeView+ depends on / blocked
 
Reported: 2017-02-19 07:31 UTC by Yogita
Modified: 2023-09-14 03:53 UTC (History)
10 users (show)

Fixed In Version: ghostscript-9.07-24.el7
Doc Type: Release Note
Doc Text:
*ghostscript* no longer becomes unresponsive in some situations Under certain circumstances, the *ghostscript* application previously entered an infinite loop, became unresponsive, and caused excessive CPU load. This update fixes the underlying code, which prevents the described problem from occurring.
Clone Of:
: 1455084 (view as bug list)
Environment:
Last Closed: 2017-08-01 23:03:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
This is a demo pdf file we have used to test in above command (720.08 KB, application/pdf)
2017-02-19 07:31 UTC, Yogita
no flags Details
possible fix [from git bisect] (1.00 KB, patch)
2017-03-14 18:27 UTC, David Kaspar // Dee'Kej
kdudka: review+
Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Ghostscript 694811 0 None None None 2017-03-20 13:45:37 UTC
Ghostscript 694848 0 None None None 2017-03-20 13:46:31 UTC
Ghostscript 696505 0 None None None 2017-02-19 07:31:07 UTC
Red Hat Knowledge Base (Solution) 2940631 0 None None None 2017-02-22 16:14:02 UTC
Red Hat Product Errata RHSA-2017:2180 0 normal SHIPPED_LIVE Low: ghostscript security and bug fix update 2017-08-01 19:40:55 UTC

Description Yogita 2017-02-19 07:31:07 UTC
Created attachment 1255371 [details]
This is a demo pdf file we have used to test in above command

Description of problem:
The latest ghostscript version shipped by Redhat is 9.07.20 contains a bug which under certain circumstances causes "gs" to spin at 100% CPU load until manually killed.

Version-Release number of selected component (if applicable):
Rhel 7.3
Package - ghostscript.9.07.20

How reproducible:
The problem can also be reproduced using ImageMagick command /usr/bin/convert:

Steps to Reproduce:
1. /usr/bin/convert ATK_Broschüre_2017.pdf /tmp/test.gif

Actual results:
1. The command hangs and using top command it can be seen that cpu is utilised 99-100% by "gs"

Expected results:
1 The ATK_Broschüre_2017.pdf should have got converted to test.gif in /tmp

Additional info:
https://bugzilla.redhat.com/show_bug.cgi?id=1302121 shows similar type of bug , but resolution provided there with https://rhn.redhat.com/errata/RHSA-2017-0013.html#Red%20Hat%20Enterprise%20Linux%20Server%20 update does'nt seems to work.

Comment 2 David Kaspar // Dee'Kej 2017-02-20 14:23:36 UTC
(In reply to Yogita from comment #0)
> Version-Release number of selected component (if applicable):
> Rhel 7.3
> Package - ghostscript.9.07.20

Please, provide the complete NVR of the package causing this issue. (Output of 'rpm -q ghostscript'...)

> How reproducible:
> The problem can also be reproduced using ImageMagick command
> /usr/bin/convert:

How often is this reproducible? Every time? 5/10 runs? I will try to reproduce it, but specify it next time, please. Thank you.

Comment 3 David Kaspar // Dee'Kej 2017-02-20 14:24:10 UTC
*** Bug 1422491 has been marked as a duplicate of this bug. ***

Comment 5 Yogita 2017-02-22 04:49:54 UTC
(In reply to David Kaspar [Dee'Kej] from comment #2)
> (In reply to Yogita from comment #0)
> > Version-Release number of selected component (if applicable):
> > Rhel 7.3
> > Package - ghostscript.9.07.20
> 
> Please, provide the complete NVR of the package causing this issue. (Output
> of 'rpm -q ghostscript'...)

rpm -q ghostscript
ghostscript-9.07-20.el7_3.1.x86_64

> > How reproducible:
> > The problem can also be reproduced using ImageMagick command
> > /usr/bin/convert:
> 
> How often is this reproducible? Every time? 5/10 runs? I will try to
> reproduce it, but specify it next time, please. Thank you.

This issue have happened everytime.

Comment 7 dbodnarc 2017-02-22 08:58:40 UTC
I have the customer with exactly the same problem.


PDF document details used are the following:
------------------------------------------------
Producer: Adobe PDF Library 9.0
Creator:  Adobe InDesign CS4 (6.0.6)
Format:   PDF-1.7
------------------------------------------------

Enviroment:
[root@fastvm-r7-3-73 ~]# rpm -q ghostscript ImageMagick
ghostscript-9.07-20.el7_3.1.x86_64
ImageMagick-6.7.8.9-15.el7_2.x86_64

Reproducer:
[root@fastvm-r7-3-73 ~]# /usr/bin/convert /tmp/TRUMPF-5-year-warranty-conditions-brochures.pdf /tmp/test.gif

Results:
>> gs consumes 100% CPU and the process never ends 

[root@fastvm-r7-3-73 ~]# ps faux 
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root      2148  0.0  0.2 143392  2580 ?        Ss   Feb21   0:01  \_ sshd: root@pts/0
root      2181  0.0  0.2 116040  2420 pts/0    Ss   Feb21   0:00  |   \_ -bash
root      3221  0.1  0.8 232980  8472 pts/0    S+   09:36   0:00  |       \_ /usr/bin/convert /tmp/TRUMPF-5-year-warranty-conditions-brochures.pdf /tmp/test.gif
root      3222  100  3.3 135768 34016 pts/0    R+   09:36   0:30  |           \_ gs -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 -sDEVICE=pam -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r72x72 -dUseCIEColor -sOutputFile=/tmp/magick-RFYIggoO-%08d -f/tmp/magick-TvgwyvY6 -f/tmp/magick-11inBPyp

I'm also attaching strace output for your reference (strace-gs100p-cpu.txt)

A workaround for avoiding such behavior before patch release is welcome.

Comment 15 David Kaspar // Dee'Kej 2017-03-14 18:27:35 UTC
Created attachment 1263033 [details]
possible fix [from git bisect]

I have isolated the possible fix for this issue by git-bisect.

Comment 18 David Kaspar // Dee'Kej 2017-03-20 13:50:29 UTC
Comment on attachment 1263033 [details]
possible fix [from git bisect]

So, even upstream says what I have noticed there. The 'for' loop uses wrong variable (i) for incrementation, instead of variable 'k', so eventually the program will get stuck in the loop.

Comment 19 Kamil Dudka 2017-03-20 13:58:37 UTC
Comment on attachment 1263033 [details]
possible fix [from git bisect]

Looks good.

Comment 33 errata-xmlrpc 2017-08-01 23:03:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2017:2180

Comment 34 Red Hat Bugzilla 2023-09-14 03:53:55 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days


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