Re: Fix overflow hazard in interval rounding - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Fix overflow hazard in interval rounding
Date
Msg-id 20240213191401.jjhsic7et4tiahjs@awork3.anarazel.de
Whole thread Raw
In response to Fix overflow hazard in interval rounding  (Joseph Koshakow <koshy44@gmail.com>)
Responses Re: Fix overflow hazard in interval rounding
List pgsql-hackers
Hi,

On 2024-02-13 13:31:22 -0500, Joseph Koshakow wrote:
> Attached is a patch that fixes some overflow/underflow hazards that I
> discovered in the interval rounding code.

Random, mildly related thought: I wonder if it's time to, again, look at
enabling -ftrapv in assert enabled builds.  I had looked at that a few years
back, and fixed a number of instances, but not all I think. But I think we are
a lot closer to avoiding signed overflows everywhere, and it'd be nice to find
overflow hazards more easily. Many places are broken even with -fwrapv
semantics (which we don't have on all compilers!). Trapping on such overflows
makes it far easier to find problems with tools like sqlsmith.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: CI and test improvements
Next
From: Peter Geoghegan
Date:
Subject: Re: index prefetching