pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: chris.tessels@inergy.nl
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #13985: Segmentation fault on PREPARE TRANSACTION
Date: Wed, 24 Feb 2016 17:52:37 -0300
Message-ID: <20160224205237.GA438345@alvherre.pgsql> (raw)
In-Reply-To: <20160224125824.2573.27524@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

chris.tessels@inergy.nl wrote:

> 	Core was generated by `postgres: mailinfo_ow mailinfo_ods 10.50.6.6(4188'.
> 	Program terminated with signal 11, Segmentation fault.
> 
> 	#0  MinimumActiveBackends (min=50) at procarray.c:2472
> 	2472			if (pgxact->xid == InvalidTransactionId)

It's not surprising that you're not able to make this crash
consistently, because it looks like the problem might be in concurrent
modifications to the PGXACT array.  This routine, MinimumActiveBackends,
walks the PGPROC array explicitely without locks.  There are comments
indicating that this is safe, but evidently something has slipped in
there.

Apparently this code is trying to dereference an invalid pgxact, but
it's not clear to me how this happens.  Those structs are allocated in
advance, and they are referenced in the code via array indexes, so even
if the pgxact doesn't actually hold data about a valid transaction,
dereferencing the XID shouldn't cause a crash.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
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)  latest in thread

Message-ID: <20160224205237.GA438345@alvherre.pgsql>
Permalink:  ../20160224205237.GA438345@alvherre.pgsql/
Also on:    postgresql.org/message-id/20160224205237.GA438345@alvherre.pgsql

 · 

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: alvherre@2ndquadrant.com, chris.tessels@inergy.nl
  Subject: Re: BUG #13985: Segmentation fault on PREPARE TRANSACTION
  In-Reply-To: <20160224205237.GA438345@alvherre.pgsql>
  References: <20160224125824.2573.27524@wrigleys.postgresql.org> <20160224205237.GA438345@alvherre.pgsql>

* 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