Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ckGV9-0002uJ-QY for pgsql-hackers@arkaria.postgresql.org; Sat, 04 Mar 2017 20:42:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ckGV8-0004GK-Ne for pgsql-hackers@arkaria.postgresql.org; Sat, 04 Mar 2017 20:42:02 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ckGV6-0004Dq-Ep for pgsql-hackers@postgresql.org; Sat, 04 Mar 2017 20:42:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ckGV3-0006TC-HK for pgsql-hackers@postgresql.org; Sat, 04 Mar 2017 20:41:59 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v24KftTP010141; Sat, 4 Mar 2017 15:41:55 -0500 From: Tom Lane To: Andrew Dunstan cc: PostgreSQL-development Subject: Re: Re: check failure with -DRELCACHE_FORCE_RELEASE -DCLOBBER_FREED_MEMORY In-reply-to: <2b2c4bc2-160c-8626-1374-c0da6a638339@2ndQuadrant.com> References: <7b52f900-0579-cda9-ae2e-de5da17090e6@2ndQuadrant.com> <2b2c4bc2-160c-8626-1374-c0da6a638339@2ndQuadrant.com> Comments: In-reply-to Andrew Dunstan message dated "Sat, 04 Mar 2017 09:20:23 -0500" Date: Sat, 04 Mar 2017 15:41:53 -0500 Message-ID: <22846.1488660113@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Andrew Dunstan writes: > On 03/03/2017 02:24 PM, Andrew Dunstan wrote: >> I have been setting up a buildfarm member with -DRELCACHE_FORCE_RELEASE >> -DCLOBBER_FREED_MEMORY, settings which Alvaro suggested to me.I got core >> dumps with these stack traces. The platform is Amazon Linux. > I have replicated this on a couple of other platforms (Fedora, FreeBSD) > and back to 9.5. The same failure doesn't happen with buildfarm runs on > earlier branches, although possibly they don't have the same set of tests. well, the problem in rebuild_relation() seems pretty blatant: /* Close relcache entry, but keep lock until transaction commit */ heap_close(OldHeap, NoLock); /* Create the transient table that will receive the re-ordered data */ OIDNewHeap = make_new_heap(tableOid, tableSpace, OldHeap->rd_rel->relpersistence, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AccessExclusiveLock); There are two such references after the heap_close. I don't know that those are the only bugs, but this reference is certainly the proximate cause of the crash I'm seeing. Will push a fix in a little bit. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers