Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pPmwl-000225-7g for pgsql-bugs@arkaria.postgresql.org; Wed, 08 Feb 2023 16:05:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pPmwj-0002jA-Ty for pgsql-bugs@arkaria.postgresql.org; Wed, 08 Feb 2023 16:05:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pPmwj-0002j0-Hk for pgsql-bugs@lists.postgresql.org; Wed, 08 Feb 2023 16:05:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pPmwh-0007l0-5B for pgsql-bugs@lists.postgresql.org; Wed, 08 Feb 2023 16:05:20 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 318G5Gjm3492170; Wed, 8 Feb 2023 11:05:16 -0500 From: Tom Lane To: Dmitry Dolgov <9erthalion6@gmail.com> cc: John Naylor , tharakan@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17774: Assert triggered on brin_minmax_multi.c In-reply-to: <20230208153313.fym7at3ubgrec67a@ddolgov.remote.csb> References: <17774-c6f3e36dd4471e67@postgresql.org> <20230208100658.mz2kkeruoma6iqtw@ddolgov.remote.csb> <3485884.1675868581@sss.pgh.pa.us> <20230208153313.fym7at3ubgrec67a@ddolgov.remote.csb> Comments: In-reply-to Dmitry Dolgov <9erthalion6@gmail.com> message dated "Wed, 08 Feb 2023 16:33:13 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3492168.1675872316.1@sss.pgh.pa.us> Date: Wed, 08 Feb 2023 11:05:16 -0500 Message-ID: <3492169.1675872316@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dmitry Dolgov <9erthalion6@gmail.com> writes: >> On Wed, Feb 08, 2023 at 10:03:01AM -0500, Tom Lane wrote: >> I'd believe this argument more readily if the calculation weren't being >> done in float arithmetic. Since it is, you're at the mercy of roundoff >> error ... and that small negative delta could certainly pass for >> roundoff error. > Hmm...yeah, good point. In both the reproducer I've posted and the > backtrace from the thread the delta is indeed rather small. I bet also it only fails when dealing with IPv6 addresses. With 32-bit IPv4 addresses, a float8 would have enough mantissa bits that the calculation wouldn't become imprecise. regards, tom lane