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

Invalid reads/writes in Phalcon\Image\Adapter\GD #1246

Closed
ghost opened this issue Sep 18, 2013 · 5 comments
Closed

Invalid reads/writes in Phalcon\Image\Adapter\GD #1246

ghost opened this issue Sep 18, 2013 · 5 comments

Comments

@ghost
Copy link

ghost commented Sep 18, 2013

See https://travis-ci.org/sjinks/cphalcon/jobs/11490422#L290

==13885== Conditional jump or move depends on uninitialised value(s)
==13885== at 0x513B4E0: inflateReset2 (in /lib/x86_64-linux-gnu/libz.so.1.2.3.4)
==13885== by 0x513B5D8: inflateInit2_ (in /lib/x86_64-linux-gnu/libz.so.1.2.3.4)
==13885== by 0x67960D3: png_create_read_struct_2 (in /lib/x86_64-linux-gnu/libpng12.so.0.46.0)
==13885== by 0x6796296: png_create_read_struct (in /lib/x86_64-linux-gnu/libpng12.so.0.46.0)
==13885== by 0x570B39: php_gd_gdImageCreateFromPngCtx (/tmp/php-build/source/5.3.26/ext/gd/libgd/gd_png.c:153)
==13885== by 0x57153D: php_gd_gdImageCreateFromPng (/tmp/php-build/source/5.3.26/ext/gd/libgd/gd_png.c:97)
==13885== by 0x5666E3: _php_image_create_from.isra.13 (/tmp/php-build/source/5.3.26/ext/gd/gd.c:2513)
==13885== by 0x5668E4: zif_imagecreatefrompng (/tmp/php-build/source/5.3.26/ext/gd/gd.c:2559)
==13885== by 0x8226D5: zend_call_function (/tmp/php-build/source/5.3.26/Zend/zend_execute_API.c:991)
==13885== by 0xEFFD6EE: phalcon_call_user_function (/home/travis/build/sjinks/cphalcon/ext/kernel/fcall.c:115)
==13885== by 0xEFFE16B: phalcon_call_func_params (/home/travis/build/sjinks/cphalcon/ext/kernel/fcall.c:198)
==13885== by 0xF197984: zim_Phalcon_Image_Adapter_GD___construct (/home/travis/build/sjinks/cphalcon/ext/image/adapter/gd.c:215)
==13885== Uninitialised value was created by a heap allocation
==13885== at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13885== by 0x67A14CC: png_malloc (in /lib/x86_64-linux-gnu/libpng12.so.0.46.0)
==13885== by 0x6789B95: ??? (in /lib/x86_64-linux-gnu/libpng12.so.0.46.0)
==13885== by 0x513B5B6: inflateInit2_ (in /lib/x86_64-linux-gnu/libz.so.1.2.3.4)
==13885== by 0x67960D3: png_create_read_struct_2 (in /lib/x86_64-linux-gnu/libpng12.so.0.46.0)
==13885== by 0x6796296: png_create_read_struct (in /lib/x86_64-linux-gnu/libpng12.so.0.46.0)
==13885== by 0x570B39: php_gd_gdImageCreateFromPngCtx (/tmp/php-build/source/5.3.26/ext/gd/libgd/gd_png.c:153)
==13885== by 0x57153D: php_gd_gdImageCreateFromPng (/tmp/php-build/source/5.3.26/ext/gd/libgd/gd_png.c:97)
==13885== by 0x5666E3: _php_image_create_from.isra.13 (/tmp/php-build/source/5.3.26/ext/gd/gd.c:2513)
==13885== by 0x5668E4: zif_imagecreatefrompng (/tmp/php-build/source/5.3.26/ext/gd/gd.c:2559)
==13885== by 0x8226D5: zend_call_function (/tmp/php-build/source/5.3.26/Zend/zend_execute_API.c:991)
==13885== by 0xEFFD6EE: phalcon_call_user_function (/home/travis/build/sjinks/cphalcon/ext/kernel/fcall.c:115)

