Bug #69981 [NEW]: Segmentation Fault with streams over SSH2

From: Date: Thu, 02 Jul 2015 18:45:22 +0000
Subject: Bug #69981 [NEW]: Segmentation Fault with streams over SSH2
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-194076@lists.php.net to get a copy of this message
From:             info at josephcrawford dot com
Operating system: Mac OSX 10.10
PHP version:      Irrelevant
Package:          Streams related
Bug Type:         Bug
Bug description:Segmentation Fault with streams over SSH2

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 bug report at https://bugs.php.net/bug.php?id=69981&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=69981&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=69981&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=69981&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=69981&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=69981&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=69981&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=69981&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=69981&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=69981&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=69981&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=69981&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=69981&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=69981&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69981&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=69981&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=69981&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=69981&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69981&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=69981&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=69981&r=mysqlcfg



Thread (7 messages)

« previous php.bugs (#194076) next »