Re: Patch to fix write after end of array in hashed agg initialization

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Colm McHugh <colm(dot)mchugh(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Subject: Re: Patch to fix write after end of array in hashed agg initialization
Date: 2019-05-22 15:11:20
Message-ID: 8040.1558537880@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Colm McHugh <colm(dot)mchugh(at)gmail(dot)com> writes:
> Attached is a patch for a write after allocated memory which we found in
> testing. Its an obscure case but can happen if the same column is used in
> different grouping keys, as in the example below, which uses tables from
> the regress test suite (build with --enable-cassert in order to turn on
> memory warnings). Patch is against master.

I confirm the appearance of the memory-overwrite warnings in HEAD.

It looks like the bad code is (mostly) the fault of commit b5635948.
Andrew, can you take a look at this fix?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2019-05-22 15:16:56 Re: "WIP: Data at rest encryption" patch and, PostgreSQL 11-beta3
Previous Message Tom Lane 2019-05-22 14:58:54 Re: Teach pg_upgrade test to honor NO_TEMP_INSTALL