Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#58595 closed defect (duplicate)

ImageMagick: Errors after upgrading to Ghostscript 9.27

Reported by: 7RKJ2rIlETTFzZwO Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: Cc: wilya7, dershow, ryandesign (Ryan Carsten Schmidt)
Port: ImageMagick

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Hi all,

I am running Macos 10.14.5 (18F132), and installed Ghostscript via Macports. I have recently upgraded to version 9.27. The full output for ghostscript -version reads:

GPL Ghostscript 9.27 (2019-04-04)
Copyright (C) 2018 Artifex Software, Inc.  All rights reserved.

I have a script for batch converting PDF files to PNG files, which goes:

for i in *.pdf; do convert -verbose -density 600 -trim $i -quality 100 -flatten $(basename "$i" .pdf).png;done

After I upgraded to the latest version of Ghostscript, this no longer works. I get an 'Abort trap: 6' for each file in the batch. Sample output reads:

[ghostscript library 9.27] -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pngalpha' -dTextAlphaBits=4 -dGraphicsAlphaBits=4 '-r600x600' '-sOutputFile=/var/folders/k0/m6mz3d055m75782ynnkt2k0w0000gn/T/magick-5910MkmWy1yIM0tx%d' '-f/var/folders/k0/m6mz3d055m75782ynnkt2k0w0000gn/T/magick-5910gs9cNcP8C7cU' '-f/var/folders/k0/m6mz3d055m75782ynnkt2k0w0000gn/T/magick-5910iJZ-CiPdfIWp'Abort trap: 6

When I upgraded Ghostscript to 9.27, I also upgraded Imagemagick to a new version. First thought this would be related to Imagemagick, so I posted this over in the Imagemagick forum (http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=36183&sid=9a6db9c431ce72426e9a61ed1ab4fb16).

Attachments (4)

identify_2019-06-19-155308_Hasbeen-MBP.crash (15.5 KB) - added by wilya7 5 years ago.
crash report
convert_2019-06-19-170717_Hasbeen-MBP.crash (15.3 KB) - added by wilya7 5 years ago.
gs-X11_2019-06-15-124613.crash (1.2 KB) - added by 7RKJ2rIlETTFzZwO 5 years ago.
A gsX11 crash report.
convert_2019-06-15-105224-2.crash (15.1 KB) - added by 7RKJ2rIlETTFzZwO 5 years ago.
A Imagemagick/Ghostscript crash report.

Download all attachments as: .zip

Change History (18)

comment:1 Changed 5 years ago by wilya7

I can confirm the problem.

convert -verbose image.pdf image.jpg
[ghostscript library 9.27] -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 
-dGridFitTT=2 '-sDEVICE=pamcmyk32' -dTextAlphaBits=4 -dGraphicsAlphaBits=4 '-r72x72' -dUseCIEColor  '-sOutputFile=/var/folders
/1p/rd_snrqx6g139qk9wvrlc68m0000gn/T/magick-53743KlYHSzKMdFfK%d' '-f/var/folders/1p/rd_snrqx6g139qk9wvrlc68m0000gn/T/magick-53743dzbPZSUhBxKm' 
'-f/var/folders/1p/rd_snrqx6g139qk9wvrlc68m0000gn/T/magick-53743_bFFtodyR3tJ'Abort trap: 6

If I use only ghostscript, it works

gs -dNOPAUSE -sDEVICE=jpeg -sOutputFile=image.jpg image.pdf 
GPL Ghostscript 9.27 (2019-04-04)
Copyright (C) 2018 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
Processing pages 1 through 1.
Page 1
GS>quit

this link to a stackoverflow post might be relevant: https://stackoverflow.com/questions/56609227/ghostscript-looks-for-dyld-library-in-the-wrong-place

My system

bash-3.2# port version
Version: 2.5.4
bash-3.2# sw_vers 
ProductName:	Mac OS X
ProductVersion:	10.12.6
BuildVersion:	16G2016

Version of imagemagick and ghostscript

bash-3.2# port installed ghostscript imagemagick
The following ports are currently installed:
  ghostscript @9.27_0+x11 (active)
  ImageMagick @6.9.9-40_6+x11 (active)
Last edited 5 years ago by wilya7 (previous) (diff)

