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 1msYGf-0000P8-Q4 for pgsql-bugs@arkaria.postgresql.org; Wed, 01 Dec 2021 22:40:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1msYGe-0007u7-EJ for pgsql-bugs@arkaria.postgresql.org; Wed, 01 Dec 2021 22:40:00 +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 1msYGe-0007tw-5v for pgsql-bugs@lists.postgresql.org; Wed, 01 Dec 2021 22:40:00 +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 1msYGb-00067n-VG for pgsql-bugs@lists.postgresql.org; Wed, 01 Dec 2021 22:39:59 +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 1B1Mdtcc2001129; Wed, 1 Dec 2021 17:39:55 -0500 From: Tom Lane To: Alexander Korotkov , Paul A Jungwirth cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17300: Server crashes on deserializing text multirange In-reply-to: <17300-dced2d01ddeb1f2f@postgresql.org> References: <17300-dced2d01ddeb1f2f@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Sat, 27 Nov 2021 18:00:01 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2001127.1638398395.1@sss.pgh.pa.us> Date: Wed, 01 Dec 2021 17:39:55 -0500 Message-ID: <2001128.1638398395@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > The following query: > select ('[\"\\\\\",\"\\\\' || repeat('a', 200) || > '\"]')::textrange::textmultirange > leads to the server crash with the following stacktrace: I think the problem here is that the range bound values inside the multirange are supposed to be aligned (at least, write_multirange_data thinks so) but multirange_get_range isn't accounting for the alignment padding between the two values it extracts. In this example that causes it to extract an insane length for the second value. If so, this would indicate extremely slipshod testing of the multirange stuff, because the breakage is necessarily reached by multirange_out. regards, tom lane