Re: casting operand to proper type in BlockIdGetBlockNumber

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Zhihong Yu <zyu(at)yugabyte(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: casting operand to proper type in BlockIdGetBlockNumber
Date: 2022-03-03 19:00:14
Message-ID: 3342048.1646334014@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
>> We should fix these passing-null-pointer cases...

> Yeah, working on that now.

The attached is enough to get through check-world with
"-fsanitize=undefined" using RHEL8's clang 12.0.1.
Most of it is the same old null-pointer-with-zero-count
business, but the change in numeric.c is a different
issue: "ln(-1.0)" ends up computing log10(0), which
produces -Inf, and then tries to assign that to an integer.
We don't actually care about the garbage result in that case,
so it's only a sanitizer complaint not a live bug.

I'm not sure whether to back-patch --- looking through the
git logs, it seems we've back-patched some fixes like these
and not others. Thoughts?

In any case, if we're going to take this seriously it seems
like we need a buildfarm machine or two testing this option.

regards, tom lane

Attachment Content-Type Size
more-sanitizer-cleanups-1.patch text/x-diff 5.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2022-03-03 19:10:07 Re: Commitfest 2022-03 Patch Triage Part 1b
Previous Message Robert Haas 2022-03-03 18:47:20 Re: wrong fds used for refilenodes after pg_upgrade relfilenode changes Reply-To: