Just to confirm, this is still present as of php5-cli 5.3.3-1ubuntu3

I've taken a good long look at this, and I am 99.9% sure that this is a
problem with libedit..

#include <stdio.h>
#include <histedit.h>

int main(int argc, char *argv[])
{
    using_history();
    printf("Some interesting info\n");
    return 0;
}

This program, compiled with 'gcc test.c -ledit -o test'

Will produce the exact same effect when piped to less.

using_history() is called in the init function of the readline extension
at line 168 of ext/readline/readline.c

The reason this didn't break in the standard PHP build is most likely
that libedit wasn't used, as readline is an optional module.

I reported it here:

https://sourceforge.net/tracker/?func=detail&aid=3044367&group_id=18314&atid=118314

But that tracker appears to be dead. Also sent report to the Debian
Maintainer, and will mark it as also affecting libedit. I tested it with
the GNU readline library's using_history(), and that did not exhibit the
same problem.

One possible workaround is to build readline as an extension, and not
load it by default. I suspect though that any packages that have php
scripts that need/want readline would be fairly broken then. Another
method is to have the readline extension make sure it lets go of the
terminal if libedit is used.

** Bug watch added: SourceForge.net Tracker #3044367
   http://sourceforge.net/support/tracker.php?aid=3044367

** Also affects: libedit (Ubuntu)
   Importance: Undecided
       Status: New

** Changed in: libedit (Ubuntu)
       Status: New => Triaged

** Summary changed:

- php incorrectly opens stdin
+ php (via libedit update_history()) incorrectly opens stdin

-- 
php (via libedit update_history()) incorrectly opens stdin
https://bugs.launchpad.net/bugs/322214
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to php5 in ubuntu.

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to