#23683 [Opn->Asn]: ftp_close($connection) crashes
| From: | moriyoshi@php.net | Date: | Mon, 19 May 2003 13:16:06 +0000 |
| Subject: | #23683 [Opn->Asn]: ftp_close($connection) crashes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-39950@lists.php.net to get a copy of this message | ||
ID: 23683
Updated by: moriyoshi@php.net
Reported By: pekka at studio-on-the dot net
-Status: Open
+Status: Assigned
Bug Type: FTP related
Operating System: Windows XP Profesional SP1
PHP Version: 4.3.2RC3
-Assigned To:
+Assigned To: moriyoshi
New Comment:
ftp_pwd() problem.
Previous Comments:
------------------------------------------------------------------------
[2003-05-18 16:30:45] pekka at studio-on-the dot net
It gives BEFORE and AFTER "ftp_close($connection);"
resource(2) of type (FTP Buffer)
I used code:
$ftp_server = "127.0.0.1";
$ftp_user_name = "pekka";
$ftp_user_pass = "mypass";
$ftp_folder = "/gallery/D30_photos/small";
$file_to_upload = "CRW_7145_00001.jpg";
$temppath = "./" . $file_to_upload;
$ftp_server = gethostbyname($ftp_server);
$connection = ftp_connect($ftp_server);
ftp_set_option($connection, FTP_TIMEOUT_SEC, 5);
ftp_login($connection, $ftp_user_name, $ftp_user_pass);
ftp_systype($connection);
ftp_pasv($connection,TRUE);
ftp_mkdir($connection,$ftp_folder);
ftp_chdir($connection, $ftp_folder);
ftp_pwd($connection);
ftp_size($connection,urldecode($file_to_upload));
ftp_mdtm($connection,urldecode($file_to_upload));
ftp_put($connection,$file_to_upload,$temppath,FTP_BINARY);
var_dump($connection);
ftp_close($connection);
FTP server "Serv-U" reports:
--------------------
[6] Mon 19May03 00:28:11 - (000039) 220 Serv-U FTP Server v4.0 for
WinSock ready...
[2] Mon 19May03 00:28:11 - (000039) USER pekka
[6] Mon 19May03 00:28:11 - (000039) 331 User name okay, need password.
[2] Mon 19May03 00:28:11 - (000039) PASS xxxxx
[6] Mon 19May03 00:28:11 - (000039) 230 User logged in, proceed.
[2] Mon 19May03 00:28:11 - (000039) SYST
[6] Mon 19May03 00:28:11 - (000039) 215 UNIX Type: L8
[2] Mon 19May03 00:28:11 - (000039) PASV
[6] Mon 19May03 00:28:11 - (000039) 227 Entering Passive Mode
(127,0,0,1,12,117)
[2] Mon 19May03 00:28:11 - (000039) MKD /gallery/D30_photos/small
[6] Mon 19May03 00:28:11 - (000039) 550 /gallery/D30_photos/small:
failed to create.
[2] Mon 19May03 00:28:11 - (000039) CWD /gallery/D30_photos/small
[6] Mon 19May03 00:28:11 - (000039) 250 Directory changed to
/gallery/D30_photos/small
[2] Mon 19May03 00:28:11 - (000039) PWD
[6] Mon 19May03 00:28:11 - (000039) 257 "/gallery/D30_photos/small" is
current directory.
[2] Mon 19May03 00:28:11 - (000039) TYPE I
[6] Mon 19May03 00:28:11 - (000039) 200 Type set to I.
[2] Mon 19May03 00:28:11 - (000039) SIZE CRW_7145_00001.jpg
[6] Mon 19May03 00:28:11 - (000039) 213 45644
[2] Mon 19May03 00:28:11 - (000039) MDTM CRW_7145_00001.jpg
[6] Mon 19May03 00:28:11 - (000039) 213 20030519002750
[5] Mon 19May03 00:28:11 - (000039) IP-Name: LOCALHOST
[2] Mon 19May03 00:28:11 - (000039) STOR CRW_7145_00001.jpg
[4] Mon 19May03 00:28:11 - (000039) Receiving file f:\program
files\apache
group\apache\htdocs\photography-on-the.net\gallery\d30_photos\small\crw_7145_00001.jpg
[6] Mon 19May03 00:28:11 - (000039) 150 Opening BINARY mode data
connection for CRW_7145_00001.jpg.
[4] Mon 19May03 00:28:11 - (000039) Received file f:\program
files\apache
group\apache\htdocs\photography-on-the.net\gallery\d30_photos\small\crw_7145_00001.jpg
successfully (4953 Kb/sec - 45644 bytes)
[6] Mon 19May03 00:28:11 - (000039) 226 Transfer complete.
[2] Mon 19May03 00:28:11 - (000039) QUIT
[6] Mon 19May03 00:28:11 - (000039) 221 Goodbye!
--------------------
And the crash was now:
Faulting application Apache.exe, version 0.0.0.0, faulting module
ntdll.dll, version 5.1.2600.1106, fault address 0x00001d24.
------------------------------------------------------------------------
[2003-05-18 15:00:06] iliaa@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PHP.
Could you provide the smallest possible php script that could be used
to replicate the crash & the output of var_dump($ftp_handle) just
before you do ftp_close() on it.
------------------------------------------------------------------------
[2003-05-18 14:43:32] pekka at studio-on-the dot net
Oh, and Apache is 1.3.27.
------------------------------------------------------------------------
[2003-05-18 14:42:04] pekka at studio-on-the dot net
I have an ftp upload script (non public code), which ends in plain
ftp_close($connection);
Where $connection is opened handle. After installing RC3 (as module) I
a crash:
Event viewer: "Faulting application Apache.exe, version 0.0.0.0,
faulting module php4ts.dll, version 4.3.2.2, fault address
0x000b9fc4."
or
"Faulting application Apache.exe, version 0.0.0.0, faulting module
ntdll.dll, version 5.1.2600.1106, fault address 0x00002109."
FTP is disconneted by the function before crash (ftp logs show session
was perfect and complete). I have tried it with local ftp server and
remote ones. I tried also with
ftp_close();
and got no crash (and of course no disconnect either)
If I used
ftp_close($fdfdf);
where $fdfdf is NOT an opened ftp handle, Apache just hangs page load
after output code before ftp_close BUT without a crash.
If I comment line
/*
ftp_close($connection);
*/
the whole script runs ok, except ftp remains open of course.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23683&edit=1