pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Shulgin, Oleksandr <oleksandr.shulgin@zalando.de>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: chris.tessels@inergy.nl, Pg Bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #13985: Segmentation fault on PREPARE TRANSACTION
Date: Mon, 29 Feb 2016 13:35:29 -0500
Message-ID: <18587.1456770929@sss.pgh.pa.us> (raw)
In-Reply-To: <20160225172958.t7pdlt4puydblchx@alap3.anarazel.de>
References: <20160224125824.2573.27524@wrigleys.postgresql.org>
	<20160224205237.GA438345@alvherre.pgsql>
	<20160224215221.bbbduc5nelq7tf6s@alap3.anarazel.de>
	<CACACo5RdOOZLS2fRELPO77Ob0jK+2k8mhFVJ2UBUS157FTp7rA@mail.gmail.com>
	<5857.1456411909@sss.pgh.pa.us>
	<20160225170311.qi3h6zbzf4mscdtj@alap3.anarazel.de>
	<29282.1456420806@sss.pgh.pa.us>
	<20160225172958.t7pdlt4puydblchx@alap3.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Andres Freund <andres@anarazel.de> writes:
> On 2016-02-25 12:20:06 -0500, Tom Lane wrote:
>> Seems like we can either (1) get rid of that memmove in favor of
>> a handwritten loop, or (2) give up on unlocked access to the
>> pgprocnos array.  Which performance hit would you rather take?

> I think 1), while it'll be noticeable, it's probably going to degrade
> much more gracefully.

> I think we additionally also should add a security check to
> MinimumActiveBackends that prevents a pgprocno above the max number of
> backends to be seen as valid.

So we have three proposals on the table:
* volatile-ize arrayP
* range-check the pgprocno after we fetch it
* replace memmove(s) with int-at-a-time move loop(s)

I wonder whether we couldn't leave the memmoves alone if we do the other
two things.  It would mean that MinimumActiveBackends would sometimes
miss examining some backends, but that's going to happen anyway given
its use of unlocked access.

			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



view thread (14+ messages)

Message-ID: <18587.1456770929@sss.pgh.pa.us>
Permalink:  ../18587.1456770929@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/18587.1456770929@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, andres@anarazel.de, oleksandr.shulgin@zalando.de, alvherre@2ndquadrant.com
  Subject: Re: BUG #13985: Segmentation fault on PREPARE TRANSACTION
  In-Reply-To: <18587.1456770929@sss.pgh.pa.us>
  References: <20160224125824.2573.27524@wrigleys.postgresql.org> <20160224205237.GA438345@alvherre.pgsql> <20160224215221.bbbduc5nelq7tf6s@alap3.anarazel.de> <CACACo5RdOOZLS2fRELPO77Ob0jK+2k8mhFVJ2UBUS157FTp7rA@mail.gmail.com> <5857.1456411909@sss.pgh.pa.us> <20160225170311.qi3h6zbzf4mscdtj@alap3.anarazel.de> <29282.1456420806@sss.pgh.pa.us> <20160225172958.t7pdlt4puydblchx@alap3.anarazel.de> <18587.1456770929@sss.pgh.pa.us>

* 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