Re: BUG #16861: Undefined behavior in power_var_int under the address sanitizer when exponent is INT_MIN

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: niranjann(at)google(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16861: Undefined behavior in power_var_int under the address sanitizer when exponent is INT_MIN
Date: 2021-03-09 16:29:34
Message-ID: 20210309162934.GB26575@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Feb 11, 2021 at 10:59:47PM +0000, PG Bug reporting form wrote:
> The following bug has been logged on the website:
>
> Bug reference: 16861
> Logged by: Niranjan Nilakantan
> Email address: niranjann(at)google(dot)com
> PostgreSQL version: 13.2
> Operating system: Linux
> Description:
>
> The newly added test from
> https://github.com/postgres/postgres/commit/bc43b7c2c06c32264efe79d0b86abd41236f1d5b
> triggers an overflow/undefined behavior at this line
> https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/numeric.c#L10299
>
> Target contains warnings: UndefinedBehaviorSanitizer:
> signed-integer-overflow .../src/backend/utils/adt/numeric.c:10299
>
> This applies to all versions of Postgres.

Uh, I think we are trying to test for overflow here, which is why it is
triggering the warning.

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

The usefulness of a cup is in its emptiness, Bruce Lee

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexander Lakhin 2021-03-10 08:01:00 Re: BUG #16774: PostgreSQL clean build MINGW64 gcc but initdb fails, cannot find startadress CreateProcessAsUserA
Previous Message Yannick Collette 2021-03-08 16:54:42 Re: BUG #16774: PostgreSQL clean build MINGW64 gcc but initdb fails, cannot find startadress CreateProcessAsUserA