| 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-04 11:42:33 |
| Message-ID: | CAApHDvp6nYTa5CRA0ewDRbXrAznHCWX0R78j2pTHnKKEitDsfg@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
On Tue, 4 Aug 2026 at 22:41, Andrey Rachitskiy <pl0h0yp1(at)gmail(dot)com> wrote:
>
> I researched related past bugs and found this is already fixed in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126464 (reverse Inf handling in float_widen_lhs_range / range-op-float.cc).
>
> Jakub Jelinek says: Fixed also for 15.4+, as well as backported to 14.5 and 13.5.
Thanks for doing that work. I see that master isn't affected by this
particular issue. The changes made in 45cdaf366 must have shuffled the
code around enough that the bug isn't getting triggered.
As for what to do in the meantime... I can't think of anything that's
not painful in some way or another.
A few options which might be worth at least writing down:
1. Add a config precheck using the code you posted to the GCC bugzilla
as a configure test and if the bug appears, add -fno-thread-jumps to
CFLAGS.
2. Add a volatile qualifier to the result variable in float_mul().
3. Add a regression test for "SELECT area(circle '<(0,0),1e154>');"
and leave a comment saying the compiler is broken.
All of these seem quite terrible...
#1 ends up reducing pgbench -S TPS by half. (tps = 1058074 down to tps
= 542227 with -c 100 -j 100).
#2 would fix this one instance with probably minimal performance loss,
but there are quite a few other similar checks that would all need to
be edited. Also, at what point would we ever remove these?
Effectively, by removing them, that risks reintroducing the bug(s).
#3 is very likely not an option at the moment as the buildfarm would
hate it, but it might be an option at some point in the future, once
some time has gone by.
We could perhaps do #2 then remove it and replace with #3 in some
number of months or years.
Another thing that might be worth looking into is exactly which part
of 45cdaf366 resulted in this inadvertently getting fixed. Maybe
there's a realistic subset of that we can do to change the code enough
to not trigger the bug.
David
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andrey Rachitskiy | 2026-08-04 16:38:49 | Re: BUG #19593: area(circle) silently returns Infinity instead of raising "value out of range: overflow" |
| Previous Message | Andrey Rachitskiy | 2026-08-04 10:40:54 | Re: BUG #19593: area(circle) silently returns Infinity instead of raising "value out of range: overflow" |