==13885== Invalid read of size 4
==13885== at 0xF0120CA: phalcon_memory_restore_stack_common (/home/travis/.phpenv/versions/5.3.26/include/php/Zend/zend.h:373)
==13885== by 0xF0122C5: phalcon_memory_restore_stack (/home/travis/build/sjinks/cphalcon/ext/kernel/memory.c:217)
==13885== by 0xF19E543: zim_Phalcon_Image_Adapter_GD__mask (/home/travis/build/sjinks/cphalcon/ext/image/adapter/gd.c:1216)
==13885== by 0xF013DA1: phalcon_alt_call_method (/home/travis/build/sjinks/cphalcon/ext/kernel/alternative/fcall.c:479)
==13885== by 0xF0143A1: phalcon_alt_call_user_method (/home/travis/build/sjinks/cphalcon/ext/kernel/alternative/fcall.c:955)
==13885== by 0xEFFDE67: phalcon_call_method_vparams (/home/travis/build/sjinks/cphalcon/ext/kernel/fcall.c:264)
==13885== by 0xEFFE281: phalcon_call_method_params (/home/travis/build/sjinks/cphalcon/ext/kernel/fcall.c:403)
==13885== by 0xF194A99: zim_Phalcon_Image_Adapter_mask (/home/travis/build/sjinks/cphalcon/ext/image/adapter.c:844)
==13885== by 0xEFFA6A7: phalcon_execute_internal (/home/travis/build/sjinks/cphalcon/ext/phalcon.c:385)
==13885== by 0x8B7B06: zend_do_fcall_common_helper_SPEC (/tmp/php-build/source/5.3.26/Zend/zend_vm_execute.h:324)
==13885== by 0x85731D: execute (/tmp/php-build/source/5.3.26/Zend/zend_vm_execute.h:107)
==13885== by 0x8225B9: zend_call_function (/tmp/php-build/source/5.3.26/Zend/zend_execute_API.c:969)

==13885== Address 0x15d475b0 is 16 bytes inside a block of size 32 free'd
==13885== at 0x4C2A82E: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13885== by 0xF0120D6: phalcon_memory_restore_stack_common (/home/travis/build/sjinks/cphalcon/ext/kernel/memory.c:162)
==13885== by 0xF0122C5: phalcon_memory_restore_stack (/home/travis/build/sjinks/cphalcon/ext/kernel/memory.c:217)
==13885== by 0xF19E543: zim_Phalcon_Image_Adapter_GD__mask (/home/travis/build/sjinks/cphalcon/ext/image/adapter/gd.c:1216)
==13885== by 0xF013DA1: phalcon_alt_call_method (/home/travis/build/sjinks/cphalcon/ext/kernel/alternative/fcall.c:479)
==13885== by 0xF0143A1: phalcon_alt_call_user_method (/home/travis/build/sjinks/cphalcon/ext/kernel/alternative/fcall.c:955)
==13885== by 0xEFFDE67: phalcon_call_method_vparams (/home/travis/build/sjinks/cphalcon/ext/kernel/fcall.c:264)
==13885== by 0xEFFE281: phalcon_call_method_params (/home/travis/build/sjinks/cphalcon/ext/kernel/fcall.c:403)
==13885== by 0xF194A99: zim_Phalcon_Image_Adapter_mask (/home/travis/build/sjinks/cphalcon/ext/image/adapter.c:844)
==13885== by 0xEFFA6A7: phalcon_execute_internal (/home/travis/build/sjinks/cphalcon/ext/phalcon.c:385)
==13885== by 0x8B7B06: zend_do_fcall_common_helper_SPEC (/tmp/php-build/source/5.3.26/Zend/zend_vm_execute.h:324)
==13885== by 0x85731D: execute (/tmp/php-build/source/5.3.26/Zend/zend_vm_execute.h:107)

