Re: BUG #19405: Assertion in eval_windowaggregates() fails due to integer overflow - Mailing list pgsql-bugs

From Richard Guo
Subject Re: BUG #19405: Assertion in eval_windowaggregates() fails due to integer overflow
Date
Msg-id CAMbWs4-i9Hk8+fyxoT88ixbrBYuT+2=d9nLqFLi8jfS3k_z68w@mail.gmail.com
Whole thread
In response to Re: BUG #19405: Assertion in eval_windowaggregates() fails due to integer overflow  (Richard Guo <guofenglinux@gmail.com>)
List pgsql-bugs
On Sat, Feb 14, 2026 at 8:00 PM Richard Guo <guofenglinux@gmail.com> wrote:
> Right, I noticed this one too.  Basically, nodeWindowAgg.c doesn't
> check for overflow when adding startOffsetValue or endOffsetValue.
> Since these values are provided by the user and can be arbitrarily
> large, simple addition does not seem safe.  I think we may need to
> switch to overflow-aware integer operations in all relevant code.

Here is an updated patch to fix all relevant code in nodeWindowAgg.c.

- Richard

Attachment

pgsql-bugs by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: 17.8 standby crashes during WAL replay from 17.5 primary: "could not access status of transaction"
Next
From: Andrey Borodin
Date:
Subject: Re: 17.8 standby crashes during WAL replay from 17.5 primary: "could not access status of transaction"