Bug 700315

Summary: Segfault in GS 9.26 with certain PDFs with -dLastPage=1
Product: Ghostscript Reporter: Bheeshmar Redheendran <bheeshmar>
Component: PDF InterpreterAssignee: Ken Sharp <ken.sharp>
Status: RESOLVED FIXED    
Severity: normal CC: bhaak, haggerty
Priority: P4    
Version: master   
Hardware: Macintosh   
OS: MacOS X   
Customer: Word Size: ---
Attachments: Output of run with -dDEBUG
PDF example that causes the segfault

Description Bheeshmar Redheendran 2018-12-03 16:49:41 UTC
We use ImageMagick to extract a the first page of a PDF as a thumbnail and recently started getting exceptions with some PDFs. Traced it to the call that ImageMagick was making:

gs  -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pngalpha' -dTextAlphaBits=4 -dGraphicsAlphaBits=4 '-r72x72' -dLastPage=1 -sOutputFile=1.png -f Bloomfire-Security_and_Redundancy.pdf

When this is run with GS version 9.25, the thumbnail is extracted with no error.
When this is run with GS version 9.26, I see "Segmentation fault: 11"

I've attached a file that causes there error. Observed on both OSX and Ubuntu Linux.
Comment 1 Bheeshmar Redheendran 2018-12-03 16:50:51 UTC
Created attachment 16470 [details]
Output of run with -dDEBUG
Comment 2 Bheeshmar Redheendran 2018-12-03 16:51:24 UTC
Created attachment 16471 [details]
PDF example that causes the segfault
Comment 3 Ken Sharp 2018-12-04 00:47:14 UTC

*** This bug has been marked as a duplicate of bug 699815 ***
Comment 4 Ken Sharp 2018-12-04 21:05:41 UTC
*** Bug 700314 has been marked as a duplicate of this bug. ***
Comment 5 Ken Sharp 2018-12-04 21:10:10 UTC
*** Bug 700313 has been marked as a duplicate of this bug. ***
Comment 6 Ken Sharp 2018-12-04 21:32:36 UTC
Fixed in commit fae21f1668d2b44b18b84cf0923a1d5f3008a696
Comment 7 Ken Sharp 2018-12-08 12:38:00 UTC
*** Bug 700350 has been marked as a duplicate of this bug. ***
Comment 8 Ken Sharp 2018-12-08 14:08:24 UTC
*** Bug 700350 has been marked as a duplicate of this bug. ***