#20033 [Opn->Fbk]: Echoing/fputsing ~11k+ of data to STDOUT causes problem

From: Date: Tue, 22 Oct 2002 21:57:05 +0000
Subject: #20033 [Opn->Fbk]: Echoing/fputsing ~11k+ of data to STDOUT causes problem
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-23071@lists.php.net to get a copy of this message
ID: 20033 Updated by: wez@php.net Reported By: ces@vaultbbs.com -Status: Open +Status: Feedback Bug Type: Sockets related Operating System: Red Hat 7.3 PHP Version: 4CVS-2002-10-22 New Comment: Can you isolate the line of code that causes the hang? Use printf to output a note before each function you suspect of causing the problem; the last line output by the script will tell you which one has hung. We need to narrow it down to either sockets (as in ext/socket), or streams (fgets, fread, fwrite etc.), or output buffer -- three unrelated areas. Previous Comments: ------------------------------------------------------------------------ [2002-10-22 16:34:52] ces@vaultbbs.com Additional info: If I switch my binary back to php 4.1.3, my POP3 server script works 100% inasmuch as this bug is concerned. Additionally, I can confirm that something is crashing in PHP in that if I dump data to a log file, the logfile ends where the data turns to garbage. An additional log entry should be made when the message dump is complete. This is never executed. This is a weird problem that seems to cause PHP to hang, not core dump, and not terminate the TCP/IP connection but causes PHP to just dump garbage and just hang. ------------------------------------------------------------------------ [2002-10-22 16:29:48] ces@vaultbbs.com I'm writing a POP3 server daemon in PHP. Incoming requests to port 110 are routed to the POP3 server daemon by xinetd. Everything works fine if I *Telnet* to port 110. Everything also works if I just run the script from the command line. However, if I connect to my server by opening a true POP3 connection (such as from Eudora client), messages greater than about 11k cause problems when they are downloaded. I originally suspected a POP3 implementation problem on my part. However, I've confirmed that if I open a clean (non-Telnet) connection to my server and manually RETRieve the large message, the first 11k is dumped correctly but at about 11k everything else sent by PHP is garbage. It appears as though there were some kind of output buffer overflow. This also appears to damage the socket. It does NOT cause the TCP/IP connection to be terminated, but no additional output is sent and the script becomes unresponsive to additional commands sent to it. This *might* be related in some way to bug #19944 that I reported last week and which I closed this morning. This is with snap 200210220900. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=20033&edit=1

« previous php.bugs (#23071) next »