Re: BUG #17022: SQL causing engine crash - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17022: SQL causing engine crash
Date
Msg-id 3430325.1621435835@sss.pgh.pa.us
Whole thread Raw
In response to BUG #17022: SQL causing engine crash  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #17022: SQL causing engine crash  (Robins Tharakan <tharakan@gmail.com>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> 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 postgres 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=40 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



pgsql-bugs by date:

Previous
From: Palle
Date:
Subject: Re: BUG #16696: Backend crash in llvmjit
Next
From: James Coleman
Date:
Subject: Re: Less selective index chosen unexpectedly