Re: BUG #17300: Server crashes on deserializing text multirange - Mailing list pgsql-bugs

From Alexander Korotkov
Subject Re: BUG #17300: Server crashes on deserializing text multirange
Date
Msg-id CAPpHfdtPFbiUtKq7gB1=mMQZz-RaXnZ3=sEtdOVKByO0E58s=A@mail.gmail.com
Whole thread Raw
In response to Re: BUG #17300: Server crashes on deserializing text multirange  (Alexander Korotkov <aekorotkov@gmail.com>)
Responses Re: BUG #17300: Server crashes on deserializing text multirange  (Alexander Korotkov <aekorotkov@gmail.com>)
List pgsql-bugs
On Mon, Dec 6, 2021 at 10:39 PM Alexander Korotkov <aekorotkov@gmail.com> wrote:
> On Thu, Dec 2, 2021 at 1:39 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > PG Bug reporting form <noreply@postgresql.org> 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.
>
> Sorry for the delay.  I'm going to fix this in the next couple of days.

The proposed patch fixes the patch (and adds some minimal testing for
it).  I'm going to push it if no objections (backpatch to v14).

------
Regards,
Alexander Korotkov

Attachment

pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: BUG #17333: pgdg postgresql-common pg_upgradecluster duplicate data_directory in configuration file
Next
From: Vik Fearing
Date:
Subject: Re: BUG #17321: count(*) on a 1,874,554,883 rows partitioned table takes several minutes.