#50243 [Opn->Fbk]: Second attempt after successful file_put_contents to FTP causes crash

From: Date: Fri, 20 Nov 2009 17:22:12 +0000
Subject: #50243 [Opn->Fbk]: Second attempt after successful file_put_contents to FTP causes crash
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-144871@lists.php.net to get a copy of this message
ID: 50243 Updated by: pierrick@php.net Reported By: pontus dot alexander at gmail dot com -Status: Open +Status: Feedback Bug Type: Reproducible crash Operating System: Debian PHP Version: 5.3SVN-2009-11-20 (snap) Assigned To: pierrick New Comment: Please try using this snapshot: http://snaps.php.net/php5.3-latest.tar.gz For Windows: http://windows.php.net/snapshots/ Previous Comments: ------------------------------------------------------------------------ [2009-11-20 14:32:27] pontus dot alexander at gmail dot com 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 this bug report at http://bugs.php.net/?id=50243&edit=1

« previous php.bugs (#144871) next »