From: Operating system: Centos PHP version: 5.2.17 Package: Streams related Bug Type: Bug Bug description:apache randomly segmentation fault when using fopen or file_get_contents
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 bug report at http://bugs.php.net/bug.php?id=54381&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54381&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54381&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54381&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=54381&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54381&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=54381&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=54381&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=54381&r=needscript Try newer version: http://bugs.php.net/fix.php?id=54381&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=54381&r=support Expected behavior: http://bugs.php.net/fix.php?id=54381&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=54381&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=54381&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=54381&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54381&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=54381&r=dst IIS Stability: http://bugs.php.net/fix.php?id=54381&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=54381&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=54381&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=54381&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=54381&r=mysqlcfg