pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: craig@tintri.com
To: pgsql-bugs@postgresql.org
Subject: BUG #11095: quickdie() calls syslog() in a signal handler leading to deadlock
Date: Wed, 30 Jul 2014 23:33:28 +0000
Message-ID: <20140730233328.2696.87275@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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



view thread (2+ messages)  latest in thread

Message-ID: <20140730233328.2696.87275@wrigleys.postgresql.org>
Permalink:  ../20140730233328.2696.87275@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20140730233328.2696.87275@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: craig@tintri.com
  Subject: Re: BUG #11095: quickdie() calls syslog() in a signal handler leading to deadlock
  In-Reply-To: <20140730233328.2696.87275@wrigleys.postgresql.org>
  References: <20140730233328.2696.87275@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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