|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73410 ssh2_exec segmentation fault
Submitted: 2016-10-28 10:00 UTC Modified: 2017-03-02 20:19 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: ilia dot gorchakov at gmail dot com Assigned: langemeijer (profile)
Status: Closed Package: ssh2 (PECL)
PHP Version: 7.0.12 OS: Ubuntu 16.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ilia dot gorchakov at gmail dot com
New email:
PHP Version: OS:


 [2016-10-28 10:00 UTC] ilia dot gorchakov at gmail dot com
I tried it with:
1) libssh2-1.5.0 - libssh2-1.8.0 
2) pecl-networking-ssh2-master (ver 1.0)

Test script:

$host = '***HOST***';
$port = '***PORT***';
$username = '***USERNAME***';
$password = '***PASS***';

$conn_id = ssh2_connect($host, $port);
if (!ssh2_auth_password($conn_id, $username, $password)) {
    echo "Invalid auth\n";
echo "auth OK\n";

$stream = ssh2_exec($conn_id, "uname -a" . PHP_EOL);
if (!is_resource($stream)) {
    echo 'Invalid command'."\n";
echo "exec OK\n";
stream_set_blocking($stream, true);
$response = stream_get_contents($stream);
echo "response OK\n";

Expected result:
auth OK
exec OK
response OK

Actual result:
auth OK
exec OK
Segmentation fault (core dumped)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-14 06:07 UTC]
-Assigned To: +Assigned To: seander
 [2017-02-06 07:16 UTC] mhagstrand at gmail dot com
This bug is fixed by the PR I put in for bug
 [2017-02-06 19:45 UTC]
PR #24 is merged into master.

Could you try current master and see if the problem is solved?
 [2017-02-06 19:58 UTC]
-Assigned To: seander +Assigned To: langemeijer
 [2017-02-11 22:05 UTC] mhagstrand at gmail dot com
This bug is fixed in master. I added a test that confirms it now working:
 [2017-03-02 20:19 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Nov 30 10:01:27 2023 UTC