#39869 [Opn->Csd]: safe_read does not initialize errno

From: Date: Tue, 19 Dec 2006 09:18:40 +0000
Subject: #39869 [Opn->Csd]: safe_read does not initialize errno
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-106538@lists.php.net to get a copy of this message
ID: 39869 Updated by: dmitry@php.net Reported By: michiel at boland dot org -Status: Open +Status: Closed Bug Type: CGI related Operating System: Solaris PHP Version: 5.2.0 Assigned To: dmitry New Comment: Fixed in CVS HEAD and PHP_5_2. Previous Comments: ------------------------------------------------------------------------ [2006-12-18 18:10:19] 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-18 17:33:01] dmitry@php.net Could you please provide which "errno" and "ret" values leads php into this loop. ------------------------------------------------------------------------ [2006-12-18 15:20:44] 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39869&edit=1

« previous php.bugs (#106538) next »