Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Memory corruption in Phalcon\Image\Adapter\Imagick #1371

Closed
ghost opened this issue Oct 12, 2013 · 3 comments
Closed

[BUG] Memory corruption in Phalcon\Image\Adapter\Imagick #1371

ghost opened this issue Oct 12, 2013 · 3 comments

Comments

@ghost
Copy link

ghost commented Oct 12, 2013

==5583== Thread 4:
==5583== Conditional jump or move depends on uninitialised value(s)
==5583==    at 0x7CF376B: ??? (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x3BAD408869: ??? (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0)
==5583==    by 0x3BAA407F8D: start_thread (pthread_create.c:311)
==5583==    by 0x3BA9CF9E1C: clone (clone.S:113)
==5583== 
==5583== Conditional jump or move depends on uninitialised value(s)
==5583==    at 0x7CF3792: ??? (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x3BAD408869: ??? (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0)
==5583==    by 0x3BAA407F8D: start_thread (pthread_create.c:311)
==5583==    by 0x3BA9CF9E1C: clone (clone.S:113)
==5583== 
==5583== Conditional jump or move depends on uninitialised value(s)
==5583==    at 0x7CF37B9: ??? (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x3BAD408869: ??? (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0)
==5583==    by 0x3BAA407F8D: start_thread (pthread_create.c:311)
==5583==    by 0x3BA9CF9E1C: clone (clone.S:113)
==5583== 
==5583== Thread 1:
==5583== Conditional jump or move depends on uninitialised value(s)
==5583==    at 0x7CF376B: ??? (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x7CF86F3: DrawGradientImage (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x7D75140: GradientImage (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x17892207: ??? (in /usr/lib/x86_64-linux-gnu/ImageMagick-6.7.7/modules-Q16/coders/gradient.so)
==5583==    by 0x7CBC3B1: ReadImage (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x79C397B: MagickReadImage (in /usr/lib/x86_64-linux-gnu/libMagickWand.so.5.0.0)
==5583==    by 0x76CAE36: php_imagick_read_image_using_imagemagick (imagick_file.c:124)
==5583==    by 0x76CB18E: php_imagick_read_file (imagick_file.c:240)
==5583==    by 0x76DC9C3: zim_imagick_newpseudoimage (imagick_class.c:3636)
==5583==    by 0xC81C5A7: phalcon_alt_call_method (fcall.c:827)
==5583==    by 0xC81CC6A: phalcon_alt_call_user_method (fcall.c:955)
==5583==    by 0xC7FA1F9: phalcon_call_method_vparams (fcall.c:261)
==5583==    by 0xC7FAA0F: phalcon_call_method_params (fcall.c:399)
==5583==    by 0xCA9ADC3: zim_Phalcon_Image_Adapter_Imagick__reflection (imagick.c:733)
==5583==    by 0xC81C5A7: phalcon_alt_call_method (fcall.c:827)
==5583==    by 0xC81CC6A: phalcon_alt_call_user_method (fcall.c:955)
==5583==    by 0xC7FA1F9: phalcon_call_method_vparams (fcall.c:261)
==5583==    by 0xC7FAA0F: phalcon_call_method_params (fcall.c:399)
==5583==    by 0xCA83ABA: zim_Phalcon_Image_Adapter_reflection (adapter.c:595)
==5583==    by 0xC7F456A: phalcon_execute_internal (phalcon.c:371)
==5583== 
==5583== Conditional jump or move depends on uninitialised value(s)
==5583==    at 0x7CF3792: ??? (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x7CF86F3: DrawGradientImage (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x7D75140: GradientImage (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x17892207: ??? (in /usr/lib/x86_64-linux-gnu/ImageMagick-6.7.7/modules-Q16/coders/gradient.so)
==5583==    by 0x7CBC3B1: ReadImage (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x79C397B: MagickReadImage (in /usr/lib/x86_64-linux-gnu/libMagickWand.so.5.0.0)
==5583==    by 0x76CAE36: php_imagick_read_image_using_imagemagick (imagick_file.c:124)
==5583==    by 0x76CB18E: php_imagick_read_file (imagick_file.c:240)
==5583==    by 0x76DC9C3: zim_imagick_newpseudoimage (imagick_class.c:3636)
==5583==    by 0xC81C5A7: phalcon_alt_call_method (fcall.c:827)
==5583==    by 0xC81CC6A: phalcon_alt_call_user_method (fcall.c:955)
==5583==    by 0xC7FA1F9: phalcon_call_method_vparams (fcall.c:261)
==5583==    by 0xC7FAA0F: phalcon_call_method_params (fcall.c:399)
==5583==    by 0xCA9ADC3: zim_Phalcon_Image_Adapter_Imagick__reflection (imagick.c:733)
==5583==    by 0xC81C5A7: phalcon_alt_call_method (fcall.c:827)
==5583==    by 0xC81CC6A: phalcon_alt_call_user_method (fcall.c:955)
==5583==    by 0xC7FA1F9: phalcon_call_method_vparams (fcall.c:261)
==5583==    by 0xC7FAA0F: phalcon_call_method_params (fcall.c:399)
==5583==    by 0xCA83ABA: zim_Phalcon_Image_Adapter_reflection (adapter.c:595)
==5583==    by 0xC7F456A: phalcon_execute_internal (phalcon.c:371)
==5583== 
==5583== Conditional jump or move depends on uninitialised value(s)
==5583==    at 0x7CF37B9: ??? (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x7CF86F3: DrawGradientImage (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x7D75140: GradientImage (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x17892207: ??? (in /usr/lib/x86_64-linux-gnu/ImageMagick-6.7.7/modules-Q16/coders/gradient.so)
==5583==    by 0x7CBC3B1: ReadImage (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x79C397B: MagickReadImage (in /usr/lib/x86_64-linux-gnu/libMagickWand.so.5.0.0)
==5583==    by 0x76CAE36: php_imagick_read_image_using_imagemagick (imagick_file.c:124)
==5583==    by 0x76CB18E: php_imagick_read_file (imagick_file.c:240)
==5583==    by 0x76DC9C3: zim_imagick_newpseudoimage (imagick_class.c:3636)
==5583==    by 0xC81C5A7: phalcon_alt_call_method (fcall.c:827)
==5583==    by 0xC81CC6A: phalcon_alt_call_user_method (fcall.c:955)
==5583==    by 0xC7FA1F9: phalcon_call_method_vparams (fcall.c:261)
==5583==    by 0xC7FAA0F: phalcon_call_method_params (fcall.c:399)
==5583==    by 0xCA9ADC3: zim_Phalcon_Image_Adapter_Imagick__reflection (imagick.c:733)
==5583==    by 0xC81C5A7: phalcon_alt_call_method (fcall.c:827)
==5583==    by 0xC81CC6A: phalcon_alt_call_user_method (fcall.c:955)
==5583==    by 0xC7FA1F9: phalcon_call_method_vparams (fcall.c:261)
==5583==    by 0xC7FAA0F: phalcon_call_method_params (fcall.c:399)
==5583==    by 0xCA83ABA: zim_Phalcon_Image_Adapter_reflection (adapter.c:595)
==5583==    by 0xC7F456A: phalcon_execute_internal (phalcon.c:371)
==5583== 
==5583== Conditional jump or move depends on uninitialised value(s)
==5583==    at 0x3BA9C4A0E0: vfprintf (vfprintf.c:1654)
==5583==    by 0x3BA9D0FBFF: __vsnprintf_chk (vsnprintf_chk.c:63)
==5583==    by 0x7D5B28A: FormatLocaleStringList (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x7D5B371: FormatLocaleString (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x17477B64: ??? (in /usr/lib/x86_64-linux-gnu/ImageMagick-6.7.7/modules-Q16/coders/png.so)
==5583==    by 0x1747947F: ??? (in /usr/lib/x86_64-linux-gnu/ImageMagick-6.7.7/modules-Q16/coders/png.so)
==5583==    by 0x7CBC3B1: ReadImage (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x79C397B: MagickReadImage (in /usr/lib/x86_64-linux-gnu/libMagickWand.so.5.0.0)
==5583==    by 0x76CAE36: php_imagick_read_image_using_imagemagick (imagick_file.c:124)
==5583==    by 0x76CB18E: php_imagick_read_file (imagick_file.c:240)
==5583==    by 0x76D83D2: zim_imagick_readimage (imagick_class.c:2792)
==5583==    by 0xC81C5A7: phalcon_alt_call_method (fcall.c:827)
==5583==    by 0xC81CC6A: phalcon_alt_call_user_method (fcall.c:955)
==5583==    by 0xC7FA1F9: phalcon_call_method_vparams (fcall.c:261)
==5583==    by 0xC7FAA0F: phalcon_call_method_params (fcall.c:399)
==5583==    by 0xCA95250: zim_Phalcon_Image_Adapter_Imagick___construct (imagick.c:151)
==5583==    by 0xC7F456A: phalcon_execute_internal (phalcon.c:371)
==5583==    by 0xA74F4E: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:552)
==5583==    by 0xA759B1: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:685)
==5583==    by 0xA7424D: execute_ex (zend_vm_execute.h:363)
==5583== 
==5583== Use of uninitialised value of size 8
==5583==    at 0x3BA9C4965B: _itoa_word (_itoa.c:179)
==5583==    by 0x3BA9C4DB91: vfprintf (vfprintf.c:1654)
==5583==    by 0x3BA9D0FBFF: __vsnprintf_chk (vsnprintf_chk.c:63)
==5583==    by 0x7D5B28A: FormatLocaleStringList (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x7D5B371: FormatLocaleString (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x17477B64: ??? (in /usr/lib/x86_64-linux-gnu/ImageMagick-6.7.7/modules-Q16/coders/png.so)
==5583==    by 0x1747947F: ??? (in /usr/lib/x86_64-linux-gnu/ImageMagick-6.7.7/modules-Q16/coders/png.so)
==5583==    by 0x7CBC3B1: ReadImage (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x79C397B: MagickReadImage (in /usr/lib/x86_64-linux-gnu/libMagickWand.so.5.0.0)
==5583==    by 0x76CAE36: php_imagick_read_image_using_imagemagick (imagick_file.c:124)
==5583==    by 0x76CB18E: php_imagick_read_file (imagick_file.c:240)
==5583==    by 0x76D83D2: zim_imagick_readimage (imagick_class.c:2792)
==5583==    by 0xC81C5A7: phalcon_alt_call_method (fcall.c:827)
==5583==    by 0xC81CC6A: phalcon_alt_call_user_method (fcall.c:955)
==5583==    by 0xC7FA1F9: phalcon_call_method_vparams (fcall.c:261)
==5583==    by 0xC7FAA0F: phalcon_call_method_params (fcall.c:399)
==5583==    by 0xCA95250: zim_Phalcon_Image_Adapter_Imagick___construct (imagick.c:151)
==5583==    by 0xC7F456A: phalcon_execute_internal (phalcon.c:371)
==5583==    by 0xA74F4E: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:552)
==5583==    by 0xA759B1: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:685)
==5583== 
==5583== Conditional jump or move depends on uninitialised value(s)
==5583==    at 0x3BA9C49665: _itoa_word (_itoa.c:179)
==5583==    by 0x3BA9C4DB91: vfprintf (vfprintf.c:1654)
==5583==    by 0x3BA9D0FBFF: __vsnprintf_chk (vsnprintf_chk.c:63)
==5583==    by 0x7D5B28A: FormatLocaleStringList (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x7D5B371: FormatLocaleString (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x17477B64: ??? (in /usr/lib/x86_64-linux-gnu/ImageMagick-6.7.7/modules-Q16/coders/png.so)
==5583==    by 0x1747947F: ??? (in /usr/lib/x86_64-linux-gnu/ImageMagick-6.7.7/modules-Q16/coders/png.so)
==5583==    by 0x7CBC3B1: ReadImage (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x79C397B: MagickReadImage (in /usr/lib/x86_64-linux-gnu/libMagickWand.so.5.0.0)
==5583==    by 0x76CAE36: php_imagick_read_image_using_imagemagick (imagick_file.c:124)
==5583==    by 0x76CB18E: php_imagick_read_file (imagick_file.c:240)
==5583==    by 0x76D83D2: zim_imagick_readimage (imagick_class.c:2792)
==5583==    by 0xC81C5A7: phalcon_alt_call_method (fcall.c:827)
==5583==    by 0xC81CC6A: phalcon_alt_call_user_method (fcall.c:955)
==5583==    by 0xC7FA1F9: phalcon_call_method_vparams (fcall.c:261)
==5583==    by 0xC7FAA0F: phalcon_call_method_params (fcall.c:399)
==5583==    by 0xCA95250: zim_Phalcon_Image_Adapter_Imagick___construct (imagick.c:151)
==5583==    by 0xC7F456A: phalcon_execute_internal (phalcon.c:371)
==5583==    by 0xA74F4E: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:552)
==5583==    by 0xA759B1: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:685)
==5583== 
==5583== Conditional jump or move depends on uninitialised value(s)
==5583==    at 0x3BA9C4DBE4: vfprintf (vfprintf.c:1654)
==5583==    by 0x3BA9D0FBFF: __vsnprintf_chk (vsnprintf_chk.c:63)
==5583==    by 0x7D5B28A: FormatLocaleStringList (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x7D5B371: FormatLocaleString (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x17477B64: ??? (in /usr/lib/x86_64-linux-gnu/ImageMagick-6.7.7/modules-Q16/coders/png.so)
==5583==    by 0x1747947F: ??? (in /usr/lib/x86_64-linux-gnu/ImageMagick-6.7.7/modules-Q16/coders/png.so)
==5583==    by 0x7CBC3B1: ReadImage (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x79C397B: MagickReadImage (in /usr/lib/x86_64-linux-gnu/libMagickWand.so.5.0.0)
==5583==    by 0x76CAE36: php_imagick_read_image_using_imagemagick (imagick_file.c:124)
==5583==    by 0x76CB18E: php_imagick_read_file (imagick_file.c:240)
==5583==    by 0x76D83D2: zim_imagick_readimage (imagick_class.c:2792)
==5583==    by 0xC81C5A7: phalcon_alt_call_method (fcall.c:827)
==5583==    by 0xC81CC6A: phalcon_alt_call_user_method (fcall.c:955)
==5583==    by 0xC7FA1F9: phalcon_call_method_vparams (fcall.c:261)
==5583==    by 0xC7FAA0F: phalcon_call_method_params (fcall.c:399)
==5583==    by 0xCA95250: zim_Phalcon_Image_Adapter_Imagick___construct (imagick.c:151)
==5583==    by 0xC7F456A: phalcon_execute_internal (phalcon.c:371)
==5583==    by 0xA74F4E: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:552)
==5583==    by 0xA759B1: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:685)
==5583==    by 0xA7424D: execute_ex (zend_vm_execute.h:363)
==5583== 
==5583== Conditional jump or move depends on uninitialised value(s)
==5583==    at 0x3BA9C4A1BE: vfprintf (vfprintf.c:1654)
==5583==    by 0x3BA9D0FBFF: __vsnprintf_chk (vsnprintf_chk.c:63)
==5583==    by 0x7D5B28A: FormatLocaleStringList (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x7D5B371: FormatLocaleString (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x17477B64: ??? (in /usr/lib/x86_64-linux-gnu/ImageMagick-6.7.7/modules-Q16/coders/png.so)
==5583==    by 0x1747947F: ??? (in /usr/lib/x86_64-linux-gnu/ImageMagick-6.7.7/modules-Q16/coders/png.so)
==5583==    by 0x7CBC3B1: ReadImage (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x79C397B: MagickReadImage (in /usr/lib/x86_64-linux-gnu/libMagickWand.so.5.0.0)
==5583==    by 0x76CAE36: php_imagick_read_image_using_imagemagick (imagick_file.c:124)
==5583==    by 0x76CB18E: php_imagick_read_file (imagick_file.c:240)
==5583==    by 0x76D83D2: zim_imagick_readimage (imagick_class.c:2792)
==5583==    by 0xC81C5A7: phalcon_alt_call_method (fcall.c:827)
==5583==    by 0xC81CC6A: phalcon_alt_call_user_method (fcall.c:955)
==5583==    by 0xC7FA1F9: phalcon_call_method_vparams (fcall.c:261)
==5583==    by 0xC7FAA0F: phalcon_call_method_params (fcall.c:399)
==5583==    by 0xCA95250: zim_Phalcon_Image_Adapter_Imagick___construct (imagick.c:151)
==5583==    by 0xC7F456A: phalcon_execute_internal (phalcon.c:371)
==5583==    by 0xA74F4E: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:552)
==5583==    by 0xA759B1: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:685)
==5583==    by 0xA7424D: execute_ex (zend_vm_execute.h:363)
==5583== 
==5583== Conditional jump or move depends on uninitialised value(s)
==5583==    at 0x3BA9C4A238: vfprintf (vfprintf.c:1654)
==5583==    by 0x3BA9D0FBFF: __vsnprintf_chk (vsnprintf_chk.c:63)
==5583==    by 0x7D5B28A: FormatLocaleStringList (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x7D5B371: FormatLocaleString (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x17477B64: ??? (in /usr/lib/x86_64-linux-gnu/ImageMagick-6.7.7/modules-Q16/coders/png.so)
==5583==    by 0x1747947F: ??? (in /usr/lib/x86_64-linux-gnu/ImageMagick-6.7.7/modules-Q16/coders/png.so)
==5583==    by 0x7CBC3B1: ReadImage (in /usr/lib/x86_64-linux-gnu/libMagickCore.so.5.0.0)
==5583==    by 0x79C397B: MagickReadImage (in /usr/lib/x86_64-linux-gnu/libMagickWand.so.5.0.0)
==5583==    by 0x76CAE36: php_imagick_read_image_using_imagemagick (imagick_file.c:124)
==5583==    by 0x76CB18E: php_imagick_read_file (imagick_file.c:240)
==5583==    by 0x76D83D2: zim_imagick_readimage (imagick_class.c:2792)
==5583==    by 0xC81C5A7: phalcon_alt_call_method (fcall.c:827)
==5583==    by 0xC81CC6A: phalcon_alt_call_user_method (fcall.c:955)
==5583==    by 0xC7FA1F9: phalcon_call_method_vparams (fcall.c:261)
==5583==    by 0xC7FAA0F: phalcon_call_method_params (fcall.c:399)
==5583==    by 0xCA95250: zim_Phalcon_Image_Adapter_Imagick___construct (imagick.c:151)
==5583==    by 0xC7F456A: phalcon_execute_internal (phalcon.c:371)
==5583==    by 0xA74F4E: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:552)
==5583==    by 0xA759B1: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:685)
==5583==    by 0xA7424D: execute_ex (zend_vm_execute.h:363)
==5583== 
==5583== Invalid read of size 4
==5583==    at 0xC818257: zval_refcount_p (zend.h:397)
==5583==    by 0xC818885: phalcon_memory_restore_stack_common (memory.c:161)
==5583==    by 0xC818B61: phalcon_memory_restore_stack (memory.c:217)
==5583==    by 0xCAA10BC: zim_Phalcon_Image_Adapter_Imagick__text (imagick.c:1252)
==5583==    by 0xC81C5A7: phalcon_alt_call_method (fcall.c:827)
==5583==    by 0xC81CC6A: phalcon_alt_call_user_method (fcall.c:955)
==5583==    by 0xC7FA1F9: phalcon_call_method_vparams (fcall.c:261)
==5583==    by 0xC7FAA0F: phalcon_call_method_params (fcall.c:399)
==5583==    by 0xCA8602F: zim_Phalcon_Image_Adapter_text (adapter.c:826)
==5583==    by 0xC7F456A: phalcon_execute_internal (phalcon.c:371)
==5583==    by 0xA74F4E: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:552)
==5583==    by 0xA759B1: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:685)
==5583==    by 0xA7424D: execute_ex (zend_vm_execute.h:363)
==5583==    by 0xA74332: zend_execute (zend_vm_execute.h:388)
==5583==    by 0xA2EC67: zend_execute_scripts (zend.c:1318)
==5583==    by 0x96F9EB: php_execute_script (main.c:2489)
==5583==    by 0xAEF368: do_cli (php_cli.c:994)
==5583==    by 0xAF099F: main (php_cli.c:1378)
==5583==  Address 0x131be600 is 16 bytes inside a block of size 32 free'd
==5583==    at 0x4A08A6C: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5583==    by 0x9E8A4C: _efree (zend_alloc.c:2437)
==5583==    by 0xA13ACD: i_zval_ptr_dtor (zend_execute.h:82)
==5583==    by 0xA15C92: _zval_ptr_dtor (zend_execute_API.c:426)
==5583==    by 0xC8188B4: phalcon_memory_restore_stack_common (memory.c:162)
==5583==    by 0xC818B61: phalcon_memory_restore_stack (memory.c:217)
==5583==    by 0xCAA10BC: zim_Phalcon_Image_Adapter_Imagick__text (imagick.c:1252)
==5583==    by 0xC81C5A7: phalcon_alt_call_method (fcall.c:827)
==5583==    by 0xC81CC6A: phalcon_alt_call_user_method (fcall.c:955)
==5583==    by 0xC7FA1F9: phalcon_call_method_vparams (fcall.c:261)
==5583==    by 0xC7FAA0F: phalcon_call_method_params (fcall.c:399)
==5583==    by 0xCA8602F: zim_Phalcon_Image_Adapter_text (adapter.c:826)
==5583==    by 0xC7F456A: phalcon_execute_internal (phalcon.c:371)
==5583==    by 0xA74F4E: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:552)
==5583==    by 0xA759B1: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:685)
==5583==    by 0xA7424D: execute_ex (zend_vm_execute.h:363)
==5583==    by 0xA74332: zend_execute (zend_vm_execute.h:388)
==5583==    by 0xA2EC67: zend_execute_scripts (zend.c:1318)
==5583==    by 0x96F9EB: php_execute_script (main.c:2489)
==5583==    by 0xAEF368: do_cli (php_cli.c:994)
==5583== 
==5583== Invalid read of size 4
==5583==    at 0xC81828A: zval_delref_p (zend.h:409)
==5583==    by 0xC8188D7: phalcon_memory_restore_stack_common (memory.c:164)
==5583==    by 0xC818B61: phalcon_memory_restore_stack (memory.c:217)
==5583==    by 0xCAA10BC: zim_Phalcon_Image_Adapter_Imagick__text (imagick.c:1252)
==5583==    by 0xC81C5A7: phalcon_alt_call_method (fcall.c:827)
==5583==    by 0xC81CC6A: phalcon_alt_call_user_method (fcall.c:955)
==5583==    by 0xC7FA1F9: phalcon_call_method_vparams (fcall.c:261)
==5583==    by 0xC7FAA0F: phalcon_call_method_params (fcall.c:399)
==5583==    by 0xCA8602F: zim_Phalcon_Image_Adapter_text (adapter.c:826)
==5583==    by 0xC7F456A: phalcon_execute_internal (phalcon.c:371)
==5583==    by 0xA74F4E: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:552)
==5583==    by 0xA759B1: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:685)
==5583==    by 0xA7424D: execute_ex (zend_vm_execute.h:363)
==5583==    by 0xA74332: zend_execute (zend_vm_execute.h:388)
==5583==    by 0xA2EC67: zend_execute_scripts (zend.c:1318)
==5583==    by 0x96F9EB: php_execute_script (main.c:2489)
==5583==    by 0xAEF368: do_cli (php_cli.c:994)
==5583==    by 0xAF099F: main (php_cli.c:1378)
==5583==  Address 0x131be600 is 16 bytes inside a block of size 32 free'd
==5583==    at 0x4A08A6C: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5583==    by 0x9E8A4C: _efree (zend_alloc.c:2437)
==5583==    by 0xA13ACD: i_zval_ptr_dtor (zend_execute.h:82)
==5583==    by 0xA15C92: _zval_ptr_dtor (zend_execute_API.c:426)
==5583==    by 0xC8188B4: phalcon_memory_restore_stack_common (memory.c:162)
==5583==    by 0xC818B61: phalcon_memory_restore_stack (memory.c:217)
==5583==    by 0xCAA10BC: zim_Phalcon_Image_Adapter_Imagick__text (imagick.c:1252)
==5583==    by 0xC81C5A7: phalcon_alt_call_method (fcall.c:827)
==5583==    by 0xC81CC6A: phalcon_alt_call_user_method (fcall.c:955)
==5583==    by 0xC7FA1F9: phalcon_call_method_vparams (fcall.c:261)
==5583==    by 0xC7FAA0F: phalcon_call_method_params (fcall.c:399)
==5583==    by 0xCA8602F: zim_Phalcon_Image_Adapter_text (adapter.c:826)
==5583==    by 0xC7F456A: phalcon_execute_internal (phalcon.c:371)
==5583==    by 0xA74F4E: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:552)
==5583==    by 0xA759B1: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:685)
==5583==    by 0xA7424D: execute_ex (zend_vm_execute.h:363)
==5583==    by 0xA74332: zend_execute (zend_vm_execute.h:388)
==5583==    by 0xA2EC67: zend_execute_scripts (zend.c:1318)
==5583==    by 0x96F9EB: php_execute_script (main.c:2489)
==5583==    by 0xAEF368: do_cli (php_cli.c:994)
==5583== 
==5583== Invalid write of size 4
==5583==    at 0xC818294: zval_delref_p (zend.h:409)
==5583==    by 0xC8188D7: phalcon_memory_restore_stack_common (memory.c:164)
==5583==    by 0xC818B61: phalcon_memory_restore_stack (memory.c:217)
==5583==    by 0xCAA10BC: zim_Phalcon_Image_Adapter_Imagick__text (imagick.c:1252)
==5583==    by 0xC81C5A7: phalcon_alt_call_method (fcall.c:827)
==5583==    by 0xC81CC6A: phalcon_alt_call_user_method (fcall.c:955)
==5583==    by 0xC7FA1F9: phalcon_call_method_vparams (fcall.c:261)
==5583==    by 0xC7FAA0F: phalcon_call_method_params (fcall.c:399)
==5583==    by 0xCA8602F: zim_Phalcon_Image_Adapter_text (adapter.c:826)
==5583==    by 0xC7F456A: phalcon_execute_internal (phalcon.c:371)
==5583==    by 0xA74F4E: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:552)
==5583==    by 0xA759B1: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:685)
==5583==    by 0xA7424D: execute_ex (zend_vm_execute.h:363)
==5583==    by 0xA74332: zend_execute (zend_vm_execute.h:388)
==5583==    by 0xA2EC67: zend_execute_scripts (zend.c:1318)
==5583==    by 0x96F9EB: php_execute_script (main.c:2489)
==5583==    by 0xAEF368: do_cli (php_cli.c:994)
==5583==    by 0xAF099F: main (php_cli.c:1378)
==5583==  Address 0x131be600 is 16 bytes inside a block of size 32 free'd
==5583==    at 0x4A08A6C: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5583==    by 0x9E8A4C: _efree (zend_alloc.c:2437)
==5583==    by 0xA13ACD: i_zval_ptr_dtor (zend_execute.h:82)
==5583==    by 0xA15C92: _zval_ptr_dtor (zend_execute_API.c:426)
==5583==    by 0xC8188B4: phalcon_memory_restore_stack_common (memory.c:162)
==5583==    by 0xC818B61: phalcon_memory_restore_stack (memory.c:217)
==5583==    by 0xCAA10BC: zim_Phalcon_Image_Adapter_Imagick__text (imagick.c:1252)
==5583==    by 0xC81C5A7: phalcon_alt_call_method (fcall.c:827)
==5583==    by 0xC81CC6A: phalcon_alt_call_user_method (fcall.c:955)
==5583==    by 0xC7FA1F9: phalcon_call_method_vparams (fcall.c:261)
==5583==    by 0xC7FAA0F: phalcon_call_method_params (fcall.c:399)
==5583==    by 0xCA8602F: zim_Phalcon_Image_Adapter_text (adapter.c:826)
==5583==    by 0xC7F456A: phalcon_execute_internal (phalcon.c:371)
==5583==    by 0xA74F4E: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:552)
==5583==    by 0xA759B1: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:685)
==5583==    by 0xA7424D: execute_ex (zend_vm_execute.h:363)
==5583==    by 0xA74332: zend_execute (zend_vm_execute.h:388)
==5583==    by 0xA2EC67: zend_execute_scripts (zend.c:1318)
==5583==    by 0x96F9EB: php_execute_script (main.c:2489)
==5583==    by 0xAEF368: do_cli (php_cli.c:994)
==5583== 
==5583== Invalid read of size 4
==5583==    at 0xC81829B: zval_delref_p (zend.h:409)
==5583==    by 0xC8188D7: phalcon_memory_restore_stack_common (memory.c:164)
==5583==    by 0xC818B61: phalcon_memory_restore_stack (memory.c:217)
==5583==    by 0xCAA10BC: zim_Phalcon_Image_Adapter_Imagick__text (imagick.c:1252)
==5583==    by 0xC81C5A7: phalcon_alt_call_method (fcall.c:827)
==5583==    by 0xC81CC6A: phalcon_alt_call_user_method (fcall.c:955)
==5583==    by 0xC7FA1F9: phalcon_call_method_vparams (fcall.c:261)
==5583==    by 0xC7FAA0F: phalcon_call_method_params (fcall.c:399)
==5583==    by 0xCA8602F: zim_Phalcon_Image_Adapter_text (adapter.c:826)
==5583==    by 0xC7F456A: phalcon_execute_internal (phalcon.c:371)
==5583==    by 0xA74F4E: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:552)
==5583==    by 0xA759B1: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:685)
==5583==    by 0xA7424D: execute_ex (zend_vm_execute.h:363)
==5583==    by 0xA74332: zend_execute (zend_vm_execute.h:388)
==5583==    by 0xA2EC67: zend_execute_scripts (zend.c:1318)
==5583==    by 0x96F9EB: php_execute_script (main.c:2489)
==5583==    by 0xAEF368: do_cli (php_cli.c:994)
==5583==    by 0xAF099F: main (php_cli.c:1378)
==5583==  Address 0x131be600 is 16 bytes inside a block of size 32 free'd
==5583==    at 0x4A08A6C: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5583==    by 0x9E8A4C: _efree (zend_alloc.c:2437)
==5583==    by 0xA13ACD: i_zval_ptr_dtor (zend_execute.h:82)
==5583==    by 0xA15C92: _zval_ptr_dtor (zend_execute_API.c:426)
==5583==    by 0xC8188B4: phalcon_memory_restore_stack_common (memory.c:162)
==5583==    by 0xC818B61: phalcon_memory_restore_stack (memory.c:217)
==5583==    by 0xCAA10BC: zim_Phalcon_Image_Adapter_Imagick__text (imagick.c:1252)
==5583==    by 0xC81C5A7: phalcon_alt_call_method (fcall.c:827)
==5583==    by 0xC81CC6A: phalcon_alt_call_user_method (fcall.c:955)
==5583==    by 0xC7FA1F9: phalcon_call_method_vparams (fcall.c:261)
==5583==    by 0xC7FAA0F: phalcon_call_method_params (fcall.c:399)
==5583==    by 0xCA8602F: zim_Phalcon_Image_Adapter_text (adapter.c:826)
==5583==    by 0xC7F456A: phalcon_execute_internal (phalcon.c:371)
==5583==    by 0xA74F4E: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:552)
==5583==    by 0xA759B1: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:685)
==5583==    by 0xA7424D: execute_ex (zend_vm_execute.h:363)
==5583==    by 0xA74332: zend_execute (zend_vm_execute.h:388)
==5583==    by 0xA2EC67: zend_execute_scripts (zend.c:1318)
==5583==    by 0x96F9EB: php_execute_script (main.c:2489)
==5583==    by 0xAEF368: do_cli (php_cli.c:994)
==5583== 
ERROR SUMMARY: 41971 errors from 16 contexts (suppressed: 2 from 2)
@ghost
Copy link
Author

ghost commented Oct 13, 2013

The issue with imagick is that it does not behave nicely under valgrind:

$im = new Imagick;
$im->readImage('image.jpg');

$image_width = $im->getImageWidth();
$image_height = $im->getImageHeight();
$height = 50;

$reflection = clone $im;
$reflection->flipImage();

$reflection->cropImage($image_width, $height, 0, 0);
$reflection->setImagePage($image_width, $height, 0, 0);

$direction = array('transparent', 'black');

$fade = new Imagick;
$fade->newPseudoImage($reflection->getImageWidth(), $reflection->getImageHeight(), vsprintf('gradient:%s-%s', $direction));

could result in segfault + 268687 errors from 7 contexts

@ghost
Copy link
Author

ghost commented Oct 13, 2013

Resolved by introducing \Phalcon\Image\Adapter\Imagick::setResourceLimit().

It should be used to limit the number of threads used by ImageMagick.

This does not fix magically all errors in IM but at least does not result in segfaults.

@ghost
Copy link
Author

ghost commented Oct 17, 2013

Fixed in #1375

@ghost ghost closed this as completed Oct 17, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants