|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-06-29 15:09 UTC] grossolini@php.net
Description:
------------
When executing scripts, they work but the script ends with a "Segmentation fault".
This happens with php-7.1.6 as well as php-7.0.20, both using the ssh2-1.1.1.tgz release from pecl.php.net.
This does not happen when using php-5.6 with ssh2-0.13.tgz.
Test script:
---------------
<?php
$cfg_host = '';
$cfg_user = '';
$cfg_passwd = '';
$remote_folder = '';
$ssh_session = ssh2_connect($cfg_host);
if($ssh_session === FALSE) {
exit(1);
}
elseif(!ssh2_auth_password($ssh_session, $cfg_user, $cfg_passwd)) {
exit(1);
}
else {
// ok
}
$sftp = ssh2_sftp($ssh_session);
if(ssh2_sftp_stat($sftp, $remote_folder) === FALSE) {
// creating the folder is not in the scope of this script
exit(0);
}
$remote_path = sprintf('ssh2.sftp://%s/%s', $sftp, ltrim($remote_folder, '/'));
$folder = opendir($remote_path);
return; // segmentation fault
Expected result:
----------------
not a segfault
Actual result:
--------------
"Segmentation fault" is written to STDERR when the script ends. You can do a bunch of work after calling opendir() without any problems, though.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 13:00:01 2025 UTC |
I can only reproduce a segfault, if I call ssh2_disconnect($ssh_session); If I call `closedir($folder)` before, I get another segfault, but that one has already been reported as bug #79631.