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 1hIffY-0002mi-Tq for pgsql-bugs@arkaria.postgresql.org; Mon, 22 Apr 2019 20:36:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hIffX-0007nE-BK for pgsql-bugs@arkaria.postgresql.org; Mon, 22 Apr 2019 20:36:03 +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 1hIffX-0007n6-3Z for pgsql-bugs@lists.postgresql.org; Mon, 22 Apr 2019 20:36:03 +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 1hIffU-0005yI-3X for pgsql-bugs@lists.postgresql.org; Mon, 22 Apr 2019 20:36:02 +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 x3MKZuSc025619; Mon, 22 Apr 2019 16:35:56 -0400 From: Tom Lane To: Peter Geoghegan cc: Grigory Smolkin , PostgreSQL mailing lists Subject: Re: amcheck assert failure In-reply-to: References: <906cac0a-1201-e981-5043-7ca0d97d2a17@postgrespro.ru> <61090467-0a38-d58b-dfcc-81463e66708c@postgrespro.ru> <23979.1555962717@sss.pgh.pa.us> Comments: In-reply-to Peter Geoghegan message dated "Mon, 22 Apr 2019 13:31:08 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25617.1555965356.1@sss.pgh.pa.us> Date: Mon, 22 Apr 2019 16:35:56 -0400 Message-ID: <25618.1555965356@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Peter Geoghegan writes: > On Mon, Apr 22, 2019 at 12:51 PM Tom Lane wrote: >> Nonetheless ... do we really want an assertion failure rather than >> some more-mundane error report? Seems like the point of amcheck >> is to detect data corruption, so I'd rather get an ERROR than an >> assertion (which would not fire in production builds anyway). > The only explanation I can think of is that the assertion failure was > from the core code That's what I guessed. It might be impractical for amcheck to prevent it, but we should try to find out. > We could: > * Throw an error when any line item reports lp_len == 0. > * Throw an error when there is a line item that's either LP_UNUSED, or > LP_REDIRECT. The corrupt page sent by Grigory had both. > What do you think of the idea of committing some simple checks to do > this with contrib/amcheck on v12? No objection here, as long as it doesn't add an unreasonable amount of complexity. (If it does, we might have to think harder about what to do.) regards, tom lane