pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@postgresql.org
Subject: pgsql: Make init_spin_delay() C89 compliant and change stuck spinlock r
Date: Thu, 14 Apr 2016 00:02:57 +0000
Message-ID: <E1aqUkL-0005yY-5Z@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Make init_spin_delay() C89 compliant and change stuck spinlock reporting.

The current definition of init_spin_delay (introduced recently in
48354581a) wasn't C89 compliant. It's not legal to refer to refer to
non-constant expressions, and the ptr argument was one.  This, as
reported by Tom, lead to a failure on buildfarm animal pademelon.

The pointer, especially on system systems with ASLR, isn't super helpful
anyway, though. So instead of making init_spin_delay into an inline
function, make s_lock_stuck() report the function name in addition to
file:line and change init_spin_delay() accordingly. While not a direct
replacement, the function name is likely more useful anyway (line
numbers are often hard to interpret in third party reports).

This also fixes what file/line number is reported for waits via
s_lock().

As PG_FUNCNAME_MACRO is now used outside of elog.h, move it to c.h.

Reported-By: Tom Lane
Discussion: 4369.1460435533@sss.pgh.pa.us

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/80abbeba23d466b6541cf95082a9e1f36704424e

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c |  4 ++--
src/backend/storage/lmgr/lwlock.c   |  2 +-
src/backend/storage/lmgr/s_lock.c   | 18 ++++++++++--------
src/include/c.h                     | 11 +++++++++++
src/include/storage/s_lock.h        |  9 +++++----
src/include/utils/elog.h            | 12 ------------
6 files changed, 29 insertions(+), 27 deletions(-)


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


view thread (2+ messages)  latest in thread

Message-ID: <E1aqUkL-0005yY-5Z@gemulon.postgresql.org>
Permalink:  ../E1aqUkL-0005yY-5Z@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1aqUkL-0005yY-5Z@gemulon.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-committers@postgresql.org
  Cc: andres@anarazel.de
  Subject: Re: pgsql: Make init_spin_delay() C89 compliant and change stuck spinlock r
  In-Reply-To: <E1aqUkL-0005yY-5Z@gemulon.postgresql.org>
  References: <E1aqUkL-0005yY-5Z@gemulon.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