Re: BUG #17847: Unaligned memory access in ltree_gist

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Alexander Lakhin <exclusion(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17847: Unaligned memory access in ltree_gist
Date: 2023-03-19 17:09:27
Message-ID: CAPpHfdt4bXSjXqsPZwQcTXVvzpPwYxPLGR=9ZDiQ=6vaSkYF1A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Mar 18, 2023 at 10:00 AM Alexander Lakhin <exclusion(at)gmail(dot)com> wrote:
> 16.03.2023 22:35, Tom Lane wrote:
>
> I wonder which other opclasses besides ltree have the same issue.
>
>
> I found no other similar places: siglen is also accepted by opclasses
> gist__intbig_ops, gist_hstore_ops, gist_trgm_ops, tsvector_ops,
> which implementations use functions
> _intbig_alloc, ghstore_alloc, gtrgm_alloc, gtsvector_alloc,
> and none of them adds siglen to a pointer.
> Quick testing confirms that.
>
> (gist__ltree_ops uses ltree_gist_alloc(), but the problematic branch
> "if (left) ..." not reached for gist__ltree_ops)

Yep, ltree seems the only place storing aligned value *after*
signature. Thank you for validating this.

------
Regards,
Alexander Korotkov

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2023-03-19 18:54:40 Re: BUG #17853: COLLATE does not work with numeric column references in ORDER BY
Previous Message Alexander Korotkov 2023-03-19 17:08:28 Re: BUG #17847: Unaligned memory access in ltree_gist