Re: [Bug] Heap Use After Free in Window Aggregate Execution - Mailing list pgsql-hackers

From David Rowley
Subject Re: [Bug] Heap Use After Free in Window Aggregate Execution
Date
Msg-id CAApHDvr=DTKWANVWjGh9OoygiCCFw_ORRyE4Aj44xS_gKDMHLQ@mail.gmail.com
Whole thread Raw
List pgsql-hackers
On Thu, 14 Nov 2024 at 04:31, Jayesh Dehankar <jayesh.dp@zohocorp.com> wrote:
> We have discovered a bug in PostgreSQL v16.3 related to a top-level window aggregate with a partition-by clause. The
issueoccurs when the run condition fails, causing the window aggregate status to change from WINDOWAGG_RUN to
WINDOWAGG_PASSTHROUGH_STRICTmode. The bug is present in the latest STABLE branch. 

> 2) Execute below SQL queries:
> create table issue(a int, f text);
> insert into issue values (1, 'aa'), (1, 'bb');
> select * from ( select row_number() over (partition by a) as first, lead(f) over (partition by a) as third from
issue)emp where first < 1; 

Thank you for the detailed report and reproducer.

I've pushed a fix for this issue. It should be available in the 16.7
release around mid-Feb 2025.

David



pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: Proper object locking for GRANT/REVOKE
Next
From: Andrei Lepikhov
Date:
Subject: Re: Do not scan index in right table if condition for left join evaluates to false using columns in left table