Обсуждение: Shift-Enter = Segmentation Fault

Поиск
Список
Период
Сортировка

Shift-Enter = Segmentation Fault

От
Dave Jarvis
Дата:
Hi,

Running RedHat 9.0 on an i686 Athlon CPU, using PostgreSQL v7.3.2.
Compilation:

./configure --prefix=/usr/local --with-java
make
make install

After creating a database (that is password-protected, using an 8
character password; six alpha, two numberic), I do the following:

psql DBName
[password]
[shift-enter pressed]
Segmentation fault

Reproduceable: 100%

ldd /usr/local/bin/postmaster
         libz.so.1 => /usr/lib/libz.so.1 (0x40028000)
         libreadline.so.4 => /usr/lib/libreadline.so.4 (0x40036000)
         libtermcap.so.2 => /lib/libtermcap.so.2 (0x40062000)
         libcrypt.so.1 => /lib/libcrypt.so.1 (0x40066000)
         libresolv.so.2 => /lib/libresolv.so.2 (0x40093000)
         libnsl.so.1 => /lib/libnsl.so.1 (0x400a5000)
         libdl.so.2 => /lib/libdl.so.2 (0x400bb000)
         libm.so.6 => /lib/tls/libm.so.6 (0x400be000)
         libc.so.6 => /lib/tls/libc.so.6 (0x42000000)
         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

ldd /usr/local/bin/psql
         libpq.so.3 => /usr/local/lib/libpq.so.3 (0x40017000)
         libz.so.1 => /usr/lib/libz.so.1 (0x40039000)
         libreadline.so.4 => /usr/lib/libreadline.so.4 (0x40047000)
         libtermcap.so.2 => /lib/libtermcap.so.2 (0x40073000)
         libcrypt.so.1 => /lib/libcrypt.so.1 (0x40077000)
         libresolv.so.2 => /lib/libresolv.so.2 (0x400a4000)
         libnsl.so.1 => /lib/libnsl.so.1 (0x400b7000)
         libdl.so.2 => /lib/libdl.so.2 (0x400cc000)
         libm.so.6 => /lib/tls/libm.so.6 (0x400cf000)
         libc.so.6 => /lib/tls/libc.so.6 (0x42000000)
         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

FYI: The shell (bash) does not have this problem.

Sincerely,
Dave Jarvis

Re: Shift-Enter = Segmentation Fault

От
Tom Lane
Дата:
Dave Jarvis <dave@joot.com> writes:
> psql DBName
> [password]
> [shift-enter pressed]
> Segmentation fault

Could you get us a stack trace from that crash?

    gdb path-to-psql
    gdb> run DBName
    [ do your thing ]
    gdb will report segfault
    gdb> bt
    gdb> quit

If you could recompile with debug symbols first, the backtrace would
be considerably more useful.

            regards, tom lane

Re: Shift-Enter = Segmentation Fault

От
Tom Lane
Дата:
Dave Jarvis <dave@joot.com> writes:
> It looks to be a recursive bug in libreadline, as called by the
> _rl_dispatch_subseq () function.  With debug compiled in, here is a bit
> of the stack trace:

> #0  0x4005275c in _rl_dispatch () from /usr/lib/libreadline.so.4
> #1  0x40052803 in _rl_dispatch_subseq () from /usr/lib/libreadline.so.4
> #2  0x4005277e in _rl_dispatch () from /usr/lib/libreadline.so.4
> #3  0x40052803 in _rl_dispatch_subseq () from /usr/lib/libreadline.so.4
> #4  0x4005277e in _rl_dispatch () from /usr/lib/libreadline.so.4
> #5  0x40052803 in _rl_dispatch_subseq () from /usr/lib/libreadline.so.4
> #6  0x4005277e in _rl_dispatch () from /usr/lib/libreadline.so.4

Hmm.  A quick google search finds a suspiciously similar complaint at

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=200208021107.g72B723d021352%40darkstar.example.net&rnum=2&prev=/groups%3Fq%3D_rl_dispatch_subseq%26hl%3Den%26lr%3D%26ie%3DUTF-8%26selm%3D200208021107.g72B723d021352%2540darkstar.example.net%26rnum%3D2

Dunno if you can try the readline patch suggested there ...

            regards, tom lane

Re: Shift-Enter = Segmentation Fault

От
Tom Lane
Дата:
Actually, digging a little further finds this listed as one of two official
patches to readline 4.3:

ftp://ftp.cwru.edu/pub/bash/readline-4.3-patches/

I'd suggest filing a bug with Red Hat that they are shipping an
unpatched copy of libreadline.

            regards, tom lane