Ghostscript runaway memory consumption during font search

Bug #1359715 reported by Lionel B
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ghostscript (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Linux Mint 17 (Qiana), Cinnamon 64-bit, kernel 3.13.0-24-generic #47-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux
Ghostscript version 9.10

When Ghostscript searches for a specified font, if that font is not found in the Fontmap file, memory consumption shoots up, the system starts swapping and hangs.

Tested on system (see above) with ~ 2GB memory.

A simple way to reproduce, is to use the following procedure to attempt to display a font:

1) Invoke ghostscript on 'prfont.ps'

$ gs /usr/share/ghostscript/9.10/lib/prfont.ps
GPL Ghostscript 9.10 (2013-08-30)
Copyright (C) 2013 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Loading NimbusRomNo9L-Regu font from /usr/share/fonts/type1/gsfonts/n021003l.pfb... 3896292 2355421 3853784 2540955 1 done.
GS>

2) At Ghostscript prompt, specify a random fontname - which we know does not exist - to 'DoFont':

GS>/Somefont DoFont
Can't find (or can't open) font file /usr/share/ghostscript/9.10/Resource/Font/Somefont.
Can't find (or can't open) font file Somefont.
Querying operating system for font files...

Result: memory usage maxes out, system swaps and hangs.

I expected Ghostscript to conclude the font search (without exhausating system resources!) and to report failure to locate the specified font.

This problem always occurs, and affects any other program which invokes ghostscript and triggers a font search.

Vlad Orlov (monsta)
affects: linuxmint → ghostscript (Ubuntu)
Revision history for this message
Sidney Li (sidney-hy-li) wrote :

I ran into the same problem on Mint 17 Cinnamon 64-bit also. The problem occurs even with /TimesRomanBold. I have installed the gsfonts and gsfonts-other package (in Synaptic/Apt), but still the same problem.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Please report the problem to Ghostscript upstream, http://bugs.ghostscript.com/. Thanks.

Revision history for this message
Lionel B (trader-lionelb) wrote :
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Hello, thanks for reporting this issue.
Ghostscript has been updated to 9.25 in current releases of Ubuntu.

Could you please verify that your issue has been resolved, and update this bug accordingly?

Thanks!

Changed in ghostscript (Ubuntu):
status: New → Incomplete
Revision history for this message
Lionel B (trader-lionelb) wrote : Re: [Bug 1359715] Re: Ghostscript runaway memory consumption during font search
Download full text (3.1 KiB)

Hi Marc,

Yes, it seems to be fixed now on my current system (Ubuntu 16.04.5).
On invoking DoFont with a non-existent font, a sample response is:

--------------------------------------------------------------------------------
GS>/xyz DoFont
Querying operating system for font files...
Can't find (or can't open) font file %rom%Resource/Font/xyz.
Can't find (or can't open) font file xyz.
Didn't find this font on the system!
Substituting font Courier for xyz.
Loading NimbusMonoPS-Regular font from
%rom%Resource/Font/NimbusMonoPS-Regular... 4619540 3276395 9786160
4453839 1 done.
>>showpage, press <return> to continue<<
--------------------------------------------------------------------------------

no hang, and a font is displayed in the 'ghostscript' window.

So seems to be working correctly in an expected way.

Cheers,
Lionel

On Tue, 2 Oct 2018 at 15:05, Marc Deslauriers
<email address hidden> wrote:
>
> Hello, thanks for reporting this issue.
> Ghostscript has been updated to 9.25 in current releases of Ubuntu.
>
> Could you please verify that your issue has been resolved, and update
> this bug accordingly?
>
> Thanks!
>
>
> ** Changed in: ghostscript (Ubuntu)
> Status: New => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1359715
>
> Title:
> Ghostscript runaway memory consumption during font search
>
> Status in ghostscript package in Ubuntu:
> Incomplete
>
> Bug description:
> Linux Mint 17 (Qiana), Cinnamon 64-bit, kernel 3.13.0-24-generic #47-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux
> Ghostscript version 9.10
>
> When Ghostscript searches for a specified font, if that font is not
> found in the Fontmap file, memory consumption shoots up, the system
> starts swapping and hangs.
>
> Tested on system (see above) with ~ 2GB memory.
>
> A simple way to reproduce, is to use the following procedure to
> attempt to display a font:
>
> 1) Invoke ghostscript on 'prfont.ps'
>
> $ gs /usr/share/ghostscript/9.10/lib/prfont.ps
> GPL Ghostscript 9.10 (2013-08-30)
> Copyright (C) 2013 Artifex Software, Inc. All rights reserved.
> This software comes with NO WARRANTY: see the file PUBLIC for details.
> Loading NimbusRomNo9L-Regu font from /usr/share/fonts/type1/gsfonts/n021003l.pfb... 3896292 2355421 3853784 2540955 1 done.
> GS>
>
> 2) At Ghostscript prompt, specify a random fontname - which we know
> does not exist - to 'DoFont':
>
> GS>/Somefont DoFont
> Can't find (or can't open) font file /usr/share/ghostscript/9.10/Resource/Font/Somefont.
> Can't find (or can't open) font file Somefont.
> Querying operating system for font files...
>
> Result: memory usage maxes out, system swaps and hangs.
>
> I expected Ghostscript to conclude the font search (without
> exhausating system resources!) and to report failure to locate the
> specified font.
>
> This problem always occurs, and affects any other program which
> invokes ghostscript and triggers a font search.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/ghostscript/+bug/1359715/+subscript...

Read more...

Revision history for this message
Vlad Orlov (monsta) wrote :

Marking as fixed according to the latest comments here

Changed in ghostscript (Ubuntu):
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.