php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33041 Broken pipe on file_get_contents with HTTP handler causes 100% CPU loop
Submitted: 2005-05-16 09:41 UTC Modified: 2005-05-24 01:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: arachnid at notdot dot net Assigned:
Status: No Feedback Package: Performance problem
PHP Version: 5.0.3 OS: Linux (Gentoo)
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2005-05-16 09:41 UTC] arachnid at notdot dot net
Description:
------------
Using file_get_contents with an HTTP url causes PHP (CLI, at least) to go into a 100% CPU loop if the connection breaks. Since there's no timeout context parameter, this persists indefinitely.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-16 10:51 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.


 [2005-05-16 11:52 UTC] arachnid at notdot dot net
I didn't figure an example script would be particularaly useful, as the behaviour described requires the connection to stall or be reset while file_get_contents is running. An example script would simply consist of $data = file_get_contents('http://example.com/a.big.file'); and breaking the connection partway through downloading said file.
 [2005-05-16 21:20 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-05-24 01:00 UTC] 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".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 14:01:29 2024 UTC