pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #11095: quickdie() calls syslog() in a signal handler leading to deadlock
2+ messages / 2 participants
[nested] [flat]

* BUG #11095: quickdie() calls syslog() in a signal handler leading to deadlock
@ 2014-07-30 23:33 craig@tintri.com
  2014-07-31 16:18 ` Re: BUG #11095: quickdie() calls syslog() in a signal handler leading to deadlock Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: craig@tintri.com @ 2014-07-30 23:33 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      11095
Logged by:          Craig Robson
Email address:      craig@tintri.com
PostgreSQL version: Unsupported/Unknown
Operating system:   Linux
Description:        

We are using log_destination='syslog'.

We found one of our Postgresql processes deadlocked with this backtrace.  It
is not safe to call syslog() in a signal handler on Linux.  We are using
version 8.4.20.  I looked at newer versions sourcecode and I believe they
have the same problem.

> #0  0x00007fe357ee3a7e in __lll_lock_wait_private () from
/lib64/libc.so.6
> #1  0x00007fe357e71e29 in _L_lock_10462 () from /lib64/libc.so.6
> #2  0x00007fe357e6fa52 in malloc () from /lib64/libc.so.6
> #3  0x00007fe357e64648 in open_memstream () from /lib64/libc.so.6
> #4  0x00007fe357ed10bb in __vsyslog_chk () from /lib64/libc.so.6
> #5  0x00007fe357ed1693 in __syslog_chk () from /lib64/libc.so.6
> #6  0x000000000069a2a3 in syslog (__fmt=0x7e08ce "[%lu-%d] %s", __pri=5)
at /usr/include/bits/syslog.h:32
> #7  write_syslog (level=5, line=0xbe2ac0 "WARNING:  terminating connection
because of crash of another server process\nDETAIL:  The postmaster has
commanded this server process to roll back the current transaction and exit,
because another ser"...) at elog.c:1592
> #8  0x000000000069c6d7 in send_message_to_server_log (edata=0xac9bc0) at
elog.c:2238
> #9  EmitErrorReport () at elog.c:1204
> #10 0x000000000069cd80 in errfinish (dummy=<optimized out>) at elog.c:457
> #11 0x00000000005ea19d in quickdie (postgres_signal_arg=<optimized out>)
at postgres.c:2502
> #12 <signal handler called>
> #13 0x00007fe357e6eae6 in _int_malloc () from /lib64/libc.so.6
> #14 0x00007fe357e6fa5d in malloc () from /lib64/libc.so.6
... Rest of stack trace removed.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #11095: quickdie() calls syslog() in a signal handler leading to deadlock
  2014-07-30 23:33 BUG #11095: quickdie() calls syslog() in a signal handler leading to deadlock craig@tintri.com
@ 2014-07-31 16:18 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2014-07-31 16:18 UTC (permalink / raw)
  To: craig@tintri.com; +Cc: pgsql-bugs

craig@tintri.com writes:
> We found one of our Postgresql processes deadlocked with this backtrace.  It
> is not safe to call syslog() in a signal handler on Linux.  We are using
> version 8.4.20.  I looked at newer versions sourcecode and I believe they
> have the same problem.

Well, the alternatives are to do this or not leave any trace of why the
process exited.  Newer versions than 8.4 (which is EOL btw) have an
amelioration mechanism for this and related risks, which is that the
postmaster SIGKILLs any child that doesn't exit within a few seconds.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2014-07-31 16:18 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-07-30 23:33 BUG #11095: quickdie() calls syslog() in a signal handler leading to deadlock craig@tintri.com
2014-07-31 16:18 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox