Whenever I execute one of the bad commands it looks like it gets stuck in some form of infinite loop. When running 'top', this is the end result:
PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND
159 135 root D 20044m 59% 2 0% convert ./huge-document.psd -flatten ./huge-document.jpg
143 135 root T 20044m 59% 2 0% convert ./huge-document.psd ./huge-document.jpg
Without the -flatten option and using the preview layer (the good command) all is fine.
Any ideas would be helpful .
Version: 7.0.4-4
Environment: Alpine 3.5 in Docker 1.12
Machine: AWS EC2 c4.4xlarge
Memory: 30GB
Storage: AWS EFS
Cores: 16
Settings:
----------> MAGICK_AREA_LIMIT: 8GiB
----------> MAGICK_HEIGHT_LIMIT: 300MP
----------> MAGICK_MAP_LIMIT: 16GiB
----------> MAGICK_MEMORY_LIMIT: 4GiB
----------> MAGICK_TEMPORARY_PATH: /tmp
----------> MAGICK_THREADS_LIMIT: 6
----------> MAGICK_TMPDIR: /tmp
----------> MAGICK_WIDTH_LIMIT: 300MP
----------> OMP_NUM_THREADS: 6
Download link: http://s3-eu-west-1.amazonaws.com/image ... cument.psd
Bad command 1: convert ./huge-document.psd ./huge-document.jpg
Bad command 2: convert ./huge-document.psd -flatten ./huge-document.jpg
Good command: convert ./huge-document.psd[0] ./huge-document.jpg
Configuration:
Path: /usr/local/lib/ImageMagick-7.0.4//config-Q16HDRI/configure.xml
Name Value
-------------------------------------------------------------------------------
CC gcc
CFLAGS -I/usr/include/libxml2 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/librsvg-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gdk-pixbuf-2.0 -pthread -I/usr/include/libpng16 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/OpenEXR -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -fopenmp -Wno-deprecated-declarations -Wno-error=unused-variable -Wall -mtune=core2 -fexceptions -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16
CODER_PATH /usr/local/lib/ImageMagick-7.0.4/modules-Q16HDRI/coders
CONFIGURE ./configure '--with-gslib=yes' '--with-x=yes' '--with-rsvg=yes' '--without-magick-plus-plus' 'CC=gcc' 'CFLAGS=-Wno-deprecated-declarations -Wno-error=unused-variable'
CONFIGURE_PATH /usr/local/etc/ImageMagick-7/
COPYRIGHT Copyright (C) 1999-2016 ImageMagick Studio LLC
CPPFLAGS -I/usr/local/include/ImageMagick-7
CXX g++
CXXFLAGS -g -O2
DEFS -DHAVE_CONFIG_H
DELEGATES bzlib mpeg fftw fontconfig freetype gslib jng jpeg openexr pango png ps rsvg tiff webp wmf x xml zlib
DISTCHECK_CONFIG_FLAGS 'CC=gcc' 'CFLAGS=-Wno-deprecated-declarations -Wno-error=unused-variable' --disable-deprecated --with-quantum-depth=16 --with-jemalloc=no --with-umem=no --with-autotrace=no --with-fontpath= --with-perl=no
DOCUMENTATION_PATH /usr/local/share/doc/ImageMagick-7
EXEC-PREFIX /usr/local
EXECUTABLE_PATH /usr/local/bin
FEATURES DPC HDRI Cipher OpenMP
FILTER_PATH /usr/local/lib/ImageMagick-7.0.4/modules-Q16HDRI/filters
GIT_REVISION 11509
HOST x86_64-unknown-linux-gnu
INCLUDE_PATH /usr/local/include/ImageMagick-7
LDFLAGS -L/usr/local/lib
LIB_VERSION 0x704
LIB_VERSION_NUMBER 7,0,4,4
LIBRARY_PATH /usr/local/lib/ImageMagick-7.0.4
LIBS -ltiff -lfreetype -ljpeg -lgs -lpng16 -lfftw3 -lfontconfig -lfreetype -lwebp -lwmflite -lXext -lX11 -lbz2 -lIlmImf -lImath -lHalf -lIex -lIexMath -lIlmThread -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -lcairo -lrsvg-2 -lm -lgio-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lcairo -lxml2 -L/lib -lz -lm -lgomp
NAME ImageMagick
PCFLAGS -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16
PREFIX /usr/local
QuantumDepth 16
RELEASE_DATE 2017-01-16
SHARE_PATH /usr/local/share/ImageMagick-7
SHAREARCH_PATH /usr/local/lib/ImageMagick-7.0.4/config-Q16HDRI
TARGET_CPU x86_64
TARGET_OS linux-gnu
TARGET_VENDOR unknown
VERSION 7.0.4
WEBSITE http://www.imagemagick.org
Path: [built-in]
Name Value
-------------------------------------------------------------------------------
FEATURES OpenMP
NAME ImageMagick
QuantumDepth 16