Discussion:
[gs-bugs] [Bug 695533] New: ghostscript appears to hang forever creating thumbnail of a pdf
b***@ghostscript.com
2014-09-24 17:18:59 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=695533

Bug ID: 695533
Summary: ghostscript appears to hang forever creating thumbnail
of a pdf
Product: Ghostscript
Version: 9.05
Hardware: PC
OS: Linux
Status: UNCONFIRMED
Severity: critical
Priority: P4
Component: General
Assignee: ***@artifex.com
Reporter: ***@modula-shop-systems.de
QA Contact: gs-***@ghostscript.com
Word Size: ---

Created attachment 11187
--> http://bugs.ghostscript.com/attachment.cgi?id=11187&action=edit
Sample PDF that will crash gs 9.05 on Debian 7

Related to 694788 but on version 9.05 currently shipped with Debian 7.
Same behaviour, test-file from 694788 renders fine, but the attached PDF won't.

I downloaded and tried the latest Binary, this works but takes quite a while
and also throws some warnings.

Here is the command-line i used with the attached File (that nearly crashed an
entire VM) and parts of the output:

./ghostscript/ghostscript-9.15-linux-x86_64/gs-915-linux_x86_64 -dBATCH
-dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=pnmraw -dTextAlphaBits=4
-dGraphicsAlphaBits=4 -r150x150 -dUseCropBox -dFirstPage=1 -dLastPage=1
-sOutputFile=/root/kaputtOut -- /root/kaputt.pdf -c quit

GPL Ghostscript 9.15 (2014-09-22)
Copyright (C) 2014 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 1.
Page 1
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING: No incltree created.
WARNING: No imsbtree created.
WARNING in tgt_create tree->numnodes == 0, no tree created.
WARNING: No incltree created.
WARNING in tgt_create tree->numnodes == 0, no tree created.
WARNING: No imsbtree created.
WARNING in tgt_create tree->numnodes == 0, no tree created.
WARNING: No incltree created.
WARNING in tgt_create tree->numnodes == 0, no tree created.

[.... etc.]

Alex
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@ghostscript.com
2014-09-24 18:04:11 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=695533

Ken Sharp <***@artifex.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Component|General |JPX/JBIG2 encode/decode
Version|9.05 |master
Severity|critical |normal
Assignee|***@artifex.com |***@artifex.com

--- Comment #1 from Ken Sharp <***@artifex.com> ---
The warning messages all appear to come from OpenJPEG.

It does take a long time to decode, and gives a lot of errors and (for me) says
there isn't enough data for the image though its not obvious without debugging
whether that's due to the same error.

The file seems to pretty much totally consist of a JP2K image, so I guess
either its a broken image or this is a OpenJPEG bug, probably a bug in OpenJPEG
IMO.
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@ghostscript.com
2014-09-24 18:29:30 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=695533

--- Comment #2 from Alexander Schmid <***@modula-shop-systems.de> ---
Yes, the file was an uplaod on a print-shop i developped and support and is far
from ideal.

The *real* Problem is:
It renders fine (but slow) with a newly compiled version of gs 9.15 on my
debian boxes, but crashes gs 8.71 (Debian 6) and gs 9.05 (Debian 7) completely.

I had a load > 40, heavy swap usage etc. for minutes when gs was running on it
without finishing. Memory consumption of the thread was about 7.5GB.

Guess there are thousands of boxes out there running one of these version, so
it might be a good idea to patch the binaries in the repos ;)
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@ghostscript.com
2014-09-25 07:14:54 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=695533

--- Comment #3 from Ken Sharp <***@artifex.com> ---
(In reply to Alexander Schmid from comment #2)
Post by b***@ghostscript.com
It renders fine (but slow) with a newly compiled version of gs 9.15 on my
debian boxes, but crashes gs 8.71 (Debian 6) and gs 9.05 (Debian 7)
completely.
If the real problem is the crash, then update to 9.15.
Post by b***@ghostscript.com
Guess there are thousands of boxes out there running one of these version,
so it might be a good idea to patch the binaries in the repos ;)
No, we don't operate that way, take the latest source and use that. Of course,
this is open source software, so if you feel you have to back port changes into
older versions, you can do so.

Also, we don't maintain *any* Linux repositories, what you suggest would
require all the maintainers of the various distributions to create new binaries
(many distros do not carry our vanilla binary), and find some way to make these
available with a different version so that update would happen. Good luck with
organising that.....
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@ghostscript.com
2014-09-25 07:35:52 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=695533

--- Comment #4 from Alexander Schmid <***@modula-shop-systems.de> ---
(In reply to Ken Sharp from comment #3)
Post by b***@ghostscript.com
(In reply to Alexander Schmid from comment #2)
Post by b***@ghostscript.com
It renders fine (but slow) with a newly compiled version of gs 9.15 on my
debian boxes, but crashes gs 8.71 (Debian 6) and gs 9.05 (Debian 7)
completely.
If the real problem is the crash, then update to 9.15.
This is what i did to protect my Systems.
Post by b***@ghostscript.com
Post by b***@ghostscript.com
Guess there are thousands of boxes out there running one of these version,
so it might be a good idea to patch the binaries in the repos ;)
No, we don't operate that way, take the latest source and use that. Of
course, this is open source software, so if you feel you have to back port
changes into older versions, you can do so.
Also, we don't maintain *any* Linux repositories, what you suggest would
require all the maintainers of the various distributions to create new
binaries (many distros do not carry our vanilla binary), and find some way
to make these available with a different version so that update would
happen. Good luck with organising that.....
Well i understand.
It`s just a bit scary to be able to get a whole system nearly out of service
with a single PDF that is converted to a thumbnail. Not such an uncommon task
...

But, as you mentioned, this might be the responsibility of the package
maintainers and not yours.

Thanks anyway,
Alex
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@ghostscript.com
2014-10-05 20:51:50 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=695533

Henry Stiles <***@artifex.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Keywords| |bountiable
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@ghostscript.com
2014-10-09 13:28:43 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=695533

Ken Sharp <***@artifex.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |WORKSFORME
Status|UNCONFIRMED |RESOLVED

--- Comment #5 from Ken Sharp <***@artifex.com> ---
Discussed offline with Shelly. The warnings can apparently be ignored (cf bug
#695580).

The reason for the image error which I see is because one of the images in the
file is *huge*, 20852x13807 samples, and the calloc for the bitmap fails. If
you run with -dPDFSTOPONERROR we exit with the last OS error "Not enough space"
which sounds reasonable to me.

Presumably the original reporter has sufficient available memory to be able to
allocate a 280 Mb bitmap and so the file renders as expected.

There isn't much we can do about having insufficient memory except raise an
error, which we do, and the current code works as expected, so closing as
'worksforme'. (I checked with Shelly first and he's happy with that).
--
You are receiving this mail because:
You are the QA Contact for the bug.
Loading...