Edit report at http://bugs.php.net/bug.php?id=54381&edit=1
ID: 54381 Updated by: fel...@php.net Reported by: ekapek at gmail dot com Summary: apache randomly segmentation fault when using fopen or file_get_contents -Status: Open +Status: Feedback Type: Bug Package: Streams related Operating System: Centos PHP Version: 5.2.17 Block user comment: N Private report: N New Comment: Please try using this snapshot: http://snaps.php.net/php5.3-latest.tar.gz For Windows: http://windows.php.net/snapshots/ Previous Comments: ------------------------------------------------------------------------ [2011-03-25 13:50:10] ekapek at gmail dot com Another crash: #0 _zend_mm_free_int (heap=0x55389e0, p=0x5a57680) at /usr/local/directadmin/custombuild/php-5.2.17/Zend/zend_alloc.c:1978 #1 0x00002b57cd66454d in php_stream_tidy_wrapper_error_log (wrapper=0x2b57cdc492a0) at /usr/local/directadmin/custombuild/php-5.2.17/main/streams/streams.c:192 #2 0x00002b57cd665f55 in _php_stream_open_wrapper_ex (path=0x5a573b8 "http://google.com", mode=0x2b57cd7806ff "rb", options=4, opened_path=0x0, context=<value optimized out>) at /usr/local/directadmin/custombuild/php-5.2.17/main/streams/streams.c:1899 #3 0x00002b57cd5eba3c in zif_file_get_contents (ht=-842684800, return_value=0x5a57440, return_value_ptr=<value optimized out>, this_ptr=<value optimized out>, return_value_used=<value optimized out>) at /usr/local/directadmin/custombuild/php-5.2.17/ext/standard/file.c:541 #4 0x00002b57cd6b47d2 in zend_do_fcall_common_helper_SPEC (execute_data=0x7fff8cc6c880) at /usr/local/directadmin/custombuild/php-5.2.17/Zend/zend_vm_execute.h:200 #5 0x00002b57cd6b398c in execute (op_array=0x5a368a0) at /usr/local/directadmin/custombuild/php-5.2.17/Zend/zend_vm_execute.h:92 #6 0x00002b57d0125311 in zend_oe () from /usr/local/lib/ZendOptimizer_5.2.so #7 0x00002b57cd693edd in zend_execute_scripts (type=8, retval=<value optimized out>, file_count=3) at /usr/local/directadmin/custombuild/php-5.2.17/Zend/zend.c:1134 #8 0x00002b57cd65120d in php_execute_script (primary_file=0x7fff8cc6ed70) at /usr/local/directadmin/custombuild/php-5.2.17/main/main.c:2036 #9 0x00002b57cd718185 in php_handler (r=0x58d3010) at /usr/local/directadmin/custombuild/php-5.2.17/sapi/apache2handler/sapi_apache2.c:639 #10 0x000000000043fc5a in ap_run_handler (r=0x58d3010) at config.c:157 #11 0x0000000000442ea2 in ap_invoke_handler (r=0x58d3010) at config.c:376 #12 0x0000000000486988 in ap_process_request (r=0x58d3010) at http_request.c:282 #13 0x0000000000483c8c in ap_process_http_connection (c=0x58b2b80) at http_core.c:190 #14 0x0000000000446b82 in ap_run_process_connection (c=0x58b2b80) at connection.c:43 #15 0x00000000004b2610 in child_main (child_num_arg=<value optimized out>) at prefork.c:662 #16 0x00000000004b28a5 in make_child (s=0x5111500, slot=2) at prefork.c:763 #17 0x00000000004b30c2 in ap_mpm_run (_pconf=<value optimized out>, plog=<value optimized out>, s=<value optimized out>) at prefork.c:898 #18 0x000000000042d858 in main (argc=4, argv=0x7fff8cc6f318) at main.c:739 ------------------------------------------------------------------------ [2011-03-25 13:36:38] ekapek at gmail dot com Description: ------------ Problem exists when I use file_get_contents or fopen It causes httpd seg fault randomly Test script: --------------- <?php $a = file_get_contents('http://myproxy.com/get.php?url=http://www.google.pl'); ?> another: <?php if(@fopen('http://www.vorbis.com/files/1.0.1/windows/vorbis-tools-1.0.1-win32.zip','r')) { echo 'File exists'; } ?> Actual result: -------------- #0 0x000000346d07c515 in memcpy () from /lib64/libc.so.6 #1 0x00002b57cd67a531 in _zend_mm_realloc_int (heap=0x55389e0, p=0x6417690, size=<value optimized out>) at /usr/local/directadmin/custombuild/php-5.2.17/Zend/zend_alloc.c:2067 #2 0x00002b57cd66515c in php_stream_wrapper_log_error (wrapper=0x2b57cdc492a0, options=0, fmt=<value optimized out>) at /usr/local/directadmin/custombuild/php-5.2.17/main/streams/streams.c:216 #3 0x00002b57cd629924 in php_stream_url_wrap_http_ex (wrapper=0x2b57cdc492a0, path=0x64173b8 "http://myproxy.com/get.php?url=http://www.google.pl", mode=0x2b57cd7806ff "rb", options=4, opened_path=0x0, context=0x6417468, redirect_max=20, flags=1) at /usr/local/directadmin/custombuild/php-5.2.17/ext/standard/http_fopen_wrapper.c:189 #4 0x00002b57cd62c198 in php_stream_url_wrap_http (wrapper=0x6636f90, path=0x65f2628 "", mode=0xfffffffffffbbff0 <Address 0xfffffffffffbbff0 out of bounds>, options=-17396, opened_path=0x800000000, context=0x63f6a60) at /usr/local/directadmin/custombuild/php-5.2.17/ext/standard/http_fopen_wrapper.c:782 #5 0x00002b57cd665e4b in _php_stream_open_wrapper_ex (path=0x64173b8 "http://myproxy.com/get.php?url=http://www.google.pl", mode=0x2b57cd7806ff "rb", options=4, opened_path=0x0, context=0x6417468) at /usr/local/directadmin/custombuild/php-5.2.17/main/streams/streams.c:1827 #6 0x00002b57cd5eba3c in zif_file_get_contents (ht=-842684800, return_value=0x6417440, return_value_ptr=<value optimized out>, this_ptr=<value optimized out>, return_value_used=<value optimized out>) at /usr/local/directadmin/custombuild/php-5.2.17/ext/standard/file.c:541 #7 0x00002b57cd6b47d2 in zend_do_fcall_common_helper_SPEC (execute_data=0x7fff8cc6c880) at /usr/local/directadmin/custombuild/php-5.2.17/Zend/zend_vm_execute.h:200 #8 0x00002b57cd6b398c in execute (op_array=0x63f68a0) at /usr/local/directadmin/custombuild/php-5.2.17/Zend/zend_vm_execute.h:92 #9 0x00002b57d0125311 in zend_oe () from /usr/local/lib/ZendOptimizer_5.2.so #10 0x00002b57cd693edd in zend_execute_scripts (type=8, retval=<value optimized out>, file_count=3) at /usr/local/directadmin/custombuild/php-5.2.17/Zend/zend.c:1134 #11 0x00002b57cd65120d in php_execute_script (primary_file=0x7fff8cc6ed70) at /usr/local/directadmin/custombuild/php-5.2.17/main/main.c:2036 #12 0x00002b57cd718185 in php_handler (r=0x5a20030) at /usr/local/directadmin/custombuild/php-5.2.17/sapi/apache2handler/sapi_apache2.c:639 #13 0x000000000043fc5a in ap_run_handler (r=0x5a20030) at config.c:157 #14 0x0000000000442ea2 in ap_invoke_handler (r=0x5a20030) at config.c:376 #15 0x0000000000486988 in ap_process_request (r=0x5a20030) at http_request.c:282 #16 0x0000000000483c8c in ap_process_http_connection (c=0x58b2b80) at http_core.c:190 #17 0x0000000000446b82 in ap_run_process_connection (c=0x58b2b80) at connection.c:43 #18 0x00000000004b2610 in child_main (child_num_arg=<value optimized out>) at prefork.c:662 #19 0x00000000004b28a5 in make_child (s=0x5111500, slot=6) at prefork.c:763 #20 0x00000000004b30c2 in ap_mpm_run (_pconf=<value optimized out>, plog=<value optimized out>, s=<value optimized out>) at prefork.c:898 #21 0x000000000042d858 in main (argc=4, argv=0x7fff8cc6f318) at main.c:739 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=54381&edit=1