Bug 700350 - GS seg fault
Summary: GS seg fault
Status: RESOLVED DUPLICATE of bug 700315
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: 9.25
Hardware: Macintosh MacOS X
: P4 normal
Assignee: Ken Sharp
QA Contact: Bug traffic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-08 05:24 UTC by John Haggerty
Modified: 2018-12-08 14:08 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
Example file to crash Ghostscript (104.16 KB, application/pdf)
2018-12-08 05:24 UTC, John Haggerty
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Haggerty 2018-12-08 05:24:50 UTC
Created attachment 16523 [details]
Example file to crash Ghostscript

Ghostscript 9.26 seg faults when making thumbnails in the elog program I use.  Here's the command line that is generated by a call from Imagemagick:

gs -sstdout=%stderr -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pngalpha' -dTextAlphaBits=4 -dGraphicsAlphaBits=4 '-r72x72' -dFirstPage=1 -dLastPage=8 -sOutputFile=xxx-%d.png crashghost.pdf

Here's some output:

GPL Ghostscript 9.26 (2018-11-20)
Copyright (C) 2018 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 2.
Page 1
Segmentation fault: 11

I'm using a brew installed ghostscript 9.26 on a Mac (10.14.1).

I've tried a variety of fixes (building from source, installing from a dmg), but the only thing that doesn't crash is going back to 9.23.

The command works if you change pngalpha to png16m.
Comment 1 Ken Sharp 2018-12-08 12:37:59 UTC
Almost certainly a duplicate of this bug

*** This bug has been marked as a duplicate of bug 700315 ***
Comment 2 Ken Sharp 2018-12-08 12:43:03 UTC
When you say 'building from source' which SHA1 do you mean ? You've put 9.25 in the version field (I appreciate we've forgotten to add 9.26), is that the version you used, or are you building from the current or recent HEAD ?
Comment 3 John Haggerty 2018-12-08 13:55:55 UTC
(In reply to Ken Sharp from comment #2)
> When you say 'building from source' which SHA1 do you mean ? You've put 9.25
> in the version field (I appreciate we've forgotten to add 9.26), is that the
> version you used, or are you building from the current or recent HEAD ?

I did a brew install ghostscript which gave me 9.26 built by the brew gods, then I tried a --build-from-source build, then a --HEAD, but I'm not expert enough to know what versions I'm actually getting (other than the 9.26 that gs reports).

My searches somehow didn't show up that other bug report, it looks like you already squashed this bug, thanks!
Comment 4 Ken Sharp 2018-12-08 14:08:24 UTC
(In reply to John Haggerty from comment #3)

> I did a brew install ghostscript which gave me 9.26 built by the brew gods,
> then I tried a --build-from-source build, then a --HEAD, but I'm not expert
> enough to know what versions I'm actually getting (other than the 9.26 that
> gs reports).

OK if its reporting 9.26 then you aren't using the current HEAD from our repository, because that self-identifies as 9.17 pre-release.

 
> My searches somehow didn't show up that other bug report, it looks like you
> already squashed this bug, thanks!

It does sound like it, there have been several duplicates of this problem. If you can clone from our Git repository you should be able to build that. Alternatively, if you take the existing source you have and apply the patch here:

http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=fae21f1668d2b44b18b84cf0923a1d5f3008a696

and rebuild, then that will probably solve your problem.

*** This bug has been marked as a duplicate of bug 700315 ***