Thread: BUG #5846: Segfault Postgresql Built with --lib-libedit-preferred

BUG #5846: Segfault Postgresql Built with --lib-libedit-preferred

From
"David E. Wheeler"
Date:
The following bug has been logged online:

Bug reference:      5846
Logged by:          David E. Wheeler
Email address:      david@kineticode.com
PostgreSQL version: 9.0.1
Operating system:   Mac OS X 10.6.6
Description:        Segfault Postgresql Built with --lib-libedit-preferred
Details:

Been meaning to report this for a while.

* Build PostgreSQL on Mac OS X using --with-libedit-preferred.
* Connect to the server from psql
* type "\d feat<tab>", where "<tab>" is the tab key, an attempt to
autocomplete
 * Output for me:

try=# \d mls_fepsql(69838) malloc: *** error for object 0x6: pointer being
freed was not allocated
*** set a breakpoint in malloc_error_break to debug
zsh: abort      psql corp_schema

YOW! I *assume* it's something funky with libedit, but in case you can't
reproduce it with just the libedit option, I configure my server with:

    ./configure --with-libedit-preferred --with-bonjour --with-perl
PERL=$PERL \
    --with-openssl --with-pam --with-krb5 --with-libxml --with-ldap \
    --with-ossp-uuid --with-includes=/usr/local/include \
    --enable-integer-datetimes --with-zlib \
    --with-libs=/usr/local/lib

Best,

David

Re: BUG #5846: Segfault Postgresql Built with --lib-libedit-preferred

From
Tom Lane
Date:
"David E. Wheeler" <david@kineticode.com> writes:
> try=# \d mls_fepsql(69838) malloc: *** error for object 0x6: pointer being
> freed was not allocated
> *** set a breakpoint in malloc_error_break to debug
> zsh: abort      psql corp_schema

This has been reported before, most recently last week.  It's a libedit
bug (and yes it's been reported to Apple, but another complaint directed
there wouldn't hurt).

            regards, tom lane

Re: BUG #5846: Segfault Postgresql Built with --lib-libedit-preferred

From
"David E. Wheeler"
Date:
On Jan 24, 2011, at 3:49 PM, Tom Lane wrote:

> This has been reported before, most recently last week.  It's a libedit
> bug (and yes it's been reported to Apple, but another complaint directed
> there wouldn't hurt).

Oh. I've probably complained to them myself. First noticed it quite some ti=
me ago. Anyone got a test case that doesn't involve building PostgreSQL?

Thanks,

David

Re: BUG #5846: Segfault Postgresql Built with --lib-libedit-preferred

From
Tom Lane
Date:
"David E. Wheeler" <david@kineticode.com> writes:
> Oh. I've probably complained to them myself. First noticed it quite some time ago. Anyone got a test case that
doesn'tinvolve building PostgreSQL? 

Per the prior discussion, all you need is an example where there are
exactly 9 + 10*N (N>=0) possible completions.  I haven't tried, but if
their shell uses libedit you could probably provoke a coredump with a
command-line TAB in a suitably-set-up directory, no test case code at all.

            regards, tom lane