php5 segmentation fault in connection with imagemagick
Hello,
I ran into this by experimenting with the official Docker image of php.
I was also able to reproduce it with the binaries provided by Alpine
Linux too.
Actually I use php-fpm but the reproduction occurred by cli “php -i”.
Version details
——————————
/var/run # apk -vv info | sort | egrep “php5|magic|musl”
imagemagick-6.9.4.1-r0 - A collection of tools and libraries for many
image formats
musl-1.1.14-r11 - the musl c library (libc) implementation
musl-dbg-1.1.14-r11 - the musl c library (libc) implementation
musl-utils-1.1.14-r11 - the musl c library (libc) implementation
php5-5.6.24-r0 - The PHP language runtime engine
php5-apcu-4.0.10-r1 - PHP extension APC User Cache
php5-cli-5.6.24-r0 - PHP Command Line Interface (CLI)
php5-common-5.6.24-r0 - PHP Common Files
php5-ctype-5.6.24-r0 - ctype extension for PHP
php5-curl-5.6.24-r0 - curl extension for PHP
php5-dbg-5.6.24-r0 - The PHP language runtime engine
php5-dom-5.6.24-r0 - dom extension for PHP
php5-fpm-5.6.24-r0 - PHP FastCGI Process Manager (FPM)
php5-gd-5.6.24-r0 - gd extension for PHP
php5-iconv-5.6.24-r0 - iconv extension for PHP
php5-imagick-3.4.2-r0 - PHP bindings to the ImageMagick library.
php5-intl-5.6.24-r0 - intl extension for PHP
php5-json-5.6.24-r0 - json extension for PHP
php5-mcrypt-5.6.24-r0 - mcrypt extension for PHP
php5-mysql-5.6.24-r0 - mysql extension for PHP
php5-pdo-5.6.24-r0 - pdo extension for PHP
php5-pdo_mysql-5.6.24-r0 - pdo_mysql extension for PHP
php5-posix-5.6.24-r0 - posix extension for PHP
php5-pspell-5.6.24-r0 - pspell extension for PHP
php5-xml-5.6.24-r0 - xml extension for PHP
php5-zip-5.6.24-r0 - zip extension for PHP
php5-zlib-5.6.24-r0 - zlib extension for PHP
——————————
Backtraces:
Core was generated by `php -i’.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 a_crash () at ./arch/x86_64/atomic_arch.h:108
108 ./arch/x86_64/atomic_arch.h: No such file or directory.
(gdb) bt
#0 a_crash () at ./arch/x86_64/atomic_arch.h:108
#1 free (p=0x562cff699920) at src/malloc/malloc.c:464
#2 0x00007faa3be6c30e in RelinquishMagickMemory () from
/usr/lib/libMagickCore-6.Q16.so.2
#3 0x00007faa3bebcfe0 in DeleteMagickThreadKey () from
/usr/lib/libMagickCore-6.Q16.so.2
#4 0x00007faa25ec1710 in UnregisterTIFFImage () from
/usr/lib/ImageMagick-6.9.4/modules-Q16/coders/tiff.so
#5 0x00007faa3be6d8cd in ?? () from /usr/lib/libMagickCore-6.Q16.so.2
#6 0x00007faa3beaf403 in DestroySplayTree () from
/usr/lib/libMagickCore-6.Q16.so.2
#7 0x00007faa3be6e526 in DestroyModuleList () from
/usr/lib/libMagickCore-6.Q16.so.2
#8 0x00007faa3be6ee86 in ModuleComponentTerminus () from
/usr/lib/libMagickCore-6.Q16.so.2
#9 0x00007faa3be6a25f in MagickCoreTerminus () from
/usr/lib/libMagickCore-6.Q16.so.2
#10 0x00007faa3c4480ae in zm_shutdown_imagick () from
/usr/lib/php5/modules/imagick.so
#11 0x0000562cfe7bc36c in module_destructor (module=0x562cff370480) at
/home/buildozer/aports/main/php5/src/php-5.6.24/Zend/zend_API.c:2376
#12 0x0000562cfe7c0b23 in i_zend_hash_bucket_delete
(p=0x562cff3700a0, ht=0x562cfefc4ee0 ) at
/home/buildozer/aports/main/php5/src/php-5.6.24/Zend/zend_hash.c:182
#13 zend_hash_bucket_delete (ht=ht@entry=0x562cfefc4ee0
, p=0x562cff3700a0) at
/home/buildozer/aports/main/php5/src/php-5.6.24/Zend/zend_hash.c:192
#14 0x0000562cfe7c1c54 in zend_hash_graceful_reverse_destroy
(ht=0x562cfefc4ee0 ) at
/home/buildozer/aports/main/php5/src/php-5.6.24/Zend/zend_hash.c:613
#15 0x0000562cfe7bb005 in zend_destroy_modules () at
/home/buildozer/aports/main/php5/src/php-5.6.24/Zend/zend_API.c:1894
#16 0x0000562cfe7b5bad in zend_shutdown () at
/home/buildozer/aports/main/php5/src/php-5.6.24/Zend/zend.c:836
#17 0x0000562cfe76b0a0 in php_module_shutdown () at
/home/buildozer/aports/main/php5/src/php-5.6.24/main/main.c:2477
#18 0x0000562cfe634317 in main (argc=2, argv=0x7faa3e389fa0) at
/home/buildozer/aports/main/php5/src/php-5.6.24/sapi/cli/php_cli.c:1393
(gdb)
Core was generated by `php -i’.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f19964d080f in free (p=0x5639bb1e1920) at
src/malloc/malloc.c:460
460 src/malloc/malloc.c: No such file or directory.
(gdb) bt
#0 0x00007f19964d080f in free (p=0x5639bb1e1920) at
src/malloc/malloc.c:460
#1 0x00007f199319730e in RelinquishMagickMemory () from
/usr/lib/libMagickCore-6.Q16.so.2
#2 0x00007f19931e7fe0 in DeleteMagickThreadKey () from
/usr/lib/libMagickCore-6.Q16.so.2
#3 0x00007f197d1ec710 in UnregisterTIFFImage () from
/usr/lib/ImageMagick-6.9.4/modules-Q16/coders/tiff.so
#4 0x00007f19931988cd in ?? () from /usr/lib/libMagickCore-6.Q16.so.2
#5 0x00007f19931da403 in DestroySplayTree () from
/usr/lib/libMagickCore-6.Q16.so.2
#6 0x00007f1993199526 in DestroyModuleList () from
/usr/lib/libMagickCore-6.Q16.so.2
#7 0x00007f1993199e86 in ModuleComponentTerminus () from
/usr/lib/libMagickCore-6.Q16.so.2
#8 0x00007f199319525f in MagickCoreTerminus () from
/usr/lib/libMagickCore-6.Q16.so.2
#9 0x00007f19937730ae in zm_shutdown_imagick () from
/usr/lib/php5/modules/imagick.so
#10 0x00005639b94ad36c in module_destructor (module=0x5639baeb8480) at
/home/buildozer/aports/main/php5/src/php-5.6.24/Zend/zend_API.c:2376
#11 0x00005639b94b1b23 in i_zend_hash_bucket_delete
(p=0x5639baeb80a0, ht=0x5639b9cb5ee0 ) at
/home/buildozer/aports/main/php5/src/php-5.6.24/Zend/zend_hash.c:182
#12 zend_hash_bucket_delete (ht=ht@entry=0x5639b9cb5ee0
, p=0x5639baeb80a0) at
/home/buildozer/aports/main/php5/src/php-5.6.24/Zend/zend_hash.c:192
#13 0x00005639b94b2c54 in zend_hash_graceful_reverse_destroy
(ht=0x5639b9cb5ee0 ) at
/home/buildozer/aports/main/php5/src/php-5.6.24/Zend/zend_hash.c:613
#14 0x00005639b94ac005 in zend_destroy_modules () at
/home/buildozer/aports/main/php5/src/php-5.6.24/Zend/zend_API.c:1894
#15 0x00005639b94a6bad in zend_shutdown () at
/home/buildozer/aports/main/php5/src/php-5.6.24/Zend/zend.c:836
#16 0x00005639b945c0a0 in php_module_shutdown () at
/home/buildozer/aports/main/php5/src/php-5.6.24/main/main.c:2477
#17 0x00005639b9325317 in main (argc=2, argv=0x7f19956b4fa0) at
/home/buildozer/aports/main/php5/src/php-5.6.24/sapi/cli/php_cli.c:1393
Config and core file are attached.
Please let me know if something else is needed.
Regards
(from redmine: issue id 6021, created on 2016-08-10, closed on 2018-08-22)
- Uploads:
- php5.tar.gz php configuration