Bug #66412 [Opn->Asn]: readline_clear_history() with libedit causes segfault after #65714
| From: | felipe@php.net | Date: | Sun, 19 Jan 2014 14:49:48 +0000 |
| Subject: | Bug #66412 [Opn->Asn]: readline_clear_history() with libedit causes segfault after #65714 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-183900@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66412&edit=1
ID: 66412
Updated by: felipe@php.net
Reported by: php at 0x7f dot us
Summary: readline_clear_history() with libedit causes
segfault after #65714
-Status: Open
+Status: Assigned
Type: Bug
Package: Readline related
Operating System: OS X 10.9.1
PHP Version: 5.5.7
-Assigned To:
+Assigned To: remi
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2014-01-04 19:27:32] php at 0x7f dot us
Description:
------------
Since PHP 5.5.7, calling
readline_clear_history() segfaults.
PHP 5.5.7 (installed via Homebrew)
OS X 10.9
And whatever libedit version ships with OS X 10.9 (Mavericks). From the readline.h file:
/* $NetBSD: readline.h,v 1.33 2012/05/15 17:30:04 christos Exp $ */
Note that this is over 11 years newer than the header comment in the SourceForge project linked from
the readline ext readme (http://sourceforge.net/projects/libedit/)
/* $NetBSD: readline.h,v 1.1 2001/01/05 21:15:50 jdolecek Exp $ */
This version of libedit seems to actually be maintained, I imagine it is more like what is available
on OS X:
http://www.thrysoee.dk/editline
Reverting b8d88bf (a fix for #65714) fixes the segfault.
Configure command: ./configure --prefix=/usr/local/Cellar/php55/5.5.7 --localstatedir=/usr/local/var
--sysconfdir=/usr/local/etc/php/5.5 --with-config-file-path=/usr/local/etc/php/5.5
--with-config-file-scan-dir=/usr/local/etc/php/5.5/conf.d --with-iconv-dir=/usr --enable-dba
--with-ndbm=/usr --enable-exif --enable-soap --enable-wddx --enable-ftp --enable-sockets
--enable-zip --enable-shmop --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-mbstring
--enable-mbregex --enable-bcmath --enable-calendar --with-zlib=/usr/local/opt/zlib --with-ldap
--with-ldap-sasl=/usr --with-xmlrpc --with-kerberos=/usr --with-gd --enable-gd-native-ttf
--with-freetype-dir=/usr/local/opt/freetype --with-jpeg-dir=/usr/local/opt/jpeg
--with-png-dir=/usr/local/opt/libpng --with-gettext=/usr/local/opt/gettext --with-snmp=/usr
--with-libedit --with-unixODBC=/usr/local/opt/unixodbc
--with-pdo-odbc=unixODBC,/usr/local/opt/unixodbc --mandir=/usr/local/Cellar/php55/5.5.7/share/man
--with-mhash --w!
ith-curl --with-bz2=/usr --disable-debug --with-openssl=/usr --with-xsl=/usr
--with-apxs2=/usr/sbin/apxs --libexecdir=/usr/local/Cellar/php55/5.5.7/libexec
--with-mysql-sock=/tmp/mysql.sock --with-mysqli=mysqlnd --with-mysql=mysqlnd
--with-pdo-mysql=mysqlnd --enable-pcntl --enable-zend-signals --enable-dtrace --enable-opcache
Test script:
---------------
<?php readline_clear_history();
Expected result:
----------------
Expected nothing to happen.
Actual result:
--------------
'php test.php ' terminated by signal SIGSEGV (Address boundary error)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66412&edit=1