==13885== Invalid write of size 4
==13885== at 0xF0120DC: phalcon_memory_restore_stack_common (/home/travis/.phpenv/versions/5.3.26/include/php/Zend/zend.h:385)
==13885== by 0xF0122C5: phalcon_memory_restore_stack (/home/travis/build/sjinks/cphalcon/ext/kernel/memory.c:217)
==13885== by 0xF19E543: zim_Phalcon_Image_Adapter_GD__mask (/home/travis/build/sjinks/cphalcon/ext/image/adapter/gd.c:1216)
==13885== by 0xF013DA1: phalcon_alt_call_method (/home/travis/build/sjinks/cphalcon/ext/kernel/alternative/fcall.c:479)
==13885== by 0xF0143A1: phalcon_alt_call_user_method (/home/travis/build/sjinks/cphalcon/ext/kernel/alternative/fcall.c:955)
==13885== by 0xEFFDE67: phalcon_call_method_vparams (/home/travis/build/sjinks/cphalcon/ext/kernel/fcall.c:264)
==13885== by 0xEFFE281: phalcon_call_method_params (/home/travis/build/sjinks/cphalcon/ext/kernel/fcall.c:403)
==13885== by 0xF194A99: zim_Phalcon_Image_Adapter_mask (/home/travis/build/sjinks/cphalcon/ext/image/adapter.c:844)
==13885== by 0xEFFA6A7: phalcon_execute_internal (/home/travis/build/sjinks/cphalcon/ext/phalcon.c:385)
==13885== by 0x8B7B06: zend_do_fcall_common_helper_SPEC (/tmp/php-build/source/5.3.26/Zend/zend_vm_execute.h:324)
==13885== by 0x85731D: execute (/tmp/php-build/source/5.3.26/Zend/zend_vm_execute.h:107)
==13885== by 0x8225B9: zend_call_function (/tmp/php-build/source/5.3.26/Zend/zend_execute_API.c:969)

==13885== Address 0x15d475b0 is 16 bytes inside a block of size 32 free'd
==13885== at 0x4C2A82E: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13885== by 0xF0120D6: phalcon_memory_restore_stack_common (/home/travis/build/sjinks/cphalcon/ext/kernel/memory.c:162)
==13885== by 0xF0122C5: phalcon_memory_restore_stack (/home/travis/build/sjinks/cphalcon/ext/kernel/memory.c:217)
==13885== by 0xF19E543: zim_Phalcon_Image_Adapter_GD__mask (/home/travis/build/sjinks/cphalcon/ext/image/adapter/gd.c:1216)
==13885== by 0xF013DA1: phalcon_alt_call_method (/home/travis/build/sjinks/cphalcon/ext/kernel/alternative/fcall.c:479)
==13885== by 0xF0143A1: phalcon_alt_call_user_method (/home/travis/build/sjinks/cphalcon/ext/kernel/alternative/fcall.c:955)
==13885== by 0xEFFDE67: phalcon_call_method_vparams (/home/travis/build/sjinks/cphalcon/ext/kernel/fcall.c:264)
==13885== by 0xEFFE281: phalcon_call_method_params (/home/travis/build/sjinks/cphalcon/ext/kernel/fcall.c:403)
==13885== by 0xF194A99: zim_Phalcon_Image_Adapter_mask (/home/travis/build/sjinks/cphalcon/ext/image/adapter.c:844)
==13885== by 0xEFFA6A7: phalcon_execute_internal (/home/travis/build/sjinks/cphalcon/ext/phalcon.c:385)
==13885== by 0x8B7B06: zend_do_fcall_common_helper_SPEC (/tmp/php-build/source/5.3.26/Zend/zend_vm_execute.h:324)
==13885== by 0x85731D: execute (/tmp/php-build/source/5.3.26/Zend/zend_vm_execute.h:107)

