Edit report at http://bugs.php.net/bug.php?id=53841&edit=1

 ID:                 53841
 User updated by:    wxiaoguang at gmail dot com
 Reported by:        wxiaoguang at gmail dot com
-Summary:            occasionally dead loop in
                     php_stream_url_wrap_http_ex
+Summary:            occasionally dead loop in
                     php_stream_url_wrap_http_ex/_php_stream_get_line
-Status:             Closed
+Status:             Assigned
 Type:               Bug
 Package:            HTTP related
 Operating System:   Linux
-PHP Version:        5.2.17
+PHP Version:        5.3.5
 Block user comment: N
 Private report:     N

 New Comment:

It happens in php-5.3.5 again





0x083a4c49 in _php_stream_get_line (stream=0x88d5f28, buf=0x8c31948
"http://www.xxxxxxxxxxx.net/xxxxx.php";, 

    maxlen=<error type>, returned_len=0x4) at
/usr/src/php5.3/source/php5-5.3.5/main/streams/streams.c:862

862     /usr/src/php5.3/source/php5-5.3.5/main/streams/streams.c: No
such file or directory.

        in /usr/src/php5.3/source/php5-5.3.5/main/streams/streams.c

(gdb) bt

#0  0x083a4c49 in _php_stream_get_line (stream=0x88d5f28, buf=0x8c31948
"http://www.xxxxxxxxxxx.net/xxxx.php";, 

    maxlen=<error type>, returned_len=0x4) at
/usr/src/php5.3/source/php5-5.3.5/main/streams/streams.c:862

#1  0x0833b034 in php_stream_url_wrap_http (wrapper=0x88d5f28,
path=0x8c31948 "http://www.xxxxxxxxxx.net/xxxxxx.php";, 

    mode=0x84c48d5 "rb", options=4, opened_path=0x0, context=0xba8c5cc)

    at
/usr/src/php5.3/source/php5-5.3.5/ext/standard/http_fopen_wrapper.c:825

#2  0x083a4056 in _php_stream_open_wrapper_ex (path=0x8c31948
"http://www.xxxxxxxxxxx.net/xxxxxxx.php";, 

    mode=0x84c48d5 "rb", options=12, opened_path=0x0,
context=0xba8c5cc)

    at /usr/src/php5.3/source/php5-5.3.5/main/streams/streams.c:1864

#3  0x082fa6c6 in zif_file_get_contents (ht=3, return_value=0xa8baf84,
return_value_ptr=0x0, this_ptr=0x0, 

    return_value_used=1) at
/usr/src/php5.3/source/php5-5.3.5/ext/standard/file.c:557

#4  0x0822b180 in phar_file_get_contents (ht=3, return_value=0xa8baf84,
return_value_ptr=0x0, this_ptr=0x0, 

    return_value_used=1) at
/usr/src/php5.3/source/php5-5.3.5/ext/phar/func_interceptors.c:225

#5  0x0840d8f1 in execute_internal (execute_data_ptr=0x8a937b0,
return_value_used=1)

    at /usr/src/php5.3/source/php5-5.3.5/Zend/zend_execute.c:1261

#6  0xb5c3f8fb in ?? () from /usr/lib/php5/20090626+lfs/suhosin.so


Previous Comments:
------------------------------------------------------------------------
[2011-02-03 07:17:52] wxiaoguang at gmail dot com

It seems no problem in 5.3

------------------------------------------------------------------------
[2011-01-26 06:39:03] ahar...@php.net

PHP 5.2 is no longer supported.



Does the same problem occur in PHP 5.3.5?

------------------------------------------------------------------------
[2011-01-26 04:16:17] wxiaoguang at gmail dot com

My script uses file_get_contents to read other sites' pages. The number
of pages to read is larger, this problem occurs more frequently. 



I didn't notice this problem when the number of pages to read is smaller
than 100 (now I have more than 1000 pages to read, and meet this problem
almost everyday)

