Re: BUG #17855: Uninitialised memory used when the name type value processed in binary mode of Memoize

From: Alexander Lakhin <exclusion(at)gmail(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17855: Uninitialised memory used when the name type value processed in binary mode of Memoize
Date: 2024-04-30 15:00:00
Message-ID: 5664e428-4473-d51f-363d-c143c39d57e3@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello David,

30.04.2024 03:48, David Rowley wrote:
> On Tue, 30 Apr 2024 at 02:28, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> One bit of research that needs to be done is whether btree will
>> truncate an "include"'d column of type name. I think it will not,
>> because that behavior is driven by the opclass and there isn't one
>> for an included column, but it wouldn't hurt to check. If so,
>> just restricting these setup loops to consider only indnkeyatts
>> columns should fix this.
> I did that research in the form of setting a breakpoint in
> index_deform_tuple() and verified the tup->t_info & 0xFFF grows by
> 64-bytes for each extra name column I INCLUDE. Also verified those
> extra bytes are all zero'd

Yes, I saw the same with pageinspect.

I could not find cases (I've tested also ranges and arrays based on the
name type) where the v4 behaves incorrectly, so I think it solves the
problem.

As a side note, perhaps this addition:
+#include "catalog/pg_opfamily_d.h"
is not needed for the current implementation.

Thank you for the fix!

Best regards,
Alexander

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2024-04-30 21:12:55 BUG #18452: [PostgreSQL and 16.1]: [Postgres.exe crash observed while installing the application]
Previous Message Tom Lane 2024-04-30 14:54:03 Re: BUG #17855: Uninitialised memory used when the name type value processed in binary mode of Memoize