Re: Improving and extending int128.h to more of numeric.c

Dean Rasheed <dean.a.rasheed@gmail.com>

From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: John Naylor <johncnaylorls@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-10-24T19:30:09Z
Lists: pgsql-hackers
On Fri, 24 Oct 2025 at 15:23, Andres Freund <andres@anarazel.de> wrote:
>
> FWIW, there are a few interesting messages on the host of my buildfarm animal:
>
> Aug 19 02:05:31 andres-postgres-buildfarm-v6 kernel: traps: test_int128[1678696] trap divide error ip:55764d59802c sp:7fffc378f7f8 error:0 in test_int128[402c,55764d595000+4000]
> Oct 15 03:08:28 andres-postgres-buildfarm-v6 kernel: traps: test_int128[1984641] trap divide error ip:405a8c sp:7ffc41a93c88 error:0 in test_int128[5a8c,401000+5000]
> Oct 15 20:02:15 andres-postgres-buildfarm-v6 kernel: traps: test_int128[3346617] trap divide error ip:404b4c sp:7ffc709ab658 error:0 in test_int128[4b4c,401000+4000]
>

Ah, I presume this is because there is a small, but non-zero chance
that the test code will attempt to divide by zero, so it needs to make
sure that z32 is non-zero. Will fix.

Regards,
Dean