Re: BUG #19593: area(circle) silently returns Infinity instead of raising "value out of range: overflow"

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Andrey Rachitskiy <pl0h0yp1(at)gmail(dot)com>
Cc: malis(at)pgrust(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19593: area(circle) silently returns Infinity instead of raising "value out of range: overflow"
Date: 2026-08-05 02:30:37
Message-ID: CAApHDvohQiCYqoKPP-k0GK1AtTcCXD0VSafrCDU3yqYvigUwVg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, 5 Aug 2026 at 05:11, Andrey Rachitskiy <pl0h0yp1(at)gmail(dot)com> wrote:
> v2 drops escontext. The helpers are plain float8-returning wrappers
> around the existing noreturn float_*_error() calls. The return 0.0 is
> never reached. It is only there so the compiler treats the call as an
> ordinary returning call. That CFG change is what keeps gcc 13+ jump
> threading from deleting the outer isinf() check in float8_mul().

IMO, this seems like a reasonably clean way to resolve the issue. I
think it's quite good that we don't need to consider when to remove
this once the GCC fix is patched out of existence. Since master has a
good reason for using this pattern, that's going to stay, and we can
let this fix die as the back branches age out.

The outstanding question I have is, out of all the isinf(x) &&
!isinf(y) checks, is float8_mul() the only one that suffers from this?
Is it worth writing a set of regression tests that verify that's the
case, so we can have some confidence that we've not missed something
here?

David

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrey Rachitskiy 2026-08-05 04:41:32 Re: BUG #19593: area(circle) silently returns Infinity instead of raising "value out of range: overflow"
Previous Message jian he 2026-08-05 01:27:11 Re: MERGE/SPLIT PARTITIONS issues/questions