==13885== Invalid read of size 4
==13885== at 0xF0120CA: phalcon_memory_restore_stack_common (/home/travis/.phpenv/versions/5.3.26/include/php/Zend/zend.h:373)
==13885== by 0xF0122C5: phalcon_memory_restore_stack (/home/travis/build/sjinks/cphalcon/ext/kernel/memory.c:217)
==13885== by 0xF19A676: zim_Phalcon_Image_Adapter_GD__text (/home/travis/build/sjinks/cphalcon/ext/image/adapter/gd.c:1091)
==13885== by 0xF013DA1: phalcon_alt_call_method (/home/travis/build/sjinks/cphalcon/ext/kernel/alternative/fcall.c:479)
==13885== by 0xF0143A1: phalcon_alt_call_user_method (/home/travis/build/sjinks/cphalcon/ext/kernel/alternative/fcall.c:955)
==13885== by 0xEFFDE67: phalcon_call_method_vparams (/home/travis/build/sjinks/cphalcon/ext/kernel/fcall.c:264)
==13885== by 0xEFFE281: phalcon_call_method_params (/home/travis/build/sjinks/cphalcon/ext/kernel/fcall.c:403)
==13885== by 0xF1961F9: zim_Phalcon_Image_Adapter_text (/home/travis/build/sjinks/cphalcon/ext/image/adapter.c:826)
==13885== by 0xEFFA6A7: phalcon_execute_internal (/home/travis/build/sjinks/cphalcon/ext/phalcon.c:385)
==13885== by 0x8B7B06: zend_do_fcall_common_helper_SPEC (/tmp/php-build/source/5.3.26/Zend/zend_vm_execute.h:324)
==13885== by 0x85731D: execute (/tmp/php-build/source/5.3.26/Zend/zend_vm_execute.h:107)
==13885== by 0x8225B9: zend_call_function (/tmp/php-build/source/5.3.26/Zend/zend_execute_API.c:969)

==13885== Address 0x125ed1d0 is 16 bytes inside a block of size 32 free'd
==13885== at 0x4C2A82E: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13885== by 0xF0120D6: phalcon_memory_restore_stack_common (/home/travis/build/sjinks/cphalcon/ext/kernel/memory.c:162)
==13885== by 0xF0122C5: phalcon_memory_restore_stack (/home/travis/build/sjinks/cphalcon/ext/kernel/memory.c:217)
==13885== by 0xF19A676: zim_Phalcon_Image_Adapter_GD__text (/home/travis/build/sjinks/cphalcon/ext/image/adapter/gd.c:1091)
==13885== by 0xF013DA1: phalcon_alt_call_method (/home/travis/build/sjinks/cphalcon/ext/kernel/alternative/fcall.c:479)
==13885== by 0xF0143A1: phalcon_alt_call_user_method (/home/travis/build/sjinks/cphalcon/ext/kernel/alternative/fcall.c:955)
==13885== by 0xEFFDE67: phalcon_call_method_vparams (/home/travis/build/sjinks/cphalcon/ext/kernel/fcall.c:264)
==13885== by 0xEFFE281: phalcon_call_method_params (/home/travis/build/sjinks/cphalcon/ext/kernel/fcall.c:403)
==13885== by 0xF1961F9: zim_Phalcon_Image_Adapter_text (/home/travis/build/sjinks/cphalcon/ext/image/adapter.c:826)
==13885== by 0xEFFA6A7: phalcon_execute_internal (/home/travis/build/sjinks/cphalcon/ext/phalcon.c:385)
==13885== by 0x8B7B06: zend_do_fcall_common_helper_SPEC (/tmp/php-build/source/5.3.26/Zend/zend_vm_execute.h:324)
==13885== by 0x85731D: execute (/tmp/php-build/source/5.3.26/Zend/zend_vm_execute.h:107)

