ID:               40286
 Comment by:       atomo64 at gmail dot com
 Reported By:      gabriel at oxeva dot fr
 Status:           No Feedback
 Bug Type:         CGI related
 Operating System: Linux 2.6
 PHP Version:      5.2.0
 Assigned To:      dmitry
 New Comment:

[EMAIL PROTECTED]:

The problem is that this bug affects Debian's PHP5 package of etch[1]
and in order to fix it the right patch is required. We can't simply
'update' the source package.

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=431799


Previous Comments:
------------------------------------------------------------------------

[2007-09-14 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".

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

[2007-09-06 11:16:16] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi



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

[2007-08-22 14:44:48] gabriel at oxeva dot fr

Comment from [EMAIL PROTECTED] : 

I don't believe that this patch could correct blocking I/O.

What this patch does is just remove one extra memory pointer which was
not needed.
 
Correct fix would be to use O_NONBLOCK when opening file descriptor
and
then test for EAGAIN.  Or use select(2) before reading from descriptor
in safe_read() function to test if data is available for reading.

I could be wrong, but it just doesn't seems to be fix for this problem.

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

[2007-02-16 11:48:12] [EMAIL PROTECTED]

I hope the bug is fixed in CVS HEAD, PHP_5_2 (not in 5.2.1) and PHP_4_4
(not in 4.4.5).

The patch for PHP_5_2 folows:

Index: sapi/cgi/cgi_main.c
===================================================================
RCS file: /repository/php-src/sapi/cgi/cgi_main.c,v
retrieving revision 1.267.2.15.2.22
diff -u -p -d -r1.267.2.15.2.22 cgi_main.c
--- sapi/cgi/cgi_main.c 15 Feb 2007 12:33:16 -0000      1.267.2.15.2.22
+++ sapi/cgi/cgi_main.c 16 Feb 2007 11:16:39 -0000
@@ -355,18 +355,14 @@ static int sapi_cgi_send_headers(sapi_he
 
 static int sapi_cgi_read_post(char *buffer, uint count_bytes
TSRMLS_DC)
 {
-       uint read_bytes=0, tmp_read_bytes;
-#if PHP_FASTCGI
-       char *pos = buffer;
-#endif
+       int read_bytes=0, tmp_read_bytes;
 
        count_bytes = MIN(count_bytes, (uint) SG(request_info).content_length
- SG(read_post_bytes));
        while (read_bytes < count_bytes) {
 #if PHP_FASTCGI
                if (fcgi_is_fastcgi()) {
                        fcgi_request *request = (fcgi_request*) 
SG(server_context);
-                       tmp_read_bytes = fcgi_read(request, pos, count_bytes -
read_bytes);
-                       pos += tmp_read_bytes;
+                       tmp_read_bytes = fcgi_read(request, buffer + read_bytes,
count_bytes - read_bytes);
                } else {
                        tmp_read_bytes = read(0, buffer + read_bytes, 
count_bytes -
read_bytes);
                }


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

[2007-01-31 11:56:49] gabriel at oxeva dot fr

And today, I can now confirm that the bugs exists with PHP 5.2.0 too.
Here is the backtrace :

(gdb) bt
#0  0xb7fb2410 in ?? ()
#1  0xbfc06988 in ?? ()
#2  0x00000008 in ?? ()
#3  0xbfc069b0 in ?? ()
#4  0x006ee4f3 in __read_nocancel () from /lib/tls/libc.so.6
#5  0x0841b6d4 in fcgi_init_request ()
#6  0x0841b770 in fcgi_read ()
#7  0x0841c546 in fcgi_putenv ()
#8  0x08382d33 in sapi_deactivate ()
#9  0x0837c4f6 in php_request_shutdown ()
#10 0x0841e463 in main ()

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

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/40286

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

Reply via email to