From:             jon at thesquareplanet dot com
Operating system: Debian Lenny
PHP version:      5.2CVS-2009-04-03 (snap)
PHP Bug Type:     Reproducible crash
Bug description:  CLI script with non-blocking STDIN terminates randomly

Description:
------------
When setting STDIN to be non-blocking, and then running fread() on it, the
cli script suddenly terminates at a seemingly random point during the
reading. No error message is given.

Seemingly related bugs:
http://bugs.php.net/bug.php?id=25616 <-- This is the same bug, but has
erroneously been labeled as a dupe of the one below
http://bugs.php.net/bug.php?id=25575 <-- This bug describes a somewhat
similar, though not nearly identical, problem

These bugs are both set as last modified in 2003/2004, but the issue
remains unfixed.

Reproduce code:
---------------
<?php
stream_set_blocking(STDIN, FALSE);
while (1) {
var_dump(fread(STDIN,1));
echo "\n";;
}
?>

Expected result:
----------------
A never-ending sequence of var_dumps of either an empty string or a typed
character

Actual result:
--------------
The expected output, but only for a short while, and then the script
terminates

-- 
Edit bug report at http://bugs.php.net/?id=47893&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=47893&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=47893&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=47893&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=47893&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=47893&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=47893&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=47893&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=47893&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=47893&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=47893&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=47893&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=47893&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=47893&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=47893&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47893&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47893&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=47893&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=47893&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=47893&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=47893&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=47893&r=mysqlcfg

Reply via email to