Running a program in the background ($ ./a.out & at
the shell) does not work when libedit is used (the
program goes into suspended state, and cannot be awoken
by kill -CONT). When the same program is compiled with
libreadline this does not happen. I'm using libedit
2.9.cvs.20040827-1 and Linux kernel 2.4.26. I found the
problem by using PHP 4.9, but it can be reproduced
using this test program:
#include <readline/readline.h>
int main(){
using_history();
}
$ gcc test.c -lreadline
$ ./a.out &
# program exists immediately
$ gcc test.c -ledit
$ ./a.out &
# a.out is suspended, attaching gdb to a.out gives this:
(gdb) bt
#0 0x4010a70e in tcsetattr () from /lib/libc.so.6
#1 0x4002d31a in el_gets () from /usr/lib/libedit.so.2
#2 0x4002d454 in el_gets () from /usr/lib/libedit.so.2
#3 0x40024d39 in el_init () from /usr/lib/libedit.so.2
#4 0x400313c0 in rl_initialize () from
/usr/lib/libedit.so.2
#5 0x400318a4 in using_history () from
/usr/lib/libedit.so.2
#6 0x08048499 in main ()
Logged In: YES
user_id=663176
Originator: NO
The bug appears to have been fixed.
It has been reported as fixed in Debian (at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=286356\) and I could not reproduce the failure mentioned above with 2.9.cvs.20050518-3.
Logged In: YES
user_id=948989
Originator: NO
As stated in the Debian bug report, this bug is still present.
I can reproduce the behaviour with the above mentioned test program.
I've been able to reproduce the bug with 2.11~20080614 and 2.9.cvs.20050518-4