[PHP-BUG] Bug #54092 [NEW]: Segmentation fault when using FTP proxy
From: Operating system: Linux PHP version: 5.2.17 Package: Reproducible crash Bug Type: Bug Bug description:Segmentation fault when using FTP proxy Description: Hi, either the Bug (#42420) is still alive or it is re-alive. But I am not allowed to re-open it. So sorry for opening a dup. php -v says: -- PHP 5.2.17-pl0-gentoo (cli) (built: Feb 18 2011 10:01:58) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans -- The PHP died with SegFault on two different machines with two different Proxies. regards Daniel Test script: --- ?php $uri = 'ftp://pkg-shadow.alioth.debian.org/pub/pkg-shadow/shadow-4.1.4.3.tar.bz2'; $proxy = 'tcp://proxy:8080'; $opts = array( 'ftp' = array( 'proxy' = $proxy ) ); $context = stream_context_create($opts); stream_context_set_params($context, array()); $fh = fopen($uri, 'r', false, $context); while (!feof($fh)) { echo foo\n; fread($fh, 4 * 1024); } fclose($fh); ? Expected result: many foos ;-) and no segmentation fault Actual result: -- many foos and segementation fault -- Edit bug report at http://bugs.php.net/bug.php?id=54092edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54092r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54092r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54092r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=54092r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54092r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=54092r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=54092r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=54092r=needscript Try newer version: http://bugs.php.net/fix.php?id=54092r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=54092r=support Expected behavior: http://bugs.php.net/fix.php?id=54092r=notwrong Not enough info: http://bugs.php.net/fix.php?id=54092r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=54092r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=54092r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54092r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=54092r=dst IIS Stability: http://bugs.php.net/fix.php?id=54092r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=54092r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=54092r=float No Zend Extensions: http://bugs.php.net/fix.php?id=54092r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=54092r=mysqlcfg
Bug #54092 [Opn]: Segmentation fault when using FTP proxy
Edit report at http://bugs.php.net/bug.php?id=54092edit=1 ID: 54092 User updated by:daniel dot buschke at nextiraone dot de Reported by:daniel dot buschke at nextiraone dot de Summary:Segmentation fault when using FTP proxy Status: Open Type: Bug Package:Reproducible crash Operating System: Linux PHP Version:5.2.17 Block user comment: N Private report: N New Comment: BackTrace (without debug symbols, hope it is usefull): #0 0x082c9780 in ?? () #1 0x08286b4e in ?? () #2 0x082c9c54 in _php_stream_free () #3 0x082c9e1b in ?? () #4 0x08303a2c in list_entry_destructor () #5 0x08301288 in zend_hash_del_key_or_index () #6 0x08303cc0 in _zend_list_delete () #7 0x0824cc6d in zif_fclose () #8 0x08314381 in execute_internal () #9 0xb705e672 in xdebug_execute_internal () from /usr/lib/php5.2/lib/extensions/no-debug-non-zts-20060613/xdebug.so #10 0x0832a071 in ?? () #11 0x08318420 in execute () #12 0xb705e324 in xdebug_execute () from /usr/lib/php5.2/lib/extensions/no-debug-non-zts-20060613/xdebug.so #13 0x082f6d0c in zend_execute_scripts () #14 0x082b5724 in php_execute_script () #15 0x0836f023 in main () Previous Comments: [2011-02-24 16:47:50] daniel dot buschke at nextiraone dot de Description: Hi, either the Bug (#42420) is still alive or it is re-alive. But I am not allowed to re-open it. So sorry for opening a dup. php -v says: -- PHP 5.2.17-pl0-gentoo (cli) (built: Feb 18 2011 10:01:58) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans -- The PHP died with SegFault on two different machines with two different Proxies. regards Daniel Test script: --- ?php $uri = 'ftp://pkg-shadow.alioth.debian.org/pub/pkg-shadow/shadow-4.1.4.3.tar.bz2'; $proxy = 'tcp://proxy:8080'; $opts = array( 'ftp' = array( 'proxy' = $proxy ) ); $context = stream_context_create($opts); stream_context_set_params($context, array()); $fh = fopen($uri, 'r', false, $context); while (!feof($fh)) { echo foo\n; fread($fh, 4 * 1024); } fclose($fh); ? Expected result: many foos ;-) and no segmentation fault Actual result: -- many foos and segementation fault -- Edit this bug report at http://bugs.php.net/bug.php?id=54092edit=1
Bug #54092 [Fbk-Opn]: Segmentation fault when using FTP proxy
Edit report at http://bugs.php.net/bug.php?id=54092edit=1 ID: 54092 User updated by:daniel dot buschke at nextiraone dot de Reported by:daniel dot buschke at nextiraone dot de Summary:Segmentation fault when using FTP proxy -Status: Feedback +Status: Open Type: Bug Package:Reproducible crash Operating System: Linux PHP Version:5.2.17 Block user comment: N Private report: N New Comment: Hi, PHP 5.3(!) is compiling with --enable-debug and --enable-ftp. Hope that's enough. Our test machine is not the fastest one ;-) But I am confused about 5.3. I think using 5.2-latest would be a better idea?! regards Daniel Previous Comments: [2011-02-24 17:06:18] paj...@php.net Please try using this snapshot: http://snaps.php.net/php5.3-latest.tar.gz For Windows: http://windows.php.net/snapshots/ [2011-02-24 17:02:16] daniel dot buschke at nextiraone dot de BackTrace (without debug symbols, hope it is usefull): #0 0x082c9780 in ?? () #1 0x08286b4e in ?? () #2 0x082c9c54 in _php_stream_free () #3 0x082c9e1b in ?? () #4 0x08303a2c in list_entry_destructor () #5 0x08301288 in zend_hash_del_key_or_index () #6 0x08303cc0 in _zend_list_delete () #7 0x0824cc6d in zif_fclose () #8 0x08314381 in execute_internal () #9 0xb705e672 in xdebug_execute_internal () from /usr/lib/php5.2/lib/extensions/no-debug-non-zts-20060613/xdebug.so #10 0x0832a071 in ?? () #11 0x08318420 in execute () #12 0xb705e324 in xdebug_execute () from /usr/lib/php5.2/lib/extensions/no-debug-non-zts-20060613/xdebug.so #13 0x082f6d0c in zend_execute_scripts () #14 0x082b5724 in php_execute_script () #15 0x0836f023 in main () [2011-02-24 16:47:50] daniel dot buschke at nextiraone dot de Description: Hi, either the Bug (#42420) is still alive or it is re-alive. But I am not allowed to re-open it. So sorry for opening a dup. php -v says: -- PHP 5.2.17-pl0-gentoo (cli) (built: Feb 18 2011 10:01:58) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans -- The PHP died with SegFault on two different machines with two different Proxies. regards Daniel Test script: --- ?php $uri = 'ftp://pkg-shadow.alioth.debian.org/pub/pkg-shadow/shadow-4.1.4.3.tar.bz2'; $proxy = 'tcp://proxy:8080'; $opts = array( 'ftp' = array( 'proxy' = $proxy ) ); $context = stream_context_create($opts); stream_context_set_params($context, array()); $fh = fopen($uri, 'r', false, $context); while (!feof($fh)) { echo foo\n; fread($fh, 4 * 1024); } fclose($fh); ? Expected result: many foos ;-) and no segmentation fault Actual result: -- many foos and segementation fault -- Edit this bug report at http://bugs.php.net/bug.php?id=54092edit=1
Bug #54092 [Opn]: Segmentation fault when using FTP proxy
Edit report at http://bugs.php.net/bug.php?id=54092edit=1 ID: 54092 User updated by:daniel dot buschke at nextiraone dot de Reported by:daniel dot buschke at nextiraone dot de Summary:Segmentation fault when using FTP proxy Status: Open Type: Bug Package:Reproducible crash Operating System: Linux PHP Version:5.2.17 Block user comment: N Private report: N New Comment: BackTrace of 5.3-latest: #0 0x08394b84 in _php_stream_write_filtered (stream=0xca0, buf=0x87431c6 QUIT\r\n, count=6, flags=0) at /usr/src/php5.3-201102241530/main/streams/streams.c:1001 #1 0x08394d24 in _php_stream_write (stream=0xca0, buf=0x87431c6 QUIT\r\n, count=6) at /usr/src/php5.3-201102241530/main/streams/streams.c:1067 #2 0x0834cdc0 in php_stream_ftp_stream_close (wrapper=0x87768e8, stream=0xd10) at /usr/src/php5.3-201102241530/ext/standard/ftp_fopen_wrapper.c:120 #3 0x083938f3 in _php_stream_free (stream=0xd10, close_options=11) at /usr/src/php5.3-201102241530/main/streams/streams.c:376 #4 0x0839591f in stream_resource_regular_dtor (rsrc=0xe14) at /usr/src/php5.3-201102241530/main/streams/streams.c:1433 #5 0x083f715b in list_entry_destructor (ptr=0xe14) at /usr/src/php5.3-201102241530/Zend/zend_list.c:184 #6 0x083f47fe in zend_hash_del_key_or_index (ht=0x878e42c, arKey=0x0, nKeyLength=0, h=5, flag=1) at /usr/src/php5.3-201102241530/Zend/zend_hash.c:500 #7 0x083f6e49 in _zend_list_delete (id=5) at /usr/src/php5.3-201102241530/Zend/zend_list.c:58 #8 0x08300d78 in zif_fclose (ht=1, return_value=0x4f8, return_value_ptr=0x0, this_ptr=0x0, return_value_used=0) at /usr/src/php5.3-201102241530/ext/standard/file.c:957 #9 0x084145de in zend_do_fcall_common_helper_SPEC (execute_data=0x88b5258) at /usr/src/php5.3-201102241530/Zend/zend_vm_execute.h:316 #10 0x08418122 in ZEND_DO_FCALL_SPEC_CONST_HANDLER (execute_data=0x88b5258) at /usr/src/php5.3-201102241530/Zend/zend_vm_execute.h:1606 #11 0x08413c7b in execute (op_array=0x8887010) at /usr/src/php5.3-201102241530/Zend/zend_vm_execute.h:107 #12 0x083e6f23 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/src/php5.3-201102241530/Zend/zend.c:1194 #13 0x0837de64 in php_execute_script (primary_file=0xb12c) at /usr/src/php5.3-201102241530/main/main.c:2268 #14 0x084aa2f8 in main (argc=2, argv=0xb2a4) at /usr/src/php5.3-201102241530/sapi/cli/php_cli.c:1193 Previous Comments: [2011-02-24 17:14:33] daniel dot buschke at nextiraone dot de Hi, PHP 5.3(!) is compiling with --enable-debug and --enable-ftp. Hope that's enough. Our test machine is not the fastest one ;-) But I am confused about 5.3. I think using 5.2-latest would be a better idea?! regards Daniel [2011-02-24 17:06:18] paj...@php.net Please try using this snapshot: http://snaps.php.net/php5.3-latest.tar.gz For Windows: http://windows.php.net/snapshots/ [2011-02-24 17:02:16] daniel dot buschke at nextiraone dot de BackTrace (without debug symbols, hope it is usefull): #0 0x082c9780 in ?? () #1 0x08286b4e in ?? () #2 0x082c9c54 in _php_stream_free () #3 0x082c9e1b in ?? () #4 0x08303a2c in list_entry_destructor () #5 0x08301288 in zend_hash_del_key_or_index () #6 0x08303cc0 in _zend_list_delete () #7 0x0824cc6d in zif_fclose () #8 0x08314381 in execute_internal () #9 0xb705e672 in xdebug_execute_internal () from /usr/lib/php5.2/lib/extensions/no-debug-non-zts-20060613/xdebug.so #10 0x0832a071 in ?? () #11 0x08318420 in execute () #12 0xb705e324 in xdebug_execute () from /usr/lib/php5.2/lib/extensions/no-debug-non-zts-20060613/xdebug.so #13 0x082f6d0c in zend_execute_scripts () #14 0x082b5724 in php_execute_script () #15 0x0836f023 in main () [2011-02-24 16:47:50] daniel dot buschke at nextiraone dot de Description: Hi, either the Bug (#42420) is still alive or it is re-alive. But I am not allowed to re-open it. So sorry for opening a dup. php -v says: -- PHP 5.2.17-pl0-gentoo (cli) (built: Feb 18 2011 10:01:58) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans -- The PHP died with SegFault on two different machines with two different Proxies. regards Daniel Test script: --- ?php $uri = 'ftp://pkg-shadow.alioth.debian.org/pub/pkg-shadow/shadow-4.1.4.3.tar.bz2'; $proxy = 'tcp://proxy:8080'; $opts = array( 'ftp' = array( 'proxy' = $proxy
Bug #54092 [Opn]: Segmentation fault when using FTP proxy
Edit report at http://bugs.php.net/bug.php?id=54092edit=1 ID: 54092 User updated by:daniel dot buschke at nextiraone dot de Reported by:daniel dot buschke at nextiraone dot de Summary:Segmentation fault when using FTP proxy Status: Open Type: Bug Package:Reproducible crash Operating System: Linux PHP Version:5.2.17 Block user comment: N Private report: N New Comment: Just for history: php -v PHP 5.3.6RC2-dev (cli) (built: Feb 24 2011 17:17:30) (DEBUG) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies Previous Comments: [2011-02-24 17:31:07] daniel dot buschke at nextiraone dot de BackTrace of 5.3-latest: #0 0x08394b84 in _php_stream_write_filtered (stream=0xca0, buf=0x87431c6 QUIT\r\n, count=6, flags=0) at /usr/src/php5.3-201102241530/main/streams/streams.c:1001 #1 0x08394d24 in _php_stream_write (stream=0xca0, buf=0x87431c6 QUIT\r\n, count=6) at /usr/src/php5.3-201102241530/main/streams/streams.c:1067 #2 0x0834cdc0 in php_stream_ftp_stream_close (wrapper=0x87768e8, stream=0xd10) at /usr/src/php5.3-201102241530/ext/standard/ftp_fopen_wrapper.c:120 #3 0x083938f3 in _php_stream_free (stream=0xd10, close_options=11) at /usr/src/php5.3-201102241530/main/streams/streams.c:376 #4 0x0839591f in stream_resource_regular_dtor (rsrc=0xe14) at /usr/src/php5.3-201102241530/main/streams/streams.c:1433 #5 0x083f715b in list_entry_destructor (ptr=0xe14) at /usr/src/php5.3-201102241530/Zend/zend_list.c:184 #6 0x083f47fe in zend_hash_del_key_or_index (ht=0x878e42c, arKey=0x0, nKeyLength=0, h=5, flag=1) at /usr/src/php5.3-201102241530/Zend/zend_hash.c:500 #7 0x083f6e49 in _zend_list_delete (id=5) at /usr/src/php5.3-201102241530/Zend/zend_list.c:58 #8 0x08300d78 in zif_fclose (ht=1, return_value=0x4f8, return_value_ptr=0x0, this_ptr=0x0, return_value_used=0) at /usr/src/php5.3-201102241530/ext/standard/file.c:957 #9 0x084145de in zend_do_fcall_common_helper_SPEC (execute_data=0x88b5258) at /usr/src/php5.3-201102241530/Zend/zend_vm_execute.h:316 #10 0x08418122 in ZEND_DO_FCALL_SPEC_CONST_HANDLER (execute_data=0x88b5258) at /usr/src/php5.3-201102241530/Zend/zend_vm_execute.h:1606 #11 0x08413c7b in execute (op_array=0x8887010) at /usr/src/php5.3-201102241530/Zend/zend_vm_execute.h:107 #12 0x083e6f23 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/src/php5.3-201102241530/Zend/zend.c:1194 #13 0x0837de64 in php_execute_script (primary_file=0xb12c) at /usr/src/php5.3-201102241530/main/main.c:2268 #14 0x084aa2f8 in main (argc=2, argv=0xb2a4) at /usr/src/php5.3-201102241530/sapi/cli/php_cli.c:1193 [2011-02-24 17:14:33] daniel dot buschke at nextiraone dot de Hi, PHP 5.3(!) is compiling with --enable-debug and --enable-ftp. Hope that's enough. Our test machine is not the fastest one ;-) But I am confused about 5.3. I think using 5.2-latest would be a better idea?! regards Daniel [2011-02-24 17:06:18] paj...@php.net Please try using this snapshot: http://snaps.php.net/php5.3-latest.tar.gz For Windows: http://windows.php.net/snapshots/ [2011-02-24 17:02:16] daniel dot buschke at nextiraone dot de BackTrace (without debug symbols, hope it is usefull): #0 0x082c9780 in ?? () #1 0x08286b4e in ?? () #2 0x082c9c54 in _php_stream_free () #3 0x082c9e1b in ?? () #4 0x08303a2c in list_entry_destructor () #5 0x08301288 in zend_hash_del_key_or_index () #6 0x08303cc0 in _zend_list_delete () #7 0x0824cc6d in zif_fclose () #8 0x08314381 in execute_internal () #9 0xb705e672 in xdebug_execute_internal () from /usr/lib/php5.2/lib/extensions/no-debug-non-zts-20060613/xdebug.so #10 0x0832a071 in ?? () #11 0x08318420 in execute () #12 0xb705e324 in xdebug_execute () from /usr/lib/php5.2/lib/extensions/no-debug-non-zts-20060613/xdebug.so #13 0x082f6d0c in zend_execute_scripts () #14 0x082b5724 in php_execute_script () #15 0x0836f023 in main () [2011-02-24 16:47:50] daniel dot buschke at nextiraone dot de Description: Hi, either the Bug (#42420) is still alive or it is re-alive. But I am not allowed to re-open it. So sorry for opening a dup. php -v says: -- PHP 5.2.17-pl0-gentoo (cli) (built: Feb 18 2011 10:01:58) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans -- The PHP
Bug #51739 [Com]: tricky string to float conversion
Edit report at http://bugs.php.net/bug.php?id=51739edit=1 ID: 51739 Comment by: daniel dot buschke at nextiraone dot de Reported by: daniel dot buschke at nextiraone dot de Summary: tricky string to float conversion Status: Bogus Type:Bug Package: *General Issues PHP Version: 5.2.13 New Comment: look at this: 8315e839da08e2a7afe6dd12ec58245d - 8315 is a valid integer - e is the sign for an exponent - BUT: 839da08e2a7afe6dd12ec58245d is not an integer! So it is not a valid exponent! Previous Comments: [2010-05-04 15:15:24] ahar...@php.net This is expected and documented behaviour: string to float conversions will use any valid numeric data at the start of the string and ignore anything thereafter. The e is being processed because it's being treated as an exponent. More information: http://php.net/language.types.string#language.types.string.conversion [2010-05-04 15:07:40] daniel dot buschke at nextiraone dot de Description: If you convert a string like 8315e839da08e2a7afe6dd12ec58245d into a float the conversion results in float(INF). The conversion seems to use only 8315e839 and throws anything else away. $ php -r 'var_dump(time()+rand()+8315e839da08e2a7afe6dd12ec58245d);' float(INF) Converting this string into a float is - of course - a bug of my PHP script. But at least I would like to discuss about the conversion behavior. It is fully correct to convert this string into a float if it is just 8315e839 but throwing some data away is - from my point of view - not a valid behavior. Test script: --- var_dump((float)8315e839da08e2a7afe6dd12ec58245d); Expected result: false or null or some other invalid floats or a warning Actual result: -- float(INF) -- Edit this bug report at http://bugs.php.net/bug.php?id=51739edit=1
[PHP-BUG] Bug #51739 [NEW]: tricky string to float conversion
From: Operating system: PHP version: 5.2.13 Package: *General Issues Bug Type: Bug Bug description:tricky string to float conversion Description: If you convert a string like 8315e839da08e2a7afe6dd12ec58245d into a float the conversion results in float(INF). The conversion seems to use only 8315e839 and throws anything else away. $ php -r 'var_dump(time()+rand()+8315e839da08e2a7afe6dd12ec58245d);' float(INF) Converting this string into a float is - of course - a bug of my PHP script. But at least I would like to discuss about the conversion behavior. It is fully correct to convert this string into a float if it is just 8315e839 but throwing some data away is - from my point of view - not a valid behavior. Test script: --- var_dump((float)8315e839da08e2a7afe6dd12ec58245d); Expected result: false or null or some other invalid floats or a warning Actual result: -- float(INF) -- Edit bug report at http://bugs.php.net/bug.php?id=51739edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51739r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51739r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51739r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=51739r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51739r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=51739r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=51739r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=51739r=needscript Try newer version: http://bugs.php.net/fix.php?id=51739r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=51739r=support Expected behavior: http://bugs.php.net/fix.php?id=51739r=notwrong Not enough info: http://bugs.php.net/fix.php?id=51739r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=51739r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=51739r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51739r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=51739r=dst IIS Stability: http://bugs.php.net/fix.php?id=51739r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=51739r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=51739r=float No Zend Extensions: http://bugs.php.net/fix.php?id=51739r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=51739r=mysqlcfg
#49871 [NEW]: unexpected result converting float to int
From: daniel dot buschke at nextiraone dot de Operating system: Linux PHP version: 5.2.11 PHP Bug Type: Math related Bug description: unexpected result converting float to int Description: Hi, when I convert following float: float(232) into an int I get: int(231). The float was calculated by 2.32 * 100. I know that this may result in 232.001 or 231.9 but the behavior is unexcpected because var_dump does not show the real (more or less wrong) float number. This one is exact the same as #2835 but the bug was closed without any further comments. The provided solution is unacceptable. How to convert 2.32 into an integer of the value 232? BTW: Please do not set this bug to bogus or closed with the default text for that problem ;-). As you can see in your bugtracker the community wants a solution for that. Please also remember that PHP is a scripting language which mainly ignores datatypes. This problem is not comprehensible to beginners (webdesigners ;-) ). I do not want to blame you with that but I just want to find a usefull solution. Please keep communication with community. regards Daniel Reproduce code: --- ?php messUpFloat(2.32); messUpFloat(8.28); function messUpFloat($float) { echo '- ' . $float . ' ' . PHP_EOL; $a = $float; var_dump($a); $b = $a * 100 + 0; var_dump($b); $c = (int)$b; var_dump($c); } ? Expected result: - 2.32 float(2.32) float(232) int(232) - 8.28 float(8.28) float(828) int(828) or (but not preferred ;-) ) - 2.32 float(2.32) float(231.999) int(231) - 8.28 float(8.28) float(827.999) int(827) Actual result: -- - 2.32 float(2.32) float(232) int(231) - 8.28 float(8.28) float(828) int(827) -- Edit bug report at http://bugs.php.net/?id=49871edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49871r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49871r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49871r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49871r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49871r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49871r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49871r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49871r=needscript Try newer version: http://bugs.php.net/fix.php?id=49871r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49871r=support Expected behavior: http://bugs.php.net/fix.php?id=49871r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49871r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49871r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49871r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49871r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=49871r=dst IIS Stability: http://bugs.php.net/fix.php?id=49871r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49871r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49871r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49871r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49871r=mysqlcfg
#49871 [Bgs]: unexpected result converting float to int
ID: 49871 User updated by: daniel dot buschke at nextiraone dot de Reported By: daniel dot buschke at nextiraone dot de Status: Bogus Bug Type: Math related Operating System: Linux PHP Version: 5.2.11 New Comment: (int)(string)$b that does the job but is ugly, too Previous Comments: [2009-10-14 11:16:23] sjo...@php.net Floating point values have a limited precision. Hence a value might not have the same string representation after any processing. That also includes writing a floating point value in your script and directly printing it without any mathematical operations. If you would like to know more about floats and what IEEE 754 is, read this: http://docs.sun.com/source/806-3568/ncg_goldberg.html Thank you for your interest in PHP. [2009-10-14 08:36:03] daniel dot buschke at nextiraone dot de Description: Hi, when I convert following float: float(232) into an int I get: int(231). The float was calculated by 2.32 * 100. I know that this may result in 232.001 or 231.9 but the behavior is unexcpected because var_dump does not show the real (more or less wrong) float number. This one is exact the same as #2835 but the bug was closed without any further comments. The provided solution is unacceptable. How to convert 2.32 into an integer of the value 232? BTW: Please do not set this bug to bogus or closed with the default text for that problem ;-). As you can see in your bugtracker the community wants a solution for that. Please also remember that PHP is a scripting language which mainly ignores datatypes. This problem is not comprehensible to beginners (webdesigners ;-) ). I do not want to blame you with that but I just want to find a usefull solution. Please keep communication with community. regards Daniel Reproduce code: --- ?php messUpFloat(2.32); messUpFloat(8.28); function messUpFloat($float) { echo '- ' . $float . ' ' . PHP_EOL; $a = $float; var_dump($a); $b = $a * 100 + 0; var_dump($b); $c = (int)$b; var_dump($c); } ? Expected result: - 2.32 float(2.32) float(232) int(232) - 8.28 float(8.28) float(828) int(828) or (but not preferred ;-) ) - 2.32 float(2.32) float(231.999) int(231) - 8.28 float(8.28) float(827.999) int(827) Actual result: -- - 2.32 float(2.32) float(232) int(231) - 8.28 float(8.28) float(828) int(827) -- Edit this bug report at http://bugs.php.net/?id=49871edit=1
#44059 [Com]: Able to get more infos about FTP
ID: 44059 Comment by: daniel dot buschke at nextiraone dot de Reported By: daniel dot chobe at nextiraone dot de Status: Open Bug Type: Feature/Change Request Operating System: Linux PHP Version: 5.2.5 New Comment: Could someone write a statement, please? It would be nice to know if this patch has any chance to get into the tree. Previous Comments: [2008-02-06 08:19:26] daniel dot chobe at nextiraone dot de --- ftp_save/php_ftp.c 2006-10-23 09:23:23.0 +0200 +++ ftp/php_ftp.c 2006-10-23 10:58:54.0 +0200 @@ -120,6 +120,10 @@ REGISTER_LONG_CONSTANT(FTP_FAILED, PHP_FTP_FAILED, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT(FTP_FINISHED, PHP_FTP_FINISHED, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT(FTP_MOREDATA, PHP_FTP_MOREDATA, CONST_PERSISTENT | CONST_CS); + + REGISTER_LONG_CONSTANT(FTP_PASSIVPORT, PHP_FTP_PASSIVPORT, CONST_PERSISTENT | CONST_CS); + REGISTER_LONG_CONSTANT(FTP_LASTRESPONSE, PHP_FTP_LASTRESPONSE, CONST_PERSISTENT | CONST_CS); + return SUCCESS; } @@ -1195,6 +1199,10 @@ case PHP_FTP_OPT_AUTOSEEK: RETURN_BOOL(ftp-autoseek); break; + case PHP_FTP_LASTRESPONSE: + RETURN_STRING(ftp-inbuf, 1); + break; + case PHP_FTP_PASSIVPORT: + RETURN_LONG(((struct sockaddr_in *) ftp-pasvaddr)-sin_port); + break; default: php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown option '%ld', option); RETURN_FALSE; diff --new-file -u -r ftp_save/php_ftp.h ftp/php_ftp.h --- ftp_save/php_ftp.h 2006-10-23 09:23:23.0 +0200 +++ ftp/php_ftp.h 2006-10-23 09:24:12.0 +0200 @@ -29,6 +29,8 @@ #define PHP_FTP_OPT_TIMEOUT_SEC0 #define PHP_FTP_OPT_AUTOSEEK 1 +#define PHP_FTP_LASTRESPONSE 2 +#define PHP_FTP_PASSIVPORT 3 #define PHP_FTP_AUTORESUME -1 PHP_MINIT_FUNCTION(ftp); [2008-02-06 08:17:46] daniel dot chobe at nextiraone dot de Description: The FTP Extension dont show the choosen passiv port. But sometime it helps if your have problem with your connection. The other thing your can get is the last ftp responseline. It also helps in case of problems with FTP Connections. Reproduce code: --- ?php # Connect, Login, Uploads, get Information $conn_id = ftp_connect($ftp_server); $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); $upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY); echo ftp_get_option($conn_id, FTP_LASTRESPONSE).PHP_EOL; echo ftp_get_option($conn_id, FTP_PASSIVPORT).PHP_EOL; ftp_close($conn_id); ? Expected result: 226 Transfer complete 43020 -- Edit this bug report at http://bugs.php.net/?id=44059edit=1
#39058 [Com]: Memory Leak
ID: 39058 Comment by: daniel dot buschke at nextiraone dot de Reported By: mpcribeiro at yahoo dot com Status: No Feedback Bug Type: Sybase-ct (ctlib) related Operating System: Solaris 10 PHP Version: 5.1.6 New Comment: # php -v PHP 5.2.6RC4-pl0-gentoo (cli) (built: Jun 13 2008 11:18:19) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies Still the same problem. Please reopen 'cause bug seems not fixed. Let me know how I can provide further informations - if needed. Previous Comments: [2008-03-03 07:33:51] kristjan at laborint dot com Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 256 bytes) PHP: PHP Version 5.2.5 System: Linux z37 2.6.9-67.0.4.ELsmp #1 SMP Sun Feb 3 07:06:14 EST 2008 x86_64 Server API: CGI/FastCGI Sybase: Client API Version $Id: dblib.c,v 1.244.2.1 2006/01/31 08:45:20 freddy77 Exp $ [2007-05-13 01:00:01] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to Open. [2006-10-06 09:17:31] mpcribeiro at yahoo dot com Fatal error: Allowed memory size of 209715200 bytes exhausted (tried to allocate 1835103092 bytes) in /data/www/ribeiros/syb/lib/lib_syb_sessions.php on line 66 Still with 5.1.6 and memory limit of 200Mb I'm currently compiling the latest PHP 5.2* available from devs cvs... lets see. Cheers [2006-10-06 08:59:03] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.2-win32-latest.zip [2006-10-06 08:54:43] mpcribeiro at yahoo dot com Description: PHP 5.1.6 compiled and installed without issues. However when procedures call sybase functions and after few minutes. PHP complain with not enough memory. PHP seem unable to read all the script, also unable to address the variables properly. At beggining gave fatal errors due to lack of memory even with 200Mb has memory limit (raised from its default value). After recompiling php 5.1.6 for 2nd time, I'm now getting the following errors, and lack of memory (200mb limit) message is now rare to appear. Warning: Unknown list entry type in request shutdown (0) in lib/lib_syb_sessions.php on line 61 Warning: Unknown list entry type in request shutdown (0) in /lib/lib_syb_sessions.php on line 42 PHP 5.1.6 was compiled with the following parameters: PHPHOME=/opt/php APACHEHOME=/opt/apache cat /dev/null conf.log export PATH=$PATH:/var/MailRoot/bin ./configure --prefix=$PHPHOME \ --bindir=$PHPHOME/bin \ --libdir=$PHPHOME/lib \ --with-config-file-path=$PHPHOME/conf \ --with-apache2=$APACHEHOME/ \ --with-apxs2=$APACHEHOME/bin/apxs \ --with-sfw=/usr/sfw \ --with-jpeg \ --with-jpeg-dir=/usr/local \ --with-png \ --with-png-dir=/usr/local \ --with-ftp \ --with-zlib-dir=/usr/local \ --enable-magic-quotes \ --enable-safe-mode \ --enable-sockets \ --enable-track-vars \ --enable-trans-sid \ --enable-memory-limit \ --enable-calendar \ --with-pgsql=/opt/pgsql \ --with-mysql-dir=/opt/mysql \ --with-sybase-ct=$SYBASE/$SYBASE_OCS \ --enable-static=sybase-ct \ --enable-mbstring I have reviewed the procedure few times and I can't find any glitch that could cause such behaviour. I'm now compiling the latest 5.2* from dev's cvs to see if this issue is solved. Cheers Reproduce code: --- function syb_list_processes($DBase,$DBusr,$DBpwd,$SID,$SN,$SYBSN,$ORDER) { putenv(SYBASE=/opt/sybase); putenv(SYBPLATFORM=solaris); putenv(LC_ALL=default); putenv(DSQUERY=SYBASE); $lg=read_session_id($SID,'login'); if(!$ORDER) { $ORDER='suid'; } $SYBusr=syb_get_sadetails($DBase,$DBusr,$DBpwd,$SN,$SYBSN,'sausr'); $SYBpwd=syb_get_sadetails($DBase,$DBusr,$DBpwd,$SN,$SYBSN,'sapwd'); [EMAIL PROTECTED]($SYBSN,$SYBusr,$SYBpwd); if($ORDER==) { $ORDER='suid'; } switch ($ORDER) { case 'cpu': $SORTORDER=DESC
#39058 [Com]: Memory Leak
ID: 39058 Comment by: daniel dot buschke at nextiraone dot de Reported By: mpcribeiro at yahoo dot com Status: No Feedback Bug Type: Sybase-ct (ctlib) related Operating System: Solaris 10 PHP Version: 5.1.6 New Comment: Noticed that mpcribeiro is using sybase bindings. I use freetds! So it is not a problem of the bindings, is it? Previous Comments: [2008-06-13 09:44:21] daniel dot buschke at nextiraone dot de # php -v PHP 5.2.6RC4-pl0-gentoo (cli) (built: Jun 13 2008 11:18:19) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies Still the same problem. Please reopen 'cause bug seems not fixed. Let me know how I can provide further informations - if needed. [2008-03-03 07:33:51] kristjan at laborint dot com Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 256 bytes) PHP: PHP Version 5.2.5 System: Linux z37 2.6.9-67.0.4.ELsmp #1 SMP Sun Feb 3 07:06:14 EST 2008 x86_64 Server API: CGI/FastCGI Sybase: Client API Version $Id: dblib.c,v 1.244.2.1 2006/01/31 08:45:20 freddy77 Exp $ [2007-05-13 01:00:01] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to Open. [2006-10-06 09:17:31] mpcribeiro at yahoo dot com Fatal error: Allowed memory size of 209715200 bytes exhausted (tried to allocate 1835103092 bytes) in /data/www/ribeiros/syb/lib/lib_syb_sessions.php on line 66 Still with 5.1.6 and memory limit of 200Mb I'm currently compiling the latest PHP 5.2* available from devs cvs... lets see. Cheers [2006-10-06 08:59:03] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.2-win32-latest.zip The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/39058 -- Edit this bug report at http://bugs.php.net/?id=39058edit=1
#37865 [Com]: The SNMP extension does not support setting multiple OIDs
ID: 37865 Comment by: daniel dot buschke at nextiraone dot de Reported By: lee dot duncan at intel dot com Status: Open Bug Type: Feature/Change Request Operating System: SUSE, Kernel 2.6.8-24.21-smp PHP Version: 5.1.4 New Comment: Lee, would you please add an attachment with your patch? TIA Previous Comments: [2007-03-16 15:11:19] eqguy2002 at yahoo dot com Version: 5.2.1 OS: Windows 2003 PHP's snmpset extension does not support setting multiple OIDs at once. Doing so from the command line using snmpset from Net-SNMP works fine. I need to set multiple OIDs at once in order to manage switches [2006-06-21 00:09:05] lee dot duncan at intel dot com Description: In order to add an entry to many SNMP tables, you need to be able to set multiple OIDs (values) at the same time. The net-snmp snmpset command allows this, as do the libnetsnmp APIs, but the SNMP extension to PHP does not support this. I added a new function to ext/snmp.c to support setting multiple values at once, and I'd like to see it added to the PHP SNMP extension for all to use. Reproduce code: --- Just try to set multiple SNMP OIDs (object IDs) with the current API, which is: proto int snmp2_set(string host, string community, string object_id, string type, mixed value [, int timeout [, int retries]]) I added: proto int snmp2_set_arr(string host, string community, array oids, array types, array values [, int timeout [, int retries]]) This way, no current programs break and new programs can use this functionality. Expected result: I'd like to be able to manage things like Marvell switches, which only allow adding a Table entry (e.g. for a new VLAN) if you can set multiple values (OIDs) at the same time. Actual result: -- Right now I can't do this without hacking the PHP SNMP extension. -- Edit this bug report at http://bugs.php.net/?id=37865edit=1
#42467 [WFx]: fsockopen: Operation now in progress
ID: 42467 User updated by: daniel dot buschke at nextiraone dot de Reported By: daniel dot buschke at nextiraone dot de Status: Wont fix Bug Type: Streams related Operating System: Linux PHP Version: 5CVS-2007-08-29 (snap) New Comment: DOH! Just setting this bug from Feedback to Wont Fix without answers is not fine! Previous Comments: [2007-08-29 12:11:56] daniel dot buschke at nextiraone dot de Ok, there are some things: 1. fsockopen is using a blocking socket, isn't it? 2. I told, that fsockopen is using the same functions as ssh2_*() If you want to use ssh2 functionallity you have the same problem: webserver_dev sandbox # cat ssh.php ?php $ssh_con = ssh2_connect('84.38.64.78'); $fingerprint = ssh2_fingerprint($ssh_con, SSH2_FINGERPRINT_MD5 | SSH2_FINGERPRINT_HEX); echo $fingerprint ? webserver_dev sandbox # socksify php -f ssh.php PHP Warning: ssh2_connect(): Unable to connect to 84.38.64.78 on port 22 in /www/vhosts/dev/sandbox/ssh.php on line 3 PHP Warning: ssh2_connect(): Unable to connect to 84.38.64.78 in /www/vhosts/dev/sandbox/ssh.php on line 3 PHP Warning: ssh2_fingerprint() expects parameter 1 to be resource, boolean given in /www/vhosts/dev/sandbox/ssh.php on line 4 Please try this script with you own ssh server. My will drop you if you try! So, this is a bug of ssh2 from pecl, because they are using that quick'n'dirty socket stuff?! [2007-08-29 11:50:16] [EMAIL PROTECTED] And as fsockopen() is meant for quick'n'dirty socket stuff and does work in normal situation - wont fix. You have a very special case and thus you need to use the lower level functions. [2007-08-29 11:48:28] [EMAIL PROTECTED] EINPROGRESS is quite normal error when you have non-blocking socket. I guess this sockify thing messes this. [2007-08-29 11:45:48] daniel dot buschke at nextiraone dot de here is the test script that shows that socket_create and socket_connect is working: webserver_dev sandbox # cat socks.php ?php define('TCP', 6); $sock = socket_create(AF_INET, SOCK_STREAM, TCP); socket_connect($sock, '69.147.83.196', 80); socket_send($sock, GET /\n, strlen('GET / HTTP 1.0'), 0); echo socket_read($sock, 100); socket_close($sock); ? webserver_dev sandbox # socksify php -f socks.php This document is located a href=/viewvc.cgi/here/a. [2007-08-29 11:43:16] daniel dot buschke at nextiraone dot de webserver_dev sandbox # cat fsockopen_timeout.php ?php fsockopen('69.147.83.196', 80, $errno, $errstr, 30); echo errno: $errno\n; echo errstr: $errstr\n; ? webserver_dev sandbox # socksify php -f fsockopen_timeout.php PHP Warning: fsockopen(): unable to connect to 69.147.83.196:80 (Operation now in progress) in /www/vhosts/dev/sandbox/fsockopen_timeout.php on line 2 errno: 115 errstr: Operation now in progress of curse it is equal to '1.2.3.4', 99 The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/42467 -- Edit this bug report at http://bugs.php.net/?id=42467edit=1
#42467 [NEW]: fsockopen: Operation now in progress
From: daniel dot buschke at nextiraone dot de Operating system: Linux PHP version: 5CVS-2007-08-29 (snap) PHP Bug Type: *Network Functions Bug description: fsockopen: Operation now in progress Description: When trying to connect to a host via fsockopen and socksify (see dante) I get following: PHP Warning: fsockopen(): unable to connect to 1.2.3.4:99 (Operation now in progress) in /socksify.php on line 15 But Operation now in progress is not an error which tolds that connect fails. socket_create and socket_connect are working fine. seems like #39803 but has different version. Patch of #38568 did not work Reproduce code: --- ?php $sock = fsockopen('1.2.3.4', 99); ? Expected result: $sock should be an handle which is usable with fread or sth like this $sock !== FALSE Actual result: -- PHP Warning: fsockopen(): unable to connect to 1.2.3.4:99 (Operation now in progress) in /socksify.php on line 15 $sock === FALSE -- Edit bug report at http://bugs.php.net/?id=42467edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42467r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42467r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42467r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42467r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42467r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42467r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=42467r=needscript Try newer version:http://bugs.php.net/fix.php?id=42467r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42467r=support Expected behavior:http://bugs.php.net/fix.php?id=42467r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42467r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42467r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42467r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42467r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42467r=dst IIS Stability:http://bugs.php.net/fix.php?id=42467r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42467r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42467r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42467r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=42467r=mysqlcfg
#42467 [Fbk-Opn]: fsockopen: Operation now in progress
ID: 42467 User updated by: daniel dot buschke at nextiraone dot de Reported By: daniel dot buschke at nextiraone dot de -Status: Feedback +Status: Open Bug Type: Sockets related Operating System: Linux PHP Version: 5CVS-2007-08-29 (snap) New Comment: ?php $sock = fsockopen('69.147.83.196', 80); ? This one trys to connect to an IP of bugs.php.net. Remember that I run this script with socksifiy in front: socksify php -f socksify.php I'm sure it is not easy for you to reproduce this bug. So here is the whole story: I want to connect from Server A (lan) to a Server B (internet). Server A is behind a firewall which drops allmost everything. So if I want to connect to the internet I have to use SOCKS5. Therefore I have to use socksify. socks_create and socks_connect are working fine! So this is not a problem of socksify. But I can not use socks because I want to use ssh2_* buildins which are using the same core functions as fsockopen and which result in same problem. Previous Comments: [2007-08-29 09:51:18] [EMAIL PROTECTED] I can not reproduce with that one liner. It simply hangs. Obviously you have some bigger script to test with? [2007-08-29 09:30:01] daniel dot buschke at nextiraone dot de Description: When trying to connect to a host via fsockopen and socksify (see dante) I get following: PHP Warning: fsockopen(): unable to connect to 1.2.3.4:99 (Operation now in progress) in /socksify.php on line 15 But Operation now in progress is not an error which tolds that connect fails. socket_create and socket_connect are working fine. seems like #39803 but has different version. Patch of #38568 did not work Reproduce code: --- ?php $sock = fsockopen('1.2.3.4', 99); ? Expected result: $sock should be an handle which is usable with fread or sth like this $sock !== FALSE Actual result: -- PHP Warning: fsockopen(): unable to connect to 1.2.3.4:99 (Operation now in progress) in /socksify.php on line 15 $sock === FALSE -- Edit this bug report at http://bugs.php.net/?id=42467edit=1
#42467 [Fbk-Opn]: fsockopen: Operation now in progress
ID: 42467 User updated by: daniel dot buschke at nextiraone dot de Reported By: daniel dot buschke at nextiraone dot de -Status: Feedback +Status: Open Bug Type: Streams related Operating System: Linux PHP Version: 5CVS-2007-08-29 (snap) New Comment: webserver_dev sandbox # cat fsockopen_timeout.php ?php fsockopen('69.147.83.196', 80, $errno, $errstr, 30); echo errno: $errno\n; echo errstr: $errstr\n; ? webserver_dev sandbox # socksify php -f fsockopen_timeout.php PHP Warning: fsockopen(): unable to connect to 69.147.83.196:80 (Operation now in progress) in /www/vhosts/dev/sandbox/fsockopen_timeout.php on line 2 errno: 115 errstr: Operation now in progress of curse it is equal to '1.2.3.4', 99 Previous Comments: [2007-08-29 11:28:03] [EMAIL PROTECTED] Try this (timeout included) instead: ?php $sock = fsockopen('1.2.3.4', 99, $errno, $errstr, 30); ? [2007-08-29 11:05:24] daniel dot buschke at nextiraone dot de ?php $sock = fsockopen('69.147.83.196', 80); ? This one trys to connect to an IP of bugs.php.net. Remember that I run this script with socksifiy in front: socksify php -f socksify.php I'm sure it is not easy for you to reproduce this bug. So here is the whole story: I want to connect from Server A (lan) to a Server B (internet). Server A is behind a firewall which drops allmost everything. So if I want to connect to the internet I have to use SOCKS5. Therefore I have to use socksify. socks_create and socks_connect are working fine! So this is not a problem of socksify. But I can not use socks because I want to use ssh2_* buildins which are using the same core functions as fsockopen and which result in same problem. [2007-08-29 09:51:18] [EMAIL PROTECTED] I can not reproduce with that one liner. It simply hangs. Obviously you have some bigger script to test with? [2007-08-29 09:30:01] daniel dot buschke at nextiraone dot de Description: When trying to connect to a host via fsockopen and socksify (see dante) I get following: PHP Warning: fsockopen(): unable to connect to 1.2.3.4:99 (Operation now in progress) in /socksify.php on line 15 But Operation now in progress is not an error which tolds that connect fails. socket_create and socket_connect are working fine. seems like #39803 but has different version. Patch of #38568 did not work Reproduce code: --- ?php $sock = fsockopen('1.2.3.4', 99); ? Expected result: $sock should be an handle which is usable with fread or sth like this $sock !== FALSE Actual result: -- PHP Warning: fsockopen(): unable to connect to 1.2.3.4:99 (Operation now in progress) in /socksify.php on line 15 $sock === FALSE -- Edit this bug report at http://bugs.php.net/?id=42467edit=1
#42467 [Opn]: fsockopen: Operation now in progress
ID: 42467 User updated by: daniel dot buschke at nextiraone dot de Reported By: daniel dot buschke at nextiraone dot de Status: Open Bug Type: Streams related Operating System: Linux PHP Version: 5CVS-2007-08-29 (snap) New Comment: here is the test script that shows that socket_create and socket_connect is working: webserver_dev sandbox # cat socks.php ?php define('TCP', 6); $sock = socket_create(AF_INET, SOCK_STREAM, TCP); socket_connect($sock, '69.147.83.196', 80); socket_send($sock, GET /\n, strlen('GET / HTTP 1.0'), 0); echo socket_read($sock, 100); socket_close($sock); ? webserver_dev sandbox # socksify php -f socks.php This document is located a href=/viewvc.cgi/here/a. Previous Comments: [2007-08-29 11:43:16] daniel dot buschke at nextiraone dot de webserver_dev sandbox # cat fsockopen_timeout.php ?php fsockopen('69.147.83.196', 80, $errno, $errstr, 30); echo errno: $errno\n; echo errstr: $errstr\n; ? webserver_dev sandbox # socksify php -f fsockopen_timeout.php PHP Warning: fsockopen(): unable to connect to 69.147.83.196:80 (Operation now in progress) in /www/vhosts/dev/sandbox/fsockopen_timeout.php on line 2 errno: 115 errstr: Operation now in progress of curse it is equal to '1.2.3.4', 99 [2007-08-29 11:28:03] [EMAIL PROTECTED] Try this (timeout included) instead: ?php $sock = fsockopen('1.2.3.4', 99, $errno, $errstr, 30); ? [2007-08-29 11:05:24] daniel dot buschke at nextiraone dot de ?php $sock = fsockopen('69.147.83.196', 80); ? This one trys to connect to an IP of bugs.php.net. Remember that I run this script with socksifiy in front: socksify php -f socksify.php I'm sure it is not easy for you to reproduce this bug. So here is the whole story: I want to connect from Server A (lan) to a Server B (internet). Server A is behind a firewall which drops allmost everything. So if I want to connect to the internet I have to use SOCKS5. Therefore I have to use socksify. socks_create and socks_connect are working fine! So this is not a problem of socksify. But I can not use socks because I want to use ssh2_* buildins which are using the same core functions as fsockopen and which result in same problem. [2007-08-29 09:51:18] [EMAIL PROTECTED] I can not reproduce with that one liner. It simply hangs. Obviously you have some bigger script to test with? [2007-08-29 09:30:01] daniel dot buschke at nextiraone dot de Description: When trying to connect to a host via fsockopen and socksify (see dante) I get following: PHP Warning: fsockopen(): unable to connect to 1.2.3.4:99 (Operation now in progress) in /socksify.php on line 15 But Operation now in progress is not an error which tolds that connect fails. socket_create and socket_connect are working fine. seems like #39803 but has different version. Patch of #38568 did not work Reproduce code: --- ?php $sock = fsockopen('1.2.3.4', 99); ? Expected result: $sock should be an handle which is usable with fread or sth like this $sock !== FALSE Actual result: -- PHP Warning: fsockopen(): unable to connect to 1.2.3.4:99 (Operation now in progress) in /socksify.php on line 15 $sock === FALSE -- Edit this bug report at http://bugs.php.net/?id=42467edit=1
#42467 [WFx]: fsockopen: Operation now in progress
ID: 42467 User updated by: daniel dot buschke at nextiraone dot de Reported By: daniel dot buschke at nextiraone dot de Status: Wont fix Bug Type: Streams related Operating System: Linux PHP Version: 5CVS-2007-08-29 (snap) New Comment: Ok, there are some things: 1. fsockopen is using a blocking socket, isn't it? 2. I told, that fsockopen is using the same functions as ssh2_*() If you want to use ssh2 functionallity you have the same problem: webserver_dev sandbox # cat ssh.php ?php $ssh_con = ssh2_connect('84.38.64.78'); $fingerprint = ssh2_fingerprint($ssh_con, SSH2_FINGERPRINT_MD5 | SSH2_FINGERPRINT_HEX); echo $fingerprint ? webserver_dev sandbox # socksify php -f ssh.php PHP Warning: ssh2_connect(): Unable to connect to 84.38.64.78 on port 22 in /www/vhosts/dev/sandbox/ssh.php on line 3 PHP Warning: ssh2_connect(): Unable to connect to 84.38.64.78 in /www/vhosts/dev/sandbox/ssh.php on line 3 PHP Warning: ssh2_fingerprint() expects parameter 1 to be resource, boolean given in /www/vhosts/dev/sandbox/ssh.php on line 4 Please try this script with you own ssh server. My will drop you if you try! So, this is a bug of ssh2 from pecl, because they are using that quick'n'dirty socket stuff?! Previous Comments: [2007-08-29 11:50:16] [EMAIL PROTECTED] And as fsockopen() is meant for quick'n'dirty socket stuff and does work in normal situation - wont fix. You have a very special case and thus you need to use the lower level functions. [2007-08-29 11:48:28] [EMAIL PROTECTED] EINPROGRESS is quite normal error when you have non-blocking socket. I guess this sockify thing messes this. [2007-08-29 11:45:48] daniel dot buschke at nextiraone dot de here is the test script that shows that socket_create and socket_connect is working: webserver_dev sandbox # cat socks.php ?php define('TCP', 6); $sock = socket_create(AF_INET, SOCK_STREAM, TCP); socket_connect($sock, '69.147.83.196', 80); socket_send($sock, GET /\n, strlen('GET / HTTP 1.0'), 0); echo socket_read($sock, 100); socket_close($sock); ? webserver_dev sandbox # socksify php -f socks.php This document is located a href=/viewvc.cgi/here/a. [2007-08-29 11:43:16] daniel dot buschke at nextiraone dot de webserver_dev sandbox # cat fsockopen_timeout.php ?php fsockopen('69.147.83.196', 80, $errno, $errstr, 30); echo errno: $errno\n; echo errstr: $errstr\n; ? webserver_dev sandbox # socksify php -f fsockopen_timeout.php PHP Warning: fsockopen(): unable to connect to 69.147.83.196:80 (Operation now in progress) in /www/vhosts/dev/sandbox/fsockopen_timeout.php on line 2 errno: 115 errstr: Operation now in progress of curse it is equal to '1.2.3.4', 99 [2007-08-29 11:28:03] [EMAIL PROTECTED] Try this (timeout included) instead: ?php $sock = fsockopen('1.2.3.4', 99, $errno, $errstr, 30); ? The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/42467 -- Edit this bug report at http://bugs.php.net/?id=42467edit=1