|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-08-25 02:51 UTC] mkwan at darkside dot com dot au
Description: ------------ Calling the file_get_contents() function with the ftp:// wrapper causes a segmentation fault when an FTP proxy is enabled with the stream_context_get_default function. The machine is running Fedora 7 with an Apache server which has proxying enabled. Just for comparison, the following command DOES work - export ftp_proxy=localhost:8080 wget ftp://ftp2.bom.gov.au/anon/gen/radar/IDR463.gif Reproduce code: --------------- <?php stream_context_get_default ( array ("ftp" => array ("proxy" => "tcp://localhost:8080")) ); $gif = file_get_contents ("ftp://ftp2.bom.gov.au/anon/gen/radar/IDR463.gif"); if ($gif === false) echo "failed\n"; else echo "size = " . strlen ($gif) . "\n"; ?> Expected result: ---------------- I expect to see a message of the form "size = 22544" Actual result: -------------- Segmentation fault PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 10:00:01 2025 UTC |
Here's a backtrace I got with latest 5.2 CVS: Program received signal SIGSEGV, Segmentation fault. 0x082a8b13 in _php_stream_write_filtered (stream=0xa1f84a4, buf=0x857550f "QUIT\r\n", count=6, flags=0) at /home/jani/src/php-5.2/main/streams/streams.c:955 955 status = filter->fops->filter(stream, filter, brig_inp, brig_outp, (gdb) bt #0 0x082a8b13 in _php_stream_write_filtered (stream=0xa1f84a4, buf=0x857550f "QUIT\r\n", count=6, flags=0) at /home/jani/src/php-5.2/main/streams/streams.c:955 #1 0x082a8cb7 in _php_stream_write (stream=0xa1f84a4, buf=0x857550f "QUIT\r\n", count=6) at /home/jani/src/php-5.2/main/streams/streams.c:1021 #2 0x08266db6 in php_stream_ftp_stream_close (wrapper=0x85ccea8, stream=0xa1f88e8) at /home/jani/src/php-5.2/ext/standard/ftp_fopen_wrapper.c:102 #3 0x082a77e2 in _php_stream_free (stream=0xa1f88e8, close_options=3) at /home/jani/src/php-5.2/main/streams/streams.c:366 #4 0x0821203f in zif_file_get_contents (ht=1, return_value=0xa1f7318, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1) at /home/jani/src/php-5.2/ext/standard/file.c:577 #5 0x0830ad90 in zend_do_fcall_common_helper_SPEC (execute_data=0xbfec8b04) at /home/jani/src/php-5.2/Zend/zend_vm_execute.h:200 #6 0x0831064d in ZEND_DO_FCALL_SPEC_CONST_HANDLER (execute_data=0xbfec8b04) at /home/jani/src/php-5.2/Zend/zend_vm_execute.h:1681 #7 0x0830a8f1 in execute (op_array=0xa1f7ab0) at /home/jani/src/php-5.2/Zend/zend_vm_execute.h:92 #8 0x082e5ba3 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/jani/src/php-5.2/Zend/zend.c:1134 #9 0x082929af in php_execute_script (primary_file=0xbfecaea0) at /home/jani/src/php-5.2/main/main.c:1986 #10 0x0835f9a0 in main (argc=3, argv=0xbfecaff4) at /home/jani/src/php-5.2/sapi/cli/php_cli.c:1140Assigned to the maintainer of the FTP stuff. Sara: Seems like there's some issues with filters. Propably not related but I stumbled to this: main/streams/filter.c:432 for(current = filter; current; current = current->next) { current isn't used anyplace else there.. Also it seems that the filters are nuked in _php_stream_free() before the closer is run..