[Bug 623902] New: psql crashed in readline
http://bugzilla.novell.com/show_bug.cgi?id=623902 http://bugzilla.novell.com/show_bug.cgi?id=623902#c0 Summary: psql crashed in readline Classification: openSUSE Product: openSUSE 11.3 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: jnelson-suse@jamponi.net QAContact: qa@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.6) Gecko/20100626 SUSE/3.6.6-1.2 Firefox/3.6.6 I was using psql. It crashed (cored). The traceback points to readline: (gdb) bt #0 0x00007f1518c6dce7 in kill () at ../sysdeps/unix/syscall-template.S:82 #1 0x00007f1518fc4715 in _rl_handle_signal (sig=3) at ../signals.c:220 #2 0x00007f1518fc681e in rl_getc (stream=0x7f1518f956a0) at ../input.c:465 #3 0x00007f1518fc6f4c in rl_read_key () at ../input.c:446 #4 0x00007f1518fbe9a6 in _rl_search_getchar (cxt=0x65d060) at ../isearch.c:308 #5 0x00007f1518fbf350 in rl_search_history (direction=<value optimized out>, invoking_key=<value optimized out>) at ../isearch.c:643 #6 0x00007f1518fb2502 in _rl_dispatch_subseq (key=18, map=<value optimized out>, got_subseq=0) at ../readline.c:785 #7 0x00007f1518fb2ae0 in readline_internal_char () at ../readline.c:559 #8 0x00007f1518fb3015 in readline_internal_charloop (prompt=<value optimized out>) at ../readline.c:586 #9 readline_internal (prompt=<value optimized out>) at ../readline.c:600 #10 readline (prompt=<value optimized out>) at ../readline.c:342 #11 0x000000000040b454 in gets_interactive (prompt=<value optimized out>) at input.c:67 #12 0x000000000040de0f in MainLoop (source=0x7f1518f956a0) at mainloop.c:132 #13 0x0000000000410fa7 in main (argc=<value optimized out>, argv=0x7fff00d939e8) at startup.c:285 (gdb) Reproducible: Didn't try Steps to Reproduce: 1. 2. 3. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=623902
http://bugzilla.novell.com/show_bug.cgi?id=623902#c
yang xiaoyu
http://bugzilla.novell.com/show_bug.cgi?id=623902
http://bugzilla.novell.com/show_bug.cgi?id=623902#c1
Reinhard Max
http://bugzilla.novell.com/show_bug.cgi?id=623902
http://bugzilla.novell.com/show_bug.cgi?id=623902#c2
Jon Nelson
http://bugzilla.novell.com/show_bug.cgi?id=623902
http://bugzilla.novell.com/show_bug.cgi?id=623902#c3
Reinhard Max
[1] The only commandline arguments where the name of a local db. No host, users, etc. That shouldn't matter anyway, since it crashed in readline.
The piece of code that crashes isn't necessarily the piece of code that contains the bug. E.g. readline may crash on memory corruption caused by an unrelated command line switch.
[2] It happened after some time. Perhaps an hour.
Can you approximate how many SQL commands you had executed between the process start and the crash?
[3] UNfortunately, I don't recall exactly what they were but they were fairly long (3-10 line) sql queries. They didn't get saved to ~/.psql_history, of course. ;-)
If you still have the core file, you may find the SQL strings in there.
I should also note that postmaster has *crashed* on my machine since upgrading to openSUSE 11.3 (same config files, same database, same everything) at least 5 times in the last 36 hours.
What openSUSE and PostgreSQL versions were you using before?
Eventually, I figured out that it was getting killed by the oom handler,
The oom handler kills the first process that requests memory when no more is available, but that's not necessarily the process that has actually caused the machine to be short on memory.
despite being configured to only use 0.5G (of 4G) of RAM.
There are several options in postgresql.conf that control different aspects of the PosrgreSQL server's memory usage. Which one are you referring to?
I cannot be sure but I *think* the autovacuum handler was what was running at the time.
Well, if the machine is nearly oom already and then autovacuum kicks in requesting some more memory, it might get killed although not being the actual cause for the memory shortage. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=623902
http://bugzilla.novell.com/show_bug.cgi?id=623902#c4
Jon Nelson
(In reply to comment #2)
[1] The only commandline arguments where the name of a local db. No host, users, etc. That shouldn't matter anyway, since it crashed in readline.
The piece of code that crashes isn't necessarily the piece of code that contains the bug. E.g. readline may crash on memory corruption caused by an unrelated command line switch.
That's very true.
[2] It happened after some time. Perhaps an hour.
Can you approximate how many SQL commands you had executed between the process start and the crash?
Dozens but not hundreds.
[3] UNfortunately, I don't recall exactly what they were but they were fairly long (3-10 line) sql queries. They didn't get saved to ~/.psql_history, of course. ;-)
If you still have the core file, you may find the SQL strings in there.
Generally speaking, it was nothing that I don't normally do anyway... so lots and lots of SELECTS (sometimes up to a screen long). Nothing special.
I should also note that postmaster has *crashed* on my machine since upgrading to openSUSE 11.3 (same config files, same database, same everything) at least 5 times in the last 36 hours.
What openSUSE and PostgreSQL versions were you using before?
openSUSE 11.2 and the stock postgresql version that came with it.
Eventually, I figured out that it was getting killed by the oom handler,
The oom handler kills the first process that requests memory when no more is available, but that's not necessarily the process that has actually caused the machine to be short on memory.
I didn't know that! Hmm. Indeed, the oom handler logs suggest that postmaster wasn't using *that* much memory: Jul 20 15:10:32 worklaptop kernel: [ 5262.441509] Killed process 2979 (postmaster) vsz:63772kB, anon-rss:28kB, file-rss:0kB .. In any case, if I continue to have postmaster issues I'll make another bug. I shouldn't have mixed these two up! For now, if I don't have any more psql segfaults I'll not worry about it. You can feel free to let this bug sit idle or whatever you feel is appropriate. I would like to note that openSUSE is (and has been), by far, the best platform I've yet used for PostgreSQL work. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=623902
http://bugzilla.novell.com/show_bug.cgi?id=623902#c5
Reinhard Max
For now, if I don't have any more psql segfaults I'll not worry about it. You can feel free to let this bug sit idle or whatever you feel is appropriate.
For now, I am closing it as WORKSFORME. If it crashes again, please reopen and try to give some more details.
I would like to note that openSUSE is (and has been), by far, the best platform I've yet used for PostgreSQL work.
Thanks! :) -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=623902
http://bugzilla.novell.com/show_bug.cgi?id=623902#c6
--- Comment #6 from Jon Nelson
(In reply to comment #4)
For now, if I don't have any more psql segfaults I'll not worry about it. You can feel free to let this bug sit idle or whatever you feel is appropriate.
For now, I am closing it as WORKSFORME. If it crashes again, please reopen and try to give some more details.
I would like to note that openSUSE is (and has been), by far, the best platform I've yet used for PostgreSQL work.
Thanks! :)
Unfortunately, it has happened again. postmaster has been behaving perfectly. psql cored on me again. Program terminated with signal 3, Quit. #0 0x00007fbd9b28ace7 in kill () at ../sysdeps/unix/syscall-template.S:82 82 ../sysdeps/unix/syscall-template.S: No such file or directory. in ../sysdeps/unix/syscall-template.S (gdb) bt #0 0x00007fbd9b28ace7 in kill () at ../sysdeps/unix/syscall-template.S:82 #1 0x00007fbd9b5e1715 in _rl_handle_signal (sig=3) at ../signals.c:220 #2 0x00007fbd9b5e381e in rl_getc (stream=0x7fbd9b5b26a0) at ../input.c:465 #3 0x00007fbd9b5e3f4c in rl_read_key () at ../input.c:446 #4 0x00007fbd9b5cfa9f in readline_internal_char () at ../readline.c:520 #5 0x00007fbd9b5d0015 in readline_internal_charloop (prompt=<value optimized out>) at ../readline.c:586 #6 readline_internal (prompt=<value optimized out>) at ../readline.c:600 #7 readline (prompt=<value optimized out>) at ../readline.c:342 #8 0x000000000040b454 in gets_interactive (prompt=<value optimized out>) at input.c:67 #9 0x000000000040de0f in MainLoop (source=0x7fbd9b5b26a0) at mainloop.c:132 #10 0x0000000000410fa7 in main (argc=<value optimized out>, argv=0x7fff514e8478) at startup.c:285 (gdb) I was doing the same thing - using readline (control-R), searching, and probably cancelling with control-C. I did just notice that I can core the program at-will by issuing a SIGQUIT (control-\). -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com