php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59330 Segmentation Fault on use
Submitted: 2010-07-30 09:19 UTC Modified: 2011-06-23 10:18 UTC
From: simon at liddicott dot com Assigned:
Status: Closed Package: expect (PECL)
PHP Version: 5.3.2 OS: Ubuntu 10.04 (Lucid Lynx)
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:
Package:
Bug Type:
Summary:
From: simon at liddicott dot com
New email:
PHP Version: OS:

 

 [2010-07-30 09:19 UTC] simon at liddicott dot com
Description:
------------
When running either my own script or the sample script from php.net php crashes with a segmentation fault.

Reproduce code:
---------------
<?php
ini_set("expect.loguser", "Off");

$stream = fopen("expect://ssh root@remotehost uptime", "r");

$cases = array (
    array (0 => "password:", 1 => PASSWORD)
);

switch (expect_expectl ($stream, $cases)) {
    case PASSWORD:
        fwrite ($stream, "password\n");
        break;
 
    default:
        die ("Error was occurred while connecting to the remote host!\n");
}

while ($line = fgets($stream)) {
      print $line;
}
fclose ($stream);
?>


Actual result:
--------------
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff4096f73 in exp_printify () from /usr/lib/libexpect.so.5.44.1.14
(gdb) bt
#0  0x00007ffff4096f73 in exp_printify () from /usr/lib/libexpect.so.5.44.1.14
#1  0x00007ffff4095e36 in ?? () from /usr/lib/libexpect.so.5.44.1.14
#2  0x00007ffff40961df in exp_expectv () from /usr/lib/libexpect.so.5.44.1.14
#3  0x00007ffff42abe1e in zif_expect_expectl (ht=<value optimised out>, return_value=0xf91020, return_value_ptr=<value optimised out>, 
    this_ptr=<value optimised out>, return_value_used=<value optimised out>) at /build/buildd/php5-5.3.2/pear-build-download/expect-0.2.6/expect.c:290
#4  0x00000000006e611a in ?? ()
#5  0x00000000006bd400 in execute ()
#6  0x000000000069512d in zend_execute_scripts ()
#7  0x0000000000640d98 in php_execute_script ()
#8  0x0000000000726236 in ?? ()
#9  0x00007ffff52a7c4d in __libc_start_main () from /lib/libc.so.6
#10 0x000000000042c639 in _start ()

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-09 18:31 UTC] ryan dot honeyman at emerson dot com
I also ran into libexpect.so.5.44.1.14 not functioning properly with the latest pecl/expect.

I copied an older version of libexpect.so.5.43.0 (from Ubuntu 8.04 LTS) renamed it to libexpect.so.5.44.1.14.
I also copied libexpect's tcl dependency of libtcl8.4.so.0 into /usr/lib as well.

This has restored access to my PHP scripts that utilize expect commands, though it's strictly a workaround at this point.
 [2010-08-16 02:59 UTC] spektom at gmail dot com
Looks like a bug in Ubuntu's libexpect. I've compiled Expect 5.44.1.14 from the original sources, and this bug doesn't happen. I'll investigate it more.
 [2011-02-23 07:36 UTC] cduncan at regatta dot com
I'm still seeing this problem after trying both of the above workarounds.

PHP 5.3.5
PECL Expect 0.2.9
 [2011-03-19 16:14 UTC] expectbug at secureobscure dot com
I am also having this problem. I have tried different versions of expect and php5.
 [2011-06-23 10:18 UTC] spektom at gmail dot com
This bug has been fixed in SVN.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.


 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Jul 21 16:01:25 2019 UTC