Thread: BUG #3773: psql segfault on exit

BUG #3773: psql segfault on exit

From
"guillaume 'ioguix' de Rorthais"
Date:
The following bug has been logged online:

Bug reference:      3773
Logged by:          guillaume 'ioguix' de Rorthais
Email address:      ioguix@free.fr
PostgreSQL version: 8.3 beta3
Operating system:   macosx 10.4.10
Description:        psql segfault on exit
Details:

I just maked/make installed pg8.3b3 from cvs.

Here is a copy of the segfault with the psql and backend versions :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~)-(Thu 22/Nov/07 18:30)
(ioguixigx@igix:p3:%)- /sw/opt/pg83//bin/psql --version
psql (PostgreSQL) 8.3beta3
contains support for command-line editing

(~)-(Thu 22/Nov/07 18:30)
(ioguixigx@igix:p3:%)- /sw/opt/pg83//bin/psql -U postgres -p 5433 pagila
Password for user postgres:
Welcome to psql 8.3beta3, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

pagila=# select version();
                                                                  version

----------------------------------------------------------------------------
----------------------------------------------------------------
 PostgreSQL 8.3beta3 on i386-apple-darwin8.10.1, compiled by GCC
i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)
(1 row)

pagila=# \q
psql(26486) malloc: *** error for object 0x1806200: incorrect checksum for
freed object - object was probably modified after being freed, break at
szone_error to debug
psql(26486) malloc: *** set a breakpoint in szone_error to debug
zsh: segmentation fault  /sw/opt/pg83//bin/psql -U postgres -p 5433 pagila
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I don't know which other information I could add. Feel free to ask me for
some test/info.

Re: BUG #3773: psql segfault on exit

From
Heikki Linnakangas
Date:
guillaume 'ioguix' de Rorthais wrote:
> PostgreSQL version: 8.3 beta3
> Operating system:   macosx 10.4.10
> Description:        psql segfault on exit
> Details:
>
> I just maked/make installed pg8.3b3 from cvs.
>

> pagila=# \q
> psql(26486) malloc: *** error for object 0x1806200: incorrect checksum for
> freed object - object was probably modified after being freed, break at
> szone_error to debug
> psql(26486) malloc: *** set a breakpoint in szone_error to debug
> zsh: segmentation fault  /sw/opt/pg83//bin/psql -U postgres -p 5433 pagila
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I bet this is the same libedit bug that's been reported by various
people, on OS X. For example:
http://archives.postgresql.org/pgsql-bugs/2007-11/msg00128.php

Since quite a few people seem to bump into this, I wonder if we could
have configure to test for this?

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

Re: BUG #3773: psql segfault on exit

From
Tom Lane
Date:
"guillaume 'ioguix' de Rorthais" <ioguix@free.fr> writes:
> Operating system:   macosx 10.4.10
> Description:        psql segfault on exit

If you have any lines longer than 255 bytes in your ~/.psql_history,
this is a known bug in Apple's libedit.  (They seem to have fixed it
in Leopard, btw.)  Recommended workaround is to install libreadline from
source (the version in /usr/lib isn't really readline) and recompile
with that instead.

http://archives.postgresql.org/pgsql-hackers/2006-12/msg01222.php

            regards, tom lane

Re: BUG #3773: psql segfault on exit

From
Tom Lane
Date:
Heikki Linnakangas <heikki@enterprisedb.com> writes:
> Since quite a few people seem to bump into this, I wonder if we could
> have configure to test for this?

Probably not worth the trouble, seeing that Apple has finally fixed
the problem in 10.5 --- not tested by me, but a look at their source code
on-line shows it's fixed:

http://www.opensource.apple.com/darwinsource/10.5/libedit-11/libedit/src/history.c

            regards, tom lane

Re: BUG #3773: psql segfault on exit

From
ioguix
Date:
Tom Lane a écrit :
> "guillaume 'ioguix' de Rorthais" <ioguix@free.fr> writes:
>
>> Operating system:   macosx 10.4.10
>> Description:        psql segfault on exit
>>
>
> If you have any lines longer than 255 bytes in your ~/.psql_history,
> this is a known bug in Apple's libedit.  (They seem to have fixed it
> in Leopard, btw.)  Recommended workaround is to install libreadline from
> source (the version in /usr/lib isn't really readline) and recompile
> with that instead.
>
> http://archives.postgresql.org/pgsql-hackers/2006-12/msg01222.php
>
>             regards, tom lane
>
Ok, thanks guys.