Bug #69981 [Com]: Segmentation Fault with streams over SSH2
| From: | info at josephcrawford dot com | Date: | Thu, 02 Jul 2015 18:49:06 +0000 |
| Subject: | Bug #69981 [Com]: Segmentation Fault with streams over SSH2 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-194077@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69981&edit=1
ID: 69981
Comment by: info at josephcrawford dot com
Reported by: info at josephcrawford dot com
Summary: Segmentation Fault with streams over SSH2
Status: Open
Type: Bug
Package: Streams related
Operating System: Mac OSX 10.10
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
I should also note that everything else is working properly. I can connect, upload, download files
without any issues. It is solely when I tried to list the directory contents that the segmentation
fault is thrown.
Previous Comments:
------------------------------------------------------------------------
[2015-07-02 18:45:21] info at josephcrawford dot com
Description:
------------
I am using the following library
https://github.com/ideaconnect/idct-sftp-client
When I try to get a directory listing of files from an SFTP connection I am getting the following
error.
Segmentation fault: 11
I am using PHP 5.6.9 that was installed via Homebrew. However I also tried using the PHP version
that shipped with Zend Server (uninstalled after testing) which I believe was 5.6.x and I was
getting the same results.
Test script:
---------------
<?php
use \IDCT\Networking\Ssh\SftpClient;
$sftp = new SftpClient();
$credentials = Credentials::withPassword('username', 'password');
$sftp->setCredentials($credentials);
$sftp->connect('hostname.goes.here', 22);
$remote_files = $sftp->getFileList('your_path_here/');
Expected result:
----------------
I expect an array of filenames that reside on the server path that I specify in the getFileList
method.
Actual result:
--------------
Segmentation Fault: 11
This is the line that causes the actual segmentation fault which I verified with var_dump before the
loop, inside the loop and after the loop. The only place the var_dump worked was before the loop.
https://github.com/ideaconnect/idct-sftp-client/blob/master/src/SftpClient.php#L521
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69981&edit=1