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 1ljNWx-00063M-ST for pgsql-bugs@arkaria.postgresql.org; Wed, 19 May 2021 14:50:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ljNWw-0001Qq-Qw for pgsql-bugs@arkaria.postgresql.org; Wed, 19 May 2021 14:50:38 +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 1ljNWw-0001Qi-KD for pgsql-bugs@lists.postgresql.org; Wed, 19 May 2021 14:50:38 +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 1ljNWu-0008MY-Gg for pgsql-bugs@lists.postgresql.org; Wed, 19 May 2021 14:50:37 +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 14JEoZH43430326; Wed, 19 May 2021 10:50:35 -0400 From: Tom Lane To: tharakan@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17022: SQL causing engine crash In-reply-to: <17022-8e7e280c9b4baedb@postgresql.org> References: <17022-8e7e280c9b4baedb@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Wed, 19 May 2021 06:58:19 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <3430324.1621435835.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 19 May 2021 10:50:35 -0400 Message-ID: <3430325.1621435835@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: > SQLSmith is constantly crashing v13.3 with SQL(s) that appear linked to = a > PostGIS (v3.0.3) bug - see Error Report below. Yeah, I agree, it's a postgis bug. > I decided to post this here (backtracking on an earlier thought), since = #0 / > #1 are=C2=A0postgres functions and I wasn't really sure if the arguments= to these > functions are sanitized. For e.g. whether pg_detoast_datum_slice() is > expected to check input bounds (count=3D40 in this case). The trace shows that gserialized_datum_get_gidx_p is passing a NULL datum pointer to pg_detoast_datum_slice. Whether the slice length is appropriate seems like an academic question. (It does look like that code validates sliceoffset and slicelength and does something appropriate if they're outside the bounds of the datum's size. But you gotta have a datum.) regards, tom lane