|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
46 - 12 = ?
Subscribe to this entry?

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

Reproduce code:
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");
        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/
(gdb) bt
#0  0x00007ffff4096f73 in exp_printify () from /usr/lib/
#1  0x00007ffff4095e36 in ?? () from /usr/lib/
#2  0x00007ffff40961df in exp_expectv () from /usr/lib/
#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/
#10 0x000000000042c639 in _start ()


Add a Patch

Pull Requests

Add a Pull Request


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

I copied an older version of (from Ubuntu 8.04 LTS) renamed it to
I also copied libexpect's tcl dependency of 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 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

In case this was a 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-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 07:01:31 2024 UTC