pgsql: Fix possible "invalid memory alloc request size" failure in node

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix possible "invalid memory alloc request size" failure in node
Date: 2015-10-04 18:17:39
Message-ID: E1Zinqt-0003Vq-1I@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix possible "invalid memory alloc request size" failure in nodeHash.c.

Limit the size of the hashtable pointer array to not more than
MaxAllocSize. We've seen reports of failures due to this in HEAD/9.5,
and it seems possible in older branches as well. The change in
NTUP_PER_BUCKET in 9.5 may have made the problem more likely, but
surely it didn't introduce it.

Tomas Vondra, slightly modified by me

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/ff4cbc1ff3d23fe9c40110c8953e0d07457b136b

Modified Files
--------------
src/backend/executor/nodeHash.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2015-10-04 19:55:31 pgsql: Further twiddling of nodeHash.c hashtable sizing calculation.
Previous Message Tom Lane 2015-10-04 18:07:08 pgsql: Fix some issues in new hashtable size calculations in nodeHash.c