#47893 [Opn]: CLI script with non-blocking STDIN terminates randomly

From: Date: Fri, 03 Apr 2009 23:18:56 +0000
Subject: #47893 [Opn]: CLI script with non-blocking STDIN terminates randomly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-135538@lists.php.net to get a copy of this message
ID: 47893 User updated by: jon at thesquareplanet dot com Reported By: jon at thesquareplanet dot com Status: Open Bug Type: Reproducible crash Operating System: Debian Lenny PHP Version: 5.2CVS-2009-04-03 (snap) New Comment: A discussion of this bug can also be found at: http://www.mail-archive.com/php-general@lists.php.net/msg118150.html Previous Comments: ------------------------------------------------------------------------ [2009-04-03 23:17:40] jon at thesquareplanet dot com 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 this bug report at http://bugs.php.net/?id=47893&edit=1

« previous php.bugs (#135538) next »