#50243 [NEW]: Second attempt after successful file_put_contents to FTP causes crash
| From: | pontus dot alexander at gmail dot com | Date: | Fri, 20 Nov 2009 14:32:27 +0000 |
| Subject: | #50243 [NEW]: Second attempt after successful file_put_contents to FTP causes crash | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-144862@lists.php.net to get a copy of this message | ||
From: pontus dot alexander at gmail dot com
Operating system: Debian
PHP version: 5.3SVN-2009-11-20 (snap)
PHP Bug Type: Reproducible crash
Bug description: Second attempt after successful file_put_contents to FTP causes crash
Description:
------------
After one successful write to FTP via file_put_contents (or fopen, fwrite,
fclose) the next attempt causes PHP to die with message "Segmentation
fault".
Reproduce code:
---------------
<?
$location = "ftp://foo:bar@domain.com/";
$unique = uniqid();
$items = array(
'foo',
'bar'
);
$i = 0;
foreach($items as $content) {
$filename = $location . sprintf("File_%s_%03u.txt", $unique, $i++);
file_put_contents($filename, $content); // Crash on _second_ successful
iteration
}
Expected result:
----------------
Two files placed on FTP-server successfully containing foo and bar
respectively.
Actual result:
--------------
First file writes fine. At second iteration file_put_contents causes PHP
to die.
--
Edit bug report at http://bugs.php.net/?id=50243&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50243&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50243&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50243&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=50243&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50243&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=50243&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=50243&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=50243&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=50243&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=50243&r=support
Expected behavior: http://bugs.php.net/fix.php?id=50243&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=50243&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=50243&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=50243&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50243&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50243&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=50243&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=50243&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=50243&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=50243&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=50243&r=mysqlcfg