Re: BUG #17300: Server crashes on deserializing text multirange

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>, Alexander Law <exclusion(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17300: Server crashes on deserializing text multirange
Date: 2021-12-13 14:28:39
Message-ID: CAPpHfdtSiYg8S8-pTSoAUaG+trviBtsR7y0NLXe96mWFNw1rbA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Dec 11, 2021 at 4:48 AM Alexander Korotkov <aekorotkov(at)gmail(dot)com> wrote:
> On Mon, Dec 6, 2021 at 10:39 PM Alexander Korotkov <aekorotkov(at)gmail(dot)com> wrote:
> > On Thu, Dec 2, 2021 at 1:39 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > > PG Bug reporting form <noreply(at)postgresql(dot)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).

Pushed!

------
Regards,
Alexander Korotkov

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2021-12-13 14:45:36 BUG #17335: Duplicate result rows in Gather node when "Suppress Append ... that have a single child" applied
Previous Message Dmitry Dolgov 2021-12-13 12:21:54 Re: BUG #17255: Server crashes in index_delete_sort_cmp() due to race condition with vacuum