Closed it-can closed 3 years ago
So, looks like a regression in upstream IM 6.9.12-16...
Need a minimal reproducer (without laravel) reproducer to investigate.
Also ensure the webserver have been restarted after the update
webserver is restarted and php-fpm also... I will try to create an example... But is happens on 1 system and the other not..
I also tried ImageMagick7 but then the same happens
I created a repo, https://github.com/it-can/imagick-bug
just clone it and run php index.php
On my machine I got this error (version ImageMagick6 1:6.9.12.16-1.el8.remi)
php index.php
free(): invalid next size (normal)
Afgebroken (geheugendump gemaakt)
@it-can did you mean that you install both php-pecl-imagick-im7 with ImageMagicj7-libs (instead of php-pecl-imagick-im6)
yum list installed | grep Image
ImageMagick6.x86_64 1:6.9.12.15-1.el8.remi @remi
ImageMagick6-devel.x86_64 1:6.9.12.15-1.el8.remi @remi
ImageMagick6-heic.x86_64 1:6.9.12.15-1.el8.remi @remi-safe
ImageMagick6-libs.x86_64 1:6.9.12.15-1.el8.remi @remi-safe
yum list installed | grep php
oniguruma5php.x86_64 6.9.7.1-1.el8.remi @remi-safe
php.x86_64 8.0.7-1.el8.remi @remi-modular
php-bcmath.x86_64 8.0.7-1.el8.remi @remi-modular
php-cli.x86_64 8.0.7-1.el8.remi @remi-modular
php-common.x86_64 8.0.7-1.el8.remi @remi-modular
php-devel.x86_64 8.0.7-1.el8.remi @remi-modular
php-fedora-autoloader.noarch 1.0.1-2.el8.remi @remi-safe
php-fpm.x86_64 8.0.7-1.el8.remi @remi-modular
php-gd.x86_64 8.0.7-1.el8.remi @remi-modular
php-imap.x86_64 8.0.7-1.el8.remi @remi-modular
php-intl.x86_64 8.0.7-1.el8.remi @remi-modular
php-mbstring.x86_64 8.0.7-1.el8.remi @remi-modular
php-mysqlnd.x86_64 8.0.7-1.el8.remi @remi-modular
php-nikic-php-parser4.noarch 4.10.5-1.el8.remi @remi
php-opcache.x86_64 8.0.7-1.el8.remi @remi-modular
php-pdo.x86_64 8.0.7-1.el8.remi @remi-modular
php-pecl-igbinary.x86_64 3.2.3-1.el8.remi.8.0 @remi-modular
php-pecl-imagick-im6.x86_64 3.5.0-1.el8.remi.8.0 @remi-modular
php-pecl-lzf.x86_64 1.6.8-4.el8.remi.8.0 @remi-modular
php-pecl-mcrypt.x86_64 1.0.4-1.el8.remi.8.0 @remi-modular
php-pecl-msgpack.x86_64 2.1.2-1.el8.remi.8.0 @remi-modular
php-pecl-redis5.x86_64 5.3.4-1.el8.remi.8.0 @remi-modular
php-pecl-zip.x86_64 1.19.3-2.el8.remi.8.0 @remi-modular
php-process.x86_64 8.0.7-1.el8.remi @remi-modular
php-soap.x86_64 8.0.7-1.el8.remi @remi-modular
php-sodium.x86_64 8.0.7-1.el8.remi @remi-modular
php-tidy.x86_64 8.0.7-1.el8.remi @remi-modular
php-xml.x86_64 8.0.7-1.el8.remi @remi-modular
@it-can did you mean that you install both php-pecl-imagick-im7 with ImageMagicj7-libs (instead of php-pecl-imagick-im6)
I tried both versions, but got the same problem...
OK, can reproduce, definively not an bug in the package but a regression in upstream library
Please file a bug on
From valgrind output
=480685== Invalid write of size 1
==480685== at 0x4840643: memmove (vg_replace_strmem.c:1270)
==480685== by 0xB3EEA6F6: UnknownInlinedFun (jpeg.c:2130)
==480685== by 0xB3EEA6F6: WriteJPEGImage_ (jpeg.c:2813)
==480685== by 0xB3EEBC98: WriteJPEGImage (jpeg.c:3032)
==480685== by 0x11E99C1E: WriteImage (constitute.c:1286)
==480685== by 0x11E68923: ImageToBlob (blob.c:2075)
==480685== by 0x11C68471: zim_Imagick_getImagesBlob (in /usr/lib64/php/modules/imagick.so)
==480685== by 0x55F6AC: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1730)
==480685== by 0x55F6AC: execute_ex (zend_vm_execute.h:53901)
==480685== by 0x56191A: zend_execute (zend_vm_execute.h:57993)
==480685== by 0x4D845B: zend_execute_scripts (zend.c:1679)
==480685== by 0x47571F: php_execute_script (main.c:2650)
==480685== by 0x563A21: do_cli (php_cli.c:964)
==480685== by 0x34444D: main (php_cli.c:1359)
==480685== Address 0xb4122b90 is 0 bytes after a block of size 16,384 alloc'd
==480685== at 0x483BCE8: realloc (vg_replace_malloc.c:834)
==480685== by 0x11F32F97: ResizeMagickMemory (memory.c:1405)
==480685== by 0x11FD7E80: ConcatenateStringInfo (string.c:538)
==480685== by 0xB3EEA6F6: UnknownInlinedFun (jpeg.c:2130)
==480685== by 0xB3EEA6F6: WriteJPEGImage_ (jpeg.c:2813)
==480685== by 0xB3EEBC98: WriteJPEGImage (jpeg.c:3032)
==480685== by 0x11E99C1E: WriteImage (constitute.c:1286)
==480685== by 0x11E68923: ImageToBlob (blob.c:2075)
==480685== by 0x11C68471: zim_Imagick_getImagesBlob (in /usr/lib64/php/modules/imagick.so)
==480685== by 0x55F6AC: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1730)
==480685== by 0x55F6AC: execute_ex (zend_vm_execute.h:53901)
==480685== by 0x56191A: zend_execute (zend_vm_execute.h:57993)
==480685== by 0x4D845B: zend_execute_scripts (zend.c:1679)
==480685== by 0x47571F: php_execute_script (main.c:2650)
==480685==
@it-can Can you please give a try to one of the test builds
which are available in the temp directory
Yes this works @remicollet !
Is it advisable to run imagemagick7 instead of 6?
Thanks for the quick work and fixes!
Is it advisable to run imagemagick7 instead of 6?
API are a bit different With im6 various API are deprecated, and removed in im7 Im7 are some other API
So need to test if your app is ready for 7
Here is a diff of reflection (php --re imagick
) with both version
Are you releasing a new version? Or when the upstream fix has been merged?
Are you releasing a new version? Or when the upstream fix has been merged?
I will have prefer to have some feedback from upstream, but as this issue seems critical, and the fix quite trivial, I have run a new set of builds (and test suite passes), which are now available in the repository
I also choose to add a REFLECTION file in the php-pecl-imagick-im6/7 package for developers (something I should probably consider for all packages)
These files are also tracked on git
For memory both PRs have been merged upstream.
Issue is described here: https://github.com/Imagick/imagick/issues/441