Page 1 of 1

IM6: SIGSEV in ProfileImage

Posted: 2019-02-03T03:44:09-07:00
by udotirol
Not sure if the issue is in ImageMagic or in the PHP binding, but I hope you don't mind me starting here :)

We've seen PHP segfaulting over some issue in combination with ImageMagic, see the back trace below:

Code: Select all

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00000008029cf6a8 in ProfileImage () from /usr/local/lib/libMagickCore-6.so.6
(gdb) bt
#0  0x00000008029cf6a8 in ProfileImage () from /usr/local/lib/libMagickCore-6.so.6
#1  0x000000080280c075 in MagickProfileImage () from /usr/local/lib/libMagickWand-6.so.6
#2  0x0000000802722925 in zim_imagick_profileimage (execute_data=0x801627430, return_value=0x7fffffffb1a8) at imagick_class.c:5056
#3  0x000000000072bcf5 in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (execute_data=0x8016273a0) at Zend/zend_vm_execute.h:907
This happens with ImageMagick 6.9.10.22 on FreeBSD 11.2 and FreeBSD 12.

Fortunately we have been able to workaround the issue by upgrading to ImageMagick 7.0.8.22, but I'm quite sure this will have some unexpected sideeffects on the PHP side.

Thanks

Re: IM6: SIGSEV in ProfileImage

Posted: 2019-02-03T06:23:47-07:00
by magick
The fault is likely in ImageMagick unless the PHP binding is passing a faulty profile blob to ImageMagick. The only way to know for sure is to reproduce the issue. Can you post a link to one of the images that fail, and a minimal PHP script that consistently fails. Once we can reproduce the problem, we will be able to determine its cause and offer a patch to fix it.