Re: [patch]HashJoin crash
Justin Pryzby <pryzby@telsasoft.com>
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>
Date: 2022-08-13T19:17:46Z
Lists: 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:
Commits
-
Avoid misbehavior when hash_table_bytes < bucket_size.
- 55d9cd46f65a 16.0 landed
- aee95437362d 15.0 landed
- 4878ea717c71 13.9 landed
- 1dfc9193af7f 14.6 landed
-
Get rid of artificial restriction on hash table sizes on Windows.
- b154ee63bb65 14.0 cited