#34972 [NEW]: STDIN won't allow nonblocking.
From: VJTD3 at VJTD3 dot com
Operating system: Windows/Linux
PHP version: 5.0.5
PHP Bug Type: CGI related
Bug description: STDIN won't allow nonblocking.
Description:
------------
STDIN won't allow nonblocking.
Reproduce code:
---------------
<?php
stream_set_blocking(STDIN, FALSE);
while (1) {
echo 'infinate loop showing nonblocking problem'."\n";
echo 'said:'.fgets(STDIN, 1024);
}
?>
Expected result:
----------------
The test code should be a infinate loop with "infinate loop showing
nonblocking problem" said trillions of times fast like a infinate loop is
suposto do when you make a boo boo. instead it will say it once then wait
for input then wait again etc as a blocked resource is expected. but
"stream_set_blocking(STDIN, FALSE);" should be allowing it to do the loop
unblocked resulting in major screen flooding yet unblocking the resource
is ignored.
This means you can't do something like a client program in your shell that
is "interactive" like a Telnet client or similar.
I can dig the whole not reading as typing because that would be too "raw"
for common usage... [ie phrasing the backspaces etc though maybe a
seperate abaility? this would allow arrow key kinda stuff and similar...]
But waiting for a "\n" or whatever file ending shouldn't have any effect
on that loop. It should act just like a TCP or any other connection when
unblocked there the resource just has a return of no data.
"php -f test.php" I use to run it.
Actual result:
--------------
uses blocking when "stream_set_blocking(STDIN, FALSE);" was used.
--
Edit bug report at http://bugs.php.net/?id=34972&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34972&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34972&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34972&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34972&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34972&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34972&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34972&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34972&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34972&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34972&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=34972&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=34972&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34972&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34972&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34972&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34972&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34972&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34972&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34972&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34972&r=mysqlcfg
Thread (44 messages)
- VJTD3 at VJTD3 dot com
- wez@php.net#34972 [Opn]: STDIN won't allow nonblocking.
- VJTD3 at VJTD3 dot com#34972 [Opn]: STDIN won't allow nonblocking.
- sniper@php.net#34972 [Opn->Asn]: STDIN won't allow nonblocking.
- sniper@php.net#34972 [Asn->Fbk]: STDIN won't allow nonblocking.
- VJTD3 at VJTD3 dot com#34972 [Fbk->Opn]: STDIN won't allow nonblocking.
- sniper@php.net#34972 [Opn->Asn]: STDIN won't allow nonblocking.
- VJTD3 at VJTD3 dot com#34972 [Asn]: STDIN won't allow nonblocking.
- VJTD3 at VJTD3 dot com#34972 [Asn]: STDIN won't allow nonblocking.
- jani@php.net#34972 [Asn->Fbk]: STDIN won't allow nonblocking.
- VJTD3 at VJTD3 dot com#34972 [NoF->Opn]: STDIN won't allow nonblocking.
- donnyk at gmail dot com#34972 [Com]: STDIN won't allow nonblocking.
- julian at precisium dot com dot au#34972 [Com]: STDIN won't allow nonblocking.
- jani@php.net#34972 [Opn->Fbk]: STDIN won't allow nonblocking.
- VJTD3 at VJTD3 dot com#34972 [Fbk->Opn]: STDIN won't allow nonblocking.
- jani@php.net#34972 [Opn]: STDIN won't allow nonblocking.
- jani@php.net#34972 [Opn->Asn]: STDIN won't allow nonblocking.
- VJTD3 at VJTD3 dot com#34972 [Asn]: STDIN won't allow nonblocking.
- jani@php.net#34972 [Asn->Fbk]: STDIN won't allow nonblocking.
- VJTD3 at VJTD3 dot com#34972 [Fbk->Opn]: STDIN won't allow nonblocking.
- jani@php.net#34972 [Opn->Asn]: STDIN won't allow nonblocking.
- frase at cs dot wisc dot edu#34972 [Com]: STDIN won't allow nonblocking.
- xektrum at gmail dot com#34972 [Com]: STDIN won't allow nonblocking.
- raskin at aoeu dot ru#34972 [Com]: STDIN won't allow nonblocking.
- joseph at none-yo-business dot com#34972 [Com]: STDIN won't allow nonblocking.
- me at ben-xo dot comBug #34972 [Com]: STDIN won't allow nonblocking.
- axellc dot perso at gmail dot comBug #34972 [Com]: STDIN won't allow nonblocking.
- lgynove at 163 dot comBug #34972 [Com]: STDIN won't allow nonblocking.
- support at aculane dot comBug #34972 [Com]: STDIN won't allow nonblocking.
- pajoye@php.netBug #34972 [Asn]: STDIN won't allow nonblocking.
- dewi at dewimorgan dot comBug #34972 [Com]: STDIN won't allow nonblocking.
- hans+php at hansdude dot comBug #34972 [Com]: STDIN won't allow nonblocking.
- jchan at icebrg dot usBug #34972 [Com]: STDIN won't allow nonblocking.
- Dygear at gmail dot comBug #34972 [Com]: STDIN won't allow nonblocking.
- jwbecher at gmail dot comBug #34972 [Com]: STDIN won't allow nonblocking.
- jan dot bouvrie at gmail dot comBug #34972 [Com]: STDIN won't allow nonblocking.
- jan dot bouvrie at gmail dot comBug #34972 [Com]: STDIN won't allow nonblocking.
- stahlstift at gmail dot comBug #34972 [Com]: STDIN won't allow nonblocking.
- procman at interia dot plBug #34972 [Com]: STDIN won't allow nonblocking.
- kalle@php.netBug #34972 [Asn->Opn]: STDIN won't allow nonblocking.
- lstubbs at techno dot expressBug #34972 [Com]: STDIN won't allow nonblocking.
- cmb@php.netBug #34972 [Opn]: STDIN should allow nonblocking
- dutra dot astro at gmail dot comReq #34972 [Com]: STDIN should allow nonblocking
- hani at gmail dot comReq #34972 [Com]: STDIN should allow nonblocking