Re: [PATCH] Bug #48256 readline crash
| From: | Jani Taskinen | Date: | Thu, 14 May 2009 13:44:53 +0000 |
| Subject: | Re: [PATCH] Bug #48256 readline crash | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-43925@lists.php.net to get a copy of this message | ||
Tim Starling kirjoitti:
The readline extension links both libreadline and libhistory. This is unnecessary, and inspection of the readline example programs since version 2.0 implies that it has always been unnecessary. Both libraries include history.o, so linking to both gives you two copies of that module.I'd be quite worried about this what you mentioned in that report: "The libraries are loaded in the problematic order in Ubuntu 9.04, previous versions of Ubuntu appeared to work. WHY does newer Ubuntu load some lib before the other? I'd find that out to prevent other similar problems.
The bug occurs when, due to operating system vagaries, libhistory loads before libreadline. This causes PHP's readline_add_history() to add history entries to libhistory's copy of the_history. Then when readline() is called, libreadline attempts to read the other copy of the_history. The result is a null pointer dereference in libreadline's previous_history() function. The solution is to remove all references to libhistory in ext/readline/config.m4. I have patched this in and tested it.Apparently there are other OSes with some problems as well with it. I removed the stuff in CVS now.
This bug was closed as "bogus" on bugs.php.net due to some temporary short-circuit in the mind of a bug tracker admin. It's totally PHP's fault and there's nothing any distro can do to fix it.Heh..I have short temper but definately no short-circuits. Rather "long cabling" maybe. :D --Jani