Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aYgQY-0002Pj-1P for pgsql-bugs@arkaria.postgresql.org; Wed, 24 Feb 2016 20:52:54 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aYgQX-0000YY-CN for pgsql-bugs@arkaria.postgresql.org; Wed, 24 Feb 2016 20:52:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aYgQW-0000YK-Os for pgsql-bugs@postgresql.org; Wed, 24 Feb 2016 20:52:52 +0000 Received: from out.smtp-auth.no-ip.com ([8.23.224.60]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aYgQR-00049H-TG for pgsql-bugs@postgresql.org; Wed, 24 Feb 2016 20:52:51 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [200.83.202.40]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id BD9D6400862; Wed, 24 Feb 2016 12:52:39 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 9AAF15BF; Wed, 24 Feb 2016 17:52:37 -0300 (CLT) Date: Wed, 24 Feb 2016 17:52:37 -0300 From: Alvaro Herrera To: chris.tessels@inergy.nl Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #13985: Segmentation fault on PREPARE TRANSACTION Message-ID: <20160224205237.GA438345@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160224125824.2573.27524@wrigleys.postgresql.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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