------------------------------------------------------------------------
[2011-01-26 04:06:34] wxiaoguang at gmail dot com

Description:
------------
I am writing a php script running in crontab to read pages from many
other sites. Sometimes the script eats 100% CPU and get into a dead
loop. This problem occurs randomly, no dependence on special remote web
servers.



It seems that the problem is in
php5-5.2.17/ext/standard/http_fopen_wrapper.c around line 614.





When gdb is attached to the dead loop php process, the stack trace looks
like:

(the url differs everytime, so I think the remote web servers are not
related to this problem)



(gdb) bt

#0  0x0809ff78 in __i686.get_pc_thunk.bx ()

#1  0x082c4f11 in _php_stream_get_line (stream=0xcb512c4, buf=0xcb9536c
"Date: Tue, 25 Jan 2011 ", maxlen=<error type>, 

    returned_len=0xbfffa428) at
/usr/src/php5/source/php5-5.2.17/main/streams/streams.c:743

#2  0x08277084 in php_stream_url_wrap_http_ex (wrapper=0x85d06c8,
path=0x8879f9c "http://www.xxxxxxxxx.com/xxxxxxxx.php";, 

    mode=0x83c467f "rb", options=4, opened_path=0x0, context=0xcb4e290,
redirect_max=20, flags=1)

    at
/usr/src/php5/source/php5-5.2.17/ext/standard/http_fopen_wrapper.c:614

#3  0x08279120 in php_stream_url_wrap_http (wrapper=0x85d06c8,
path=0x8879f9c "http://www.xxxxxxxxxxxxx.com/xxxxxxx.php";, 

    mode=0x83c467f "rb", options=4, opened_path=0x0, context=0xcb4e290)

    at
/usr/src/php5/source/php5-5.2.17/ext/standard/http_fopen_wrapper.c:782

#4  0x082c450f in _php_stream_open_wrapper_ex (path=0x8879f9c
"http://www.xxxxxxxxx.com/xxxxxxxxx.php";, 

    mode=0x83c467f "rb", options=12, opened_path=0x0,
context=0xcb4e290)

    at /usr/src/php5/source/php5-5.2.17/main/streams/streams.c:1827

#5  0x08233513 in zif_file_get_contents (ht=3, return_value=0xcb81008,
return_value_ptr=0x0, this_ptr=0x0, 

    return_value_used=1) at
/usr/src/php5/source/php5-5.2.17/ext/standard/file.c:541

#6  0x08332b8b in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfffb32c)

    at /usr/src/php5/source/php5-5.2.17/Zend/zend_vm_execute.h:200

#7  0x0831ce30 in execute (op_array=0x87cb954) at
/usr/src/php5/source/php5-5.2.17/Zend/zend_vm_execute.h:92

#8  0x0833244e in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfffb80c)

    at /usr/src/php5/source/php5-5.2.17/Zend/zend_vm_execute.h:234

#9  0x0831ce30 in execute (op_array=0x87cafd8) at
/usr/src/php5/source/php5-5.2.17/Zend/zend_vm_execute.h:92

#10 0x0833244e in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfffc0dc)

    at /usr/src/php5/source/php5-5.2.17/Zend/zend_vm_execute.h:234

#11 0x0831ce30 in execute (op_array=0x8713608) at
/usr/src/php5/source/php5-5.2.17/Zend/zend_vm_execute.h:92

#12 0x082f7530 in zend_execute_scripts (type=8, retval=0x0,
file_count=3)

    at /usr/src/php5/source/php5-5.2.17/Zend/zend.c:1215

#13 0x082ac92f in php_execute_script (primary_file=0xbfffe4dc) at
/usr/src/php5/source/php5-5.2.17/main/main.c:2058

#14 0x0837d573 in main (argc=2, argv=0xbfffe5c4) at
/usr/src/php5/source/php5-5.2.17/sapi/cli/php_cli.c:1171



------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53841&edit=1

Reply via email to