psql: core dumped

Started by Marioabout 19 years ago11 messages
#1Mario
gonzalemario@gmail.com

When psql is running and CRTL + \ is pressed, a core dumped show up.
In first place I ran psql into gdb, saw the backtrace and I believed
it was a libc6 bug and I reported to my distro security team
https://launchpad.net/distros/ubuntu/+source/glibc/+bug/76437

Ubuntu edgy has got libc-2.4, a friend of my tested in Linux with
libc-2.3 and nothing happened. I don't know why in my libc version
(2.4) this happen.

So, with humility :-) I want to help and I wrote a patch with a
solution, you can have it in the next link:
http://media.forestal.udec.cl/pgsql/startup.diff I do not wanted to
sent it as an attachment

My solution is catch the SIGQUIT signal and abort in silence, just that.

Regards!

PS: sorry my English
--
http://www.advogato.org/person/mgonzalez/

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Mario (#1)
Re: psql: core dumped

Mario wrote:

When psql is running and CRTL + \ is pressed, a core dumped show up.
In first place I ran psql into gdb, saw the backtrace and I believed
it was a libc6 bug and I reported to my distro security team
https://launchpad.net/distros/ubuntu/+source/glibc/+bug/76437

This isn't a bug. It's working as designed.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

#3Mario
gonzalemario@gmail.com
In reply to: Peter Eisentraut (#2)
Re: psql: core dumped

On 20/12/06, Peter Eisentraut <peter_e@gmx.net> wrote:

Mario wrote:

When psql is running and CRTL + \ is pressed, a core dumped show up.
In first place I ran psql into gdb, saw the backtrace and I believed
it was a libc6 bug and I reported to my distro security team
https://launchpad.net/distros/ubuntu/+source/glibc/+bug/76437

This isn't a bug. It's working as designed.

Even if you get a core dumped every time you press CTRL+\ ? why?

--
http://www.advogato.org/person/mgonzalez/

#4Andrew Dunstan
andrew@dunslane.net
In reply to: Mario (#3)
Re: psql: core dumped

Mario wrote:

On 20/12/06, Peter Eisentraut <peter_e@gmx.net> wrote:

Mario wrote:

When psql is running and CRTL + \ is pressed, a core dumped show up.
In first place I ran psql into gdb, saw the backtrace and I believed
it was a libc6 bug and I reported to my distro security team
https://launchpad.net/distros/ubuntu/+source/glibc/+bug/76437

This isn't a bug. It's working as designed.

Even if you get a core dumped every time you press CTRL+\ ? why?

This normally a SIGQUIT, and on my machine at least the default action for
that is a core dump. Perhaps you need to say what you are trying to do and
why.

cheers

andrew

#5Philip Yarra
philip@utiba.com
In reply to: Mario (#3)
Re: psql: core dumped

Mario wrote:

Even if you get a core dumped every time you press CTRL+\ ? why?

Try ulimit -c 0, then run it (you should get no core dump)
Then ulimit -c 500000, then run it (you should get a core dump)

SIGQUIT is supposed to dump core. Ulimit settings can suppress
generation of core files. The difference between your machine and your
friend's is likely just the ulimit settings.

Regards, Philip.

--
Philip Yarra
Senior Software Engineer, Utiba Pty Ltd
philip@utiba.com

#6Gregory Stark
stark@enterprisedb.com
In reply to: Mario (#3)
Re: psql: core dumped

"Mario" <gonzalemario@gmail.com> writes:

On 20/12/06, Peter Eisentraut <peter_e@gmx.net> wrote:

This isn't a bug. It's working as designed.

Even if you get a core dumped every time you press CTRL+\ ? why?

That's what C-\ does. Try it with any other program:

$ sleep 1
Quit (core dumped)

Most distributions ship with coredumpsize limited to 0 by default though, so
you would only cause it to crash without a core dump by default. Either yours
doesn't or you've enabled core dumps with "ulimit -c unlimited" (not that
that's a bad thing).

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

#7Jeremy Drake
pgsql@jdrake.com
In reply to: Philip Yarra (#5)
Re: psql: core dumped

On Wed, 20 Dec 2006, Philip Yarra wrote:

Mario wrote:

Even if you get a core dumped every time you press CTRL+\ ? why?

Try ulimit -c 0, then run it (you should get no core dump)
Then ulimit -c 500000, then run it (you should get a core dump)

SIGQUIT is supposed to dump core. Ulimit settings can suppress generation of
core files. The difference between your machine and your friend's is likely
just the ulimit settings.

If you want to type CTRL+\ you can redefine what char generates SIGQUIT
with stty quit command. For instance,

stty quit ^@

--
fortune's Contribution of the Month to the Animal Rights Debate:

I'll stay out of animals' way if they'll stay out of mine.
"Hey you, get off my plate"
-- Roger Midnight

#8Alvaro Herrera
alvherre@commandprompt.com
In reply to: Jeremy Drake (#7)
Re: psql: core dumped

Jeremy Drake wrote:

On Wed, 20 Dec 2006, Philip Yarra wrote:

Mario wrote:

Even if you get a core dumped every time you press CTRL+\ ? why?

Try ulimit -c 0, then run it (you should get no core dump)
Then ulimit -c 500000, then run it (you should get a core dump)

SIGQUIT is supposed to dump core. Ulimit settings can suppress generation of
core files. The difference between your machine and your friend's is likely
just the ulimit settings.

If you want to type CTRL+\ you can redefine what char generates SIGQUIT
with stty quit command.

I think the problem Mario is really trying to solve is quitting at
psql's "Password: " prompt. Ctrl-C is ignored at that point apparently.
SIGQUIT (thus Ctrl-\ in most people's setup) does it but it also dumps
core.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

#9Mario
gonzalemario@gmail.com
In reply to: Alvaro Herrera (#8)
Re: psql: core dumped

On 19/12/06, Alvaro Herrera <alvherre@commandprompt.com> wrote:

I think the problem Mario is really trying to solve is quitting at
psql's "Password: " prompt. Ctrl-C is ignored at that point apparently.
SIGQUIT (thus Ctrl-\ in most people's setup) does it but it also dumps
core.

yes, that is true and also when you are is psql prompt too. But, I
had no idea that a core dump is normal with a SIGQUIT signal.

Thank you all for your time and patience; this was my first "try"
with a postgres patch, I'll try with something else in other chance
:-)

--
http://www.advogato.org/person/mgonzalez/

#10Mario
gonzalemario@gmail.com
In reply to: Andrew Dunstan (#4)
Re: psql: core dumped

On 19/12/06, Andrew Dunstan <andrew@dunslane.net> wrote:

This normally a SIGQUIT, and on my machine at least the default action for
that is a core dump. Perhaps you need to say what you are trying to do and
why.

I'd like to help :-) I wanted to avoid a core dumped but you told
me that's a normal thing for a SIGQUIT signal.

--
http://www.advogato.org/person/mgonzalez/

#11Philip Yarra
philip@utiba.com
In reply to: Mario (#10)
Re: psql: core dumped

Mario wrote:

I'd like to help :-) I wanted to avoid a core dumped but you told
me that's a normal thing for a SIGQUIT signal.

Did you try running `ulimit -c 0` first? That should do what you want -
prevent generation of the dump file.

Regards, Philip.

--
Philip Yarra
Senior Software Engineer, Utiba Pty Ltd
philip@utiba.com