From: Justin Pryzby <pryzby@telsasoft.com>
To: Zhang Mingli <zmlpostgres@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>
Subject: Re: [patch]HashJoin crash
Date: Sat, 13 Aug 2022 14:17:46 -0500
Message-ID: <20220813191746.GI26198@telsasoft.com> (raw)
In-Reply-To: <beb64ca0-91e2-44ac-bf4a-7ea36275ec02@Spark>
References: <9746d4e1-a008-44a3-bce9-170b4721e862@Spark>
<beb64ca0-91e2-44ac-bf4a-7ea36275ec02@Spark>
+ Tom Lane
On Fri, Aug 12, 2022 at 11:05:06PM +0800, Zhang Mingli wrote:
> I got a coredump when using hash join on a Postgres derived Database(Greenplum DB).
> And I find a way to reproduce it on Postgres.
>
> Root cause:
>
> In ExecChooseHashTableSize(), commit b154ee63bb uses func pg_nextpower2_size_t
> whose param must not be 0.
>
> sbuckets = pg_nextpower2_size_t(hash_table_bytes / bucket_size);
>
> There is a potential risk that hash_table_bytes < bucket_size in some corner cases.
>
> Reproduce sql:
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: pryzby@telsasoft.com, zmlpostgres@gmail.com, tgl@sss.pgh.pa.us
Subject: Re: [patch]HashJoin crash
In-Reply-To: <20220813191746.GI26198@telsasoft.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox