Re: pgsql: Implementation of subscripting for jsonb - Mailing list pgsql-committers

From Alexander Korotkov
Subject Re: pgsql: Implementation of subscripting for jsonb
Date
Msg-id CAPpHfdsne3=T=fMNU45PtxdhSL_J2PjLTeS8rwKnJzUR4YNd4w@mail.gmail.com
Whole thread Raw
In response to Re: pgsql: Implementation of subscripting for jsonb  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pgsql: Implementation of subscripting for jsonb  (Alexander Korotkov <aekorotkov@gmail.com>)
List pgsql-committers
On Mon, Feb 1, 2021 at 10:06 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Heikki Linnakangas <hlinnaka@iki.fi> writes:
> > On 31/01/2021 22:54, Alexander Korotkov wrote:
> >> Implementation of subscripting for jsonb
>
> > The Itanium and sparc64 buildfarm members didn't like this, and are
> > crashing at "select ('123'::jsonb)['a'];". Unaligned memory access, perhaps?
>
> I think I just identified the cause.

Thanks again for fixing this.

BTW, I managed to reproduce the issue by compiling with CFLAGS="-O0
-fsanitize=alignment -fsanitize-trap=alignment" and the patch
attached.

I can propose the following to catch such issues earlier.  We could
finish (wrap attribute with macro and apply it to other places with
misalignment access if any) and apply the attached patch and make
commitfest.cputube.org check patches with CFLAGS="-O0
-fsanitize=alignment -fsanitize-trap=alignment".  What do you think?

------
Regards,
Alexander Korotkov

Attachment

pgsql-committers by date:

Previous
From: Alexander Korotkov
Date:
Subject: pgsql: Get rid of unnecessary memory allocation in jsonb_subscript_assi
Next
From: Alexander Korotkov
Date:
Subject: Re: pgsql: Implementation of subscripting for jsonb