ID:               47949
 User updated by:  rannou dot sebastien at gmail dot com
 Reported By:      rannou dot sebastien at gmail dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         Readline related
 Operating System: GNU/Linux
 PHP Version:      5.2.9
 New Comment:

Sorry for my mistake, I thought it was with php-5.2.9, but it seems
only to happen on 5.2.4.

$ php -v
PHP 5.2.4-2ubuntu5.5 with Suhosin-Patch 0.9.6.2 (cli) (built: Feb 11
2009 20:09:52)

Here's the gdb trace:

Core was generated by `php segfault.php'.
Program terminated with signal 11, Segmentation fault.
[New process 18508]
#0  0xb7f5214a in ?? () from /usr/lib/libedit.so.2
#1  0xb79e3cca in ?? () from /lib/tls/i686/cmov/libc.so.6
#2  0xb79e46b7 in qsort () from /lib/tls/i686/cmov/libc.so.6
#3  0xb7f51c3f in fn_display_match_list () from /usr/lib/libedit.so.2
#4  0xb7f5201b in fn_complete () from /usr/lib/libedit.so.2
#5  0xb7f577ce in rl_complete () from /usr/lib/libedit.so.2
#6  0xb7f577f9 in ?? () from /usr/lib/libedit.so.2
#7  0xb7f4cd36 in el_gets () from /usr/lib/libedit.so.2
#8  0xb7f58dc5 in readline () from /usr/lib/libedit.so.2
#9  0x08353d57 in zif_readline ()
#10 0x082f4c0b in ?? ()
#11 0x082e5648 in execute ()
#12 0x082c4443 in zend_execute_scripts ()
#13 0x0827a2b0 in php_execute_script ()
#14 0x08356a0a in main ()
(gdb)

I've very sorry once again. I re-open the ticket in case it interests
you.

Thanks for your attention :-)


Previous Comments:
------------------------------------------------------------------------

[2009-04-11 17:14:30] fel...@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

I can't reproduce it using libreadline 5.2-4.

------------------------------------------------------------------------

[2009-04-11 12:14:45] rannou dot sebastien at gmail dot com

Description:
------------
If the registered function from readline_completion_function returns an
empty array, a segmentation fault happens when trying to tab.

Reproduce code:
---------------
<?php

// script.php

function  foo()
{
    return array();
}

readline_completion_function('foo');

while (42)
   echo readline('> ');

?>

Expected result:
----------------
Doing nothing or printing a new prompt.

Actual result:
--------------
$> php script.php
> 
Segmentation fault
$>


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=47949&edit=1

Reply via email to