Thread: PSQL Core Dumps

PSQL Core Dumps

From
"Ian Harding"
Date:
Here is the 'gdb for dummies' output from a psql core file.  This time I did not even change databases during the
session,which I had thought was the root of the problem... 

Thanks for any advice.  I can easily recompile with debugging symbols if you'd like...

This GDB was configured as "i386--netbsd"...(no debugging symbols found)...
Core was generated by `psql'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/libexec/ld.elf_so...(no debugging symbols found)...
done.
Reading symbols from /usr/pkg/lib/libpq.so.2...(no debugging symbols found)...
done.
Reading symbols from /usr/lib/libssl.so.1...(no debugging symbols found)...
done.
Reading symbols from /usr/lib/libcrypto.so.0...(no debugging symbols found)...
done.
Reading symbols from /usr/lib/libz.so.0...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libcrypt.so.0...(no debugging symbols found)...
done.
Reading symbols from /usr/lib/libresolv.so.1...(no debugging symbols found)...
done.
Reading symbols from /usr/lib/libm387.so.0...(no debugging symbols found)...
---Type <return> to continue, or q <return> to quit---
done.
Reading symbols from /usr/lib/libm.so.0...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libutil.so.5...(no debugging symbols found)...
done.
Reading symbols from /usr/lib/libedit.so.2...(no debugging symbols found)...
done.
Reading symbols from /usr/lib/libtermcap.so.0...(no debugging symbols found)...
done.
Reading symbols from /usr/lib/libc.so.12...(no debugging symbols found)...done.
#0  0x48235ba4 in __divdi3 ()
(gdb) bt
#0  0x48235ba4 in __divdi3 ()
#1  0x48235f38 in free ()
#2  0x4822b0f8 in fclose ()
#3  0x481b0a67 in history_end ()
#4  0x481b0e3d in history ()
#5  0x481af258 in write_history ()
#6  0x804e3cf in finishInput ()
#7  0x48227930 in exit ()
#8  0x804a35b in ___start ()
(gdb) quit
bash-2.05$


Ian A. Harding
Programmer/Analyst II
Tacoma-Pierce County Health Department
(253) 798-3549
mailto: iharding@tpchd.org


Re: PSQL Core Dumps

From
Tom Lane
Date:
"Ian Harding" <ianh@tpchd.org> writes:
> (gdb) bt
> #0  0x48235ba4 in __divdi3 ()
> #1  0x48235f38 in free ()
> #2  0x4822b0f8 in fclose ()
> #3  0x481b0a67 in history_end ()
> #4  0x481b0e3d in history ()
> #5  0x481af258 in write_history ()
> #6  0x804e3cf in finishInput ()
> #7  0x48227930 in exit ()
> #8  0x804a35b in ___start ()

Hmm.  Core dump inside libreadline's exit-cleanup routine, evidently.
I bet if you run psql with the -n switch, you don't see any problem?
Of course you won't have any command history either, so this isn't much
of an answer.

We have seen previous reports of weird misbehavior involving
libreadline, though mostly on Solaris IIRC.  I'd suggest making sure you
have the most up-to-date libreadline, and perhaps recompile both that
and psql from source.

            regards, tom lane