Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aONSY-0000Ns-TY for pgsql-bugs@arkaria.postgresql.org; Wed, 27 Jan 2016 10:36:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aONSY-0003cW-GG for pgsql-bugs@arkaria.postgresql.org; Wed, 27 Jan 2016 10:36:22 +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 1aONRt-00029q-TV for pgsql-bugs@postgresql.org; Wed, 27 Jan 2016 10:35:41 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1aONRq-0007Xu-LG for pgsql-bugs@postgresql.org; Wed, 27 Jan 2016 10:35:41 +0000 Received: by mail.anarazel.de (Postfix, from userid 108) id 7944C3A8731; Wed, 27 Jan 2016 11:35:37 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail X-Spam-Level: X-Spam-Status: No, score=-5.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from anarazel.de (p57B4E721.dip0.t-ipconnect.de [87.180.231.33]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 68474860001; Wed, 27 Jan 2016 11:35:34 +0100 (CET) Received: by anarazel.de (Postfix, from userid 1000) id CBB801051CF; Wed, 27 Jan 2016 11:35:33 +0100 (CET) Date: Wed, 27 Jan 2016 11:35:33 +0100 From: Andres Freund To: Dmitriy Sarafannikov Cc: pgsql-bugs Subject: Re: Segfault in MemoryContextAlloc Message-ID: <20160127103533.GA17919@awork2.anarazel.de> References: <1453890275.241158212@f404.i.mail.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1453890275.241158212@f404.i.mail.ru> X-Pg-Spam-Score: -4.2 (----) 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 Hi, On 2016-01-27 13:24:35 +0300, Dmitriy Sarafannikov wrote: > Hi, i caught segfault with a simple select query (column and table names in query were changed). > select id_pk2 from table1 where id_pk1 = '9751302' > > primary key is (id_pk1, id_pk2) > table1 is (id_pk1 bigint, id_pk2 bigint, date_add timestamp) > (gdb) bt full > #0 MemoryContextAlloc (context=0x0, size=120) at /build/postgresql-9.4-MZhK6O/postgresql-9.4-9.4.5/build/../src/backend/utils/mmgr/mcxt.c:584 > No locals. > #1 0x00007f6ecc5b8eec in AfterTriggerBeginXact () at /build/postgresql-9.4-MZhK6O/postgresql-9.4-9.4.5/build/../src/backend/commands/trigger.c:3913 > No locals. > #2 0x00007f6ecc4e8c21 in StartTransaction () at /build/postgresql-9.4-MZhK6O/postgresql-9.4-9.4.5/build/../src/backend/access/transam/xact.c:1848 > s = 0x7f6eccbc4480 > #3 StartTransactionCommand () at /build/postgresql-9.4-MZhK6O/postgresql-9.4-9.4.5/build/../src/backend/access/transam/xact.c:2534 > s = 0x7f6eccbc4480 > __func__ = "StartTransactionCommand" That's, uh, weird. TopTransactionContext should never be NULL here. This is with a stock 9.4.5, without any further extensions configured? My best guess is that some cache invalidation callback did something invalid. With AtStart_Inval(); AtStart_Cache(); AfterTriggerBeginXact(); in StartTransaction(), AtStart_Inval() still had a valid TopTransactionContext, but AfterTriggerBeginXact() didn't anymore, that seems like a good guess. Greetings, Andres Freund -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs