From:             
Operating system: NetBSD
PHP version:      5.3.6
Package:          Streams related
Bug Type:         Feature/Change Request
Bug description:stream_get_contents infinite loop

Description:
------------
#0  0xbb80eb77 in read () from /usr/lib/libc.so.12

#1  0xbb8e0efd in read () from /usr/lib/libpthread.so.0

#2  0x083e7e81 in _php_stream_fopen_from_pipe ()

#3  0x083dff2f in _php_stream_free ()

#4  0x083e00ec in _php_stream_read ()

#5  0x083e1684 in _php_stream_copy_to_mem ()





php_stream_copy_to_mem() generate infinite loop



Test script:
---------------
<?php

$stream=fopen("/tmp/blabla", "w"); // w or a

stream_get_contents($stream,1,1);

?>

Expected result:
----------------
string or null

Actual result:
--------------
infinite loop

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

Reply via email to