Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iYvrb-0000wz-Mc for pgsql-bugs@arkaria.postgresql.org; Sun, 24 Nov 2019 17:39:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iYvqb-0006de-Ds for pgsql-bugs@arkaria.postgresql.org; Sun, 24 Nov 2019 17:38:57 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1iYvqb-0006dX-5q for pgsql-bugs@lists.postgresql.org; Sun, 24 Nov 2019 17:38:57 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iYvqY-0007oj-8b for pgsql-bugs@lists.postgresql.org; Sun, 24 Nov 2019 17:38:56 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id xAOHcoo1009410; Sun, 24 Nov 2019 12:38:50 -0500 From: Tom Lane To: exclusion@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16134: Assertion fails on CREATE gist INDEX over intarray In-reply-to: <16134-0423f729671dec64@postgresql.org> References: <16134-0423f729671dec64@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Sun, 24 Nov 2019 07:33:34 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <9408.1574617130.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 24 Nov 2019 12:38:50 -0500 Message-ID: <9409.1574617130@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form writes: > When running the following script (repeated to improve reproducing): > ... > Server (compiled with cassert) crashes: Yup, reproduced here. What I see is that gistnospace is being told to account for a "to-be-deleted" tuple that is off the end of the page's line pointer array. Tracing back to see where that tuple number is coming from, it seems to originate in gistfinishsplit: gistinserttuples(state, stack->parent, giststate, tuples, 2, stack->downlinkoffnum, left->buf, right->buf, true, /* Unlock parent */ unlockbuf /* Unlock stack->buffer if caller wants = that */ ); That is, the stack->downlinkoffnum tuple index doesn't jibe with the actual state of the stack->parent page. What I suspect has happened is that the stack->parent page itself got split during some recursive split, and the stacked info wasn't updated. I don't know this code well enough to be sure though, and I definitely don't wish to be the one to fix it. regards, tom lane