php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39869 safe_read does not initialize errno
Submitted: 2006-12-18 15:20 UTC Modified: 2006-12-19 09:18 UTC
From: michiel at boland dot org Assigned: dmitry (profile)
Status: Closed Package: CGI/CLI related
PHP Version: 5.2.0 OS: Solaris
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: michiel at boland dot org
New email:
PHP Version: OS:

 

 [2006-12-18 15:20 UTC] michiel at boland dot org
Description:
------------
When using PHP in FastCGI mode, PHP has a tendency to once
in a while spin in a tight loop, hogging the cpu.

The fix is to initialize errno to 0 before any call to read()
in the safe_read function in sapi/cgi/fastcgi.c

Reproduce code:
---------------
Not applicable

Expected result:
----------------
n.a.

Actual result:
--------------
n.a.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-18 17:33 UTC] dmitry@php.net
Could you please provide which "errno" and "ret" values leads php into this loop.
 [2006-12-18 18:10 UTC] michiel at boland dot org
If errno is already EINTR before entry into safe_read,
then that function will loop forever if the read() call
returns 0
 [2006-12-19 09:18 UTC] dmitry@php.net
Fixed in CVS HEAD and PHP_5_2.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 11:01:30 2024 UTC