From: Tom Lane <tgl@sss.pgh.pa.us>
To: Shulgin, Oleksandr <oleksandr.shulgin@zalando.de>
Cc: Andres Freund <andres@anarazel.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: Thu, 25 Feb 2016 09:51:49 -0500
Message-ID: <5857.1456411909@sss.pgh.pa.us> (raw)
In-Reply-To: <CACACo5RdOOZLS2fRELPO77Ob0jK+2k8mhFVJ2UBUS157FTp7rA@mail.gmail.com>
References: <20160224125824.2573.27524@wrigleys.postgresql.org>
<20160224205237.GA438345@alvherre.pgsql>
<20160224215221.bbbduc5nelq7tf6s@alap3.anarazel.de>
<CACACo5RdOOZLS2fRELPO77Ob0jK+2k8mhFVJ2UBUS157FTp7rA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
"Shulgin, Oleksandr" <oleksandr.shulgin@zalando.de> writes:
> On Wed, Feb 24, 2016 at 10:52 PM, Andres Freund <andres@anarazel.de> wrote:
> At the very least ISTM that we have to make pgprocno volatile (or use a
>> memory barrier - but we don't have sufficient support for those in the
>> older branches), and move the PGPROC/PGXACT lookups after the == -1
>> check.
> Use of volatile doesn't change the resulting code dramatically for me.
Marking pgprocno volatile is silly. What *is* missing is this:
- ProcArrayStruct *arrayP = procArray;
+ volatile ProcArrayStruct *arrayP = procArray;
which corresponds directly to what the problem is: the storage arrayP
is pointing at may change asynchronously.
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
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, oleksandr.shulgin@zalando.de, andres@anarazel.de, alvherre@2ndquadrant.com
Subject: Re: BUG #13985: Segmentation fault on PREPARE TRANSACTION
In-Reply-To: <5857.1456411909@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>
* 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