Re: [patch]HashJoin crash - Mailing list pgsql-hackers

From Justin Pryzby
Subject Re: [patch]HashJoin crash
Date
Msg-id 20220813191746.GI26198@telsasoft.com
Whole thread Raw
In response to [patch]HashJoin crash  (Zhang Mingli <zmlpostgres@gmail.com>)
List pgsql-hackers
+ 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:



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Cleaning up historical portability baggage
Next
From: Andrew Dunstan
Date:
Subject: Goodbye Windows XP