Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.4.4

Bug #8452 Unterminated Read Loop
Submitted: 2006-08-16 07:36 UTC
From: selsky at columbia dot edu Assigned: amistry
Status: Closed Package: Net_Sieve (version 1.1.3)
PHP Version: 5.0.5 OS: Solaris 9
Roadmaps: (Not assigned)    
Comments Add Comment Add patch

Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem : 24 - 22 = ?

 [2006-08-16 07:36 UTC] selsky at columbia dot edu (Matt Selsky)
Description: ------------ Occasionally, my Sieve server (Cyrus 2.3 snapshot) freaks out and doesn't actually return any data on the port after completing the TCP handshake. This causes the _recvLn() to return a continuous stream of ''. The while(true) loop therefore never stops and Apache begins to consume 100% CPU. There is a check in _recvLn() for $lastline === '', but it has been commented out since it was added in CVS version 1.5 ( annotate=1.10 near line 914) Can that check be uncommented and the trailing ': ' of the error messsage removed?


 [2006-08-16 07:53 UTC] amistry at php dot net (Anish Mistry)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.
 [2006-08-16 08:29 UTC] amistry at php dot net (Anish Mistry)
Is there a sequence of commands that causes this "freak-out" with the Sieve server? If you can isolate that it would be helpful for writing a testcase for SieveTest.php. Thanks.
 [2006-08-16 08:53 UTC] selsky at columbia dot edu
We connect to Sieve via an stunnel wrapper. I'm able to get the error without issueing any Sieve commands at all. The server freaks out before sending any output at all (and before the client says anything. Try the following in a loop: echo 'logout' | openssl s_client -connect cyrushost:2001 - quiet (2001 is the stunnel wrapped port) Occasionally, the s_client command exits like so: read:errno=131
 [2006-08-17 06:25 UTC] selsky at columbia dot edu
I was finally able to track this down. The problem occurs when Cyrus dies on one of my murder front-end hosts, but stunnel remains up. Net_Sieve connects successfully via SSL to stunnel, but then stunnel forwards the connection to the closed sieve port. The openssl s_client command returns "read:errno=131" whereas Net_Sieve (before this fix) would just loop forever.
 [2006-08-17 16:16 UTC] amistry at php dot net (Anish Mistry)
Well I'm not sure how to write a testcase for this situation. If you'd like you can have a stab at SieveTest.php. Either way we have it logged here in the bug tracker for future reference. Thanks.
 [2006-12-22 20:54 UTC] amistry at php dot net (Anish Mistry)
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at