Simple test script, raising the segfault: #include <editline/readline.h> int main (int argc, char *argv[]) { clear_history(); return 0; } Of course using_history() should be called first. On PHP side, calling using_history during module init is not perfect as it raise some issue: https://bugs.php.net/65714 Studying libedit code, each *_history function start with a check (eq to using_history function) if (h == NULL || e == NULL) rl_initialize(); The clear_history is the only function where this check is missing. Of course, this have be workaround in php, https://bugs.php.net/66412 I think it will be more secure to add this check.
Thanks! I have forwarded your proposal to libedit upstream as a patch.
fixed in libedit-3.1-4.20130712cvs.fc21