==13885== Invalid write of size 4
==13885== at 0xF0120DC: phalcon_memory_restore_stack_common (/home/travis/.phpenv/versions/5.3.26/include/php/Zend/zend.h:385)
==13885== by 0xF0122C5: phalcon_memory_restore_stack (/home/travis/build/sjinks/cphalcon/ext/kernel/memory.c:217)
==13885== by 0xF19A676: zim_Phalcon_Image_Adapter_GD__text (/home/travis/build/sjinks/cphalcon/ext/image/adapter/gd.c:1091)
==13885== by 0xF013DA1: phalcon_alt_call_method (/home/travis/build/sjinks/cphalcon/ext/kernel/alternative/fcall.c:479)
==13885== by 0xF0143A1: phalcon_alt_call_user_method (/home/travis/build/sjinks/cphalcon/ext/kernel/alternative/fcall.c:955)
==13885== by 0xEFFDE67: phalcon_call_method_vparams (/home/travis/build/sjinks/cphalcon/ext/kernel/fcall.c:264)
==13885== by 0xEFFE281: phalcon_call_method_params (/home/travis/build/sjinks/cphalcon/ext/kernel/fcall.c:403)
==13885== by 0xF1961F9: zim_Phalcon_Image_Adapter_text (/home/travis/build/sjinks/cphalcon/ext/image/adapter.c:826)
==13885== by 0xEFFA6A7: phalcon_execute_internal (/home/travis/build/sjinks/cphalcon/ext/phalcon.c:385)
==13885== by 0x8B7B06: zend_do_fcall_common_helper_SPEC (/tmp/php-build/source/5.3.26/Zend/zend_vm_execute.h:324)
==13885== by 0x85731D: execute (/tmp/php-build/source/5.3.26/Zend/zend_vm_execute.h:107)
==13885== by 0x8225B9: zend_call_function (/tmp/php-build/source/5.3.26/Zend/zend_execute_API.c:969)

==13885== Address 0x125ed1d0 is 16 bytes inside a block of size 32 free'd
==13885== at 0x4C2A82E: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13885== by 0xF0120D6: phalcon_memory_restore_stack_common (/home/travis/build/sjinks/cphalcon/ext/kernel/memory.c:162)
==13885== by 0xF0122C5: phalcon_memory_restore_stack (/home/travis/build/sjinks/cphalcon/ext/kernel/memory.c:217)
==13885== by 0xF19A676: zim_Phalcon_Image_Adapter_GD__text (/home/travis/build/sjinks/cphalcon/ext/image/adapter/gd.c:1091)
==13885== by 0xF013DA1: phalcon_alt_call_method (/home/travis/build/sjinks/cphalcon/ext/kernel/alternative/fcall.c:479)
==13885== by 0xF0143A1: phalcon_alt_call_user_method (/home/travis/build/sjinks/cphalcon/ext/kernel/alternative/fcall.c:955)
==13885== by 0xEFFDE67: phalcon_call_method_vparams (/home/travis/build/sjinks/cphalcon/ext/kernel/fcall.c:264)
==13885== by 0xEFFE281: phalcon_call_method_params (/home/travis/build/sjinks/cphalcon/ext/kernel/fcall.c:403)
==13885== by 0xF1961F9: zim_Phalcon_Image_Adapter_text (/home/travis/build/sjinks/cphalcon/ext/image/adapter.c:826)
==13885== by 0xEFFA6A7: phalcon_execute_internal (/home/travis/build/sjinks/cphalcon/ext/phalcon.c:385)
==13885== by 0x8B7B06: zend_do_fcall_common_helper_SPEC (/tmp/php-build/source/5.3.26/Zend/zend_vm_execute.h:324)
==13885== by 0x85731D: execute (/tmp/php-build/source/5.3.26/Zend/zend_vm_execute.h:107)
@ghost
Copy link
Author

ghost commented Sep 18, 2013

@dreamsxin could you please take a look?

@dreamsxin
Copy link
Contributor

Receive, @sjinks Have not seen before, suspected imagecreatefrompng problems, there are no variables are initialized.

@ghost
Copy link
Author

ghost commented Sep 19, 2013

@dreamsxin
Copy link
Contributor

@sjinks How do you set up to appear this error?

@ghost
Copy link
Author

ghost commented Sep 20, 2013

Check out valgrind branch from my repo — it runs all Travis tests but under valgrind

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

1 participant