comment:2 Changed 5 years ago by wilya7

Cc: wilya7 added

comment:3 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Milestone: MacPorts 2.6.0

this link to a stackoverflow post might be relevant: ​https://stackoverflow.com/questions/56609227/ghostscript-looks-for-dyld-library-in-the-wrong-place

Not enough information has been provided here to know whether that is relevant.

"Abort trap: 6" is a crash, which means macOS should have generated a crash log file in ~/Library/Logs/DiagnosticReports. Could one of you please attach the relevant crash log?

Changed 5 years ago by wilya7

crash report

Changed 5 years ago by wilya7

comment:4 Changed 5 years ago by wilya7

Thanks for your help.

I have a bunch of crash reports all generated around the time I was trying to convert a pdf to a jpg file with imagemagick. There are crash reports named convert_* and others identify_* They look pretty similar to me, just in case I have attached 2 representative examples of both. Please let me know if I can assist the bug tracking in any other way.

comment:5 in reply to:  3 Changed 5 years ago by 7RKJ2rIlETTFzZwO

Replying to ryandesign:

this link to a stackoverflow post might be relevant: ​https://stackoverflow.com/questions/56609227/ghostscript-looks-for-dyld-library-in-the-wrong-place

Not enough information has been provided here to know whether that is relevant.

"Abort trap: 6" is a crash, which means macOS should have generated a crash log file in ~/Library/Logs/DiagnosticReports. Could one of you please attach the relevant crash log?

This is relevant insofar as it is me who asked this question on Stackoverflow.

Changed 5 years ago by 7RKJ2rIlETTFzZwO

A gsX11 crash report.

Changed 5 years ago by 7RKJ2rIlETTFzZwO

A Imagemagick/Ghostscript crash report.

comment:6 Changed 5 years ago by 7RKJ2rIlETTFzZwO

Problem persists with GS 9.27.1.

comment:7 Changed 5 years ago by dershow

Cc: dershow added

comment:8 Changed 5 years ago by 7RKJ2rIlETTFzZwO

Problem persists after upgrading to Macports base version 2.6.0.

comment:9 Changed 5 years ago by wilya7

I am using emacs org-mode for a project and I have to use a lot of Latex. With this bug it is impossible to do a preview of latex code as org-mode uses convert utility to generate a png image from the an intermediate pdf file, which with ghostscript 2.27 fails with an "Abort trap:6" error due to this bug. Therefore I had to downgrade to ghostscript 2.26, as suggested in this thread. Now that I did that, everything works! I followed the procedure outlined here: howto/InstallingOlderPort

Briefly, this what I did (for other noobs like me):

cd
mkdir git
cd git
git clone --single-branch https://github.com/macports/macports-ports.git
cd macports-ports
git checkout b79b19f8fe80d5e804eee9c62fd73a2ac980f82a
cd print/ghostscript
sudo port install

I hope that ghostscript developers manage to track down this bug. I cannot understand how this does not affects more people! From my point of view this bug is a problem big enough to require a downgrade by macports project.

Edit: I specified the use of "sudo" when installing the port. Thanks to Szepi for suggesting it.

Last edited 5 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:10 Changed 5 years ago by Szepi (Csaba Szepesvari)

This indeed works. (You may need to change port install to sudo port install..)

comment:11 Changed 5 years ago by 7RKJ2rIlETTFzZwO

Also recommend upgrading outdated ports using

sudo port upgrade outdated and not rdependentof:ghostscript and not ghostscript 

for the time being.

I second the suggestion of downgrading GS to 9.26 in the repositories until this is issue is resolved.

comment:12 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

This problem has also been reported as #57740.

How about instead of downgrading ghostscript we try to update it to the latest version, which is 9.50.

comment:13 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Looks like as of Ghostscript 9.27, a change is needed in ImageMagick when initializing Ghostscript. We need to update to ImageMagick 6.9.10-71 6.9.10-39 or later to get the fix.

Last edited 5 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:14 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign added
Port: ImageMagick added; ghostscript removed
Resolution: duplicate
Status: newclosed
Summary: Errors after upgrading to Ghostscript 9.27ImageMagick: Errors after upgrading to Ghostscript 9.27

Duplicate of #57740.

Note: See TracTickets for help